Prolint is a tool for automated source code review of Progress 4GL code. It reads one or more sourcefiles and examines it for bad programming practice
When you are interested Prolint, you are encouraged to subscribe to this group where you find the on-line tools to collaborate and discuss Prolint. There is a discussion forum, you can submit issues (for bugs and enhancement requests), you can modify the on-line documentation. So subscribe, and then don't forget to go to your subscription details to enable the e-mail notification!
When you upgrade to Prolint 71 from an older Prolint release and you were already using the Roundtable integration, then you will experience errors until you make the following fix:
Locate in your Roundtable directory the compiled file "rtb_evnt.r" and delete it.
Locate in your Roundtable directory the sourcefile "rtb_evnt.p" and open it in your editor.
Find the line where prolint/rtb/custom_evnt.i is included:
{prolint/rtb/custom_evnt.i}
and change it to
{prolint/roundtable/91c/custom_evnt.i}
Optionally compile+save rtb_evnt.p.
I'm working my way through call resolution for Prolint, and found something that looks like dead code.
It looks like procedure ProcessFieldRUsage in nameconv.p is just a copy/paste from varusage.p. I think it's unused and should be removed. It has a call to AddDetectedUsage, which is only defined in varusage.p (which doesn't appear to be a super of anything)... so that call would fail if it was ever executed.
I noticed that the download page for Prolint wasn't very unix friendly - the only options were the Windows .exe installers.
I added some notes, with a URL, for fetching a release 'tarball' using the WebSVN UI. It's surprisingly slick! Worked great for me on my Linux machine.
Following code in GO trigger:
DEFINE BUFFER buf-dossier-path FOR dossier-path.
DEFINE BUFFER buf-combinations FOR combinations.
IF g-asp THEN DO:
CREATE QUERY qh.
qh:SET-BUFFERS(BUFFER buf-dossier-path:HANDLE, BUFFER buf-combinations:HANDLE).
END.
Gives "Local BUFFER buf-dossier-path is not used." and "Local BUFFER buf-combinations is not used."
Hello,
Does anyone know if Prolint works with RoundTable10.1B???
I was following the installation procedures but stuck where it says to add the include {prolint/rtb/custom_evnt.i}
to the .p "rtb_evnt.p" since this file doesn't exist.
There is a file called rtb_events.p but the it doesn't compile when added the include.
Is there any workaround for this??
Thanks,
Fernando.
In the following code Prolint 70 gives 'no buffer defined for table Customer' for the line (BUFFER P_bCustomer FOR Customer): and again for the line FOR EACH bCustomer NO-LOCK:
I found some old code of a programmer that didn't understand how to use sequences.
The code goes like this:
-----------------------
CREATE SomeTable.
SomeTable.UniqueID = CURRENT-VALUE(SomeSequence).
NEXT-VALUE(SomeSequence).
-----------------------
Prolint gives an entry to the "noeffect" rule on the third line ("NEXT-VALUE(SomeSequence).").
The rule “upcasepreproces” gives a warning if a &GLOBAL-DEFINE or &SCOPED-DEFINE preprocessor is not all upper case. This is simply a standard that you can choose to follow or not. Using upper case for constants is a broad industry standard, and preprocessors are routinely used as constants. Even when used for other purposes, it helps readability and understanding if the preprocessor name is upper case.
The Risk:
No risk, this is a style/maintainability issue.
How to solve this:
The rule “release” provides a warning any time it runs across the RELEASE statement. This is because most programmers have a misconception of what the command actually does.
The Risk:
The rule “nowait” provides a warning if the program accesses a record with an EXCLUSIVE-LOCK and does not include a NO-WAIT. This rule is most effective for WebSpeed code.
The Risk:
A background process that attempts to get an exclusive lock on a record/row can wait until the value of the –lkwtmo parameter expires. This can cause a timeout on either the WebSpeed agent or the web server.
How to solve this:
Add a no-wait and logic to deal with the LOCKED condition, or do not use EXCLUSIVE-LOCK.
The rule “nooutputto” gives a warning if the program redirects output to another source (OUTPUT TO textfile.csv). This is in support of an EarthLink standard, as the primary use of OUTPUT TO is to generate log information. A Log Manager was created for this purpose, and the standard is to use it.
The Risk:
Violation of EarthLink standard, and chaotic log file management (even if you’re not EarthLink).
How to solve this:
Use Log Manager.
How to suppress these warnings:
The rule “nonestinc” provides a warning if you are including a include file within another include file (nesting include files).
The Risk:
When you have multiple levels of nested includes, the maintenance of programs becomes increasingly difficult. In addition, you can start constructs in one include file and end them in another. Imagine starting a transaction in include A, then ending it in include D. Are you even aware that you are in a transaction during includes B and C?
The rule “nolonglines” provides a warning if the source line is longer than 80 characters. You may wish to customize the ‘80’ for your environment and editing tools.
The Risk:
It is sometimes difficult to understand programs with lines longer than your editor can support. Many unix editors are set to the emulator’s width, and typically that is 80.
How to solve this:
Reformat your code to <80 characters.
How to suppress these warnings:
Disable the rule or change the width.
The rule “nolike” presents a warning when it encounters a definition of a variable, parameter, or temp-table field “like” a field in the database. Defining a temp table like another or like a database table is acceptable. It is variables, parameters, and fields that are not.
The Risk:
The rule “nohardcodeemail” gives a warning when it finds what appears to be a hard coded email address within a uncommented literal. It looks for any occurrence of “x@x” where x is any string.
The Risk:
Email addresses change over time, and the proper email address should be retrieved from some database or configuration file source rather than hardcoding it in a program.
How to solve this:
Get the email address out of the database, or fool the system by stringing it together x + @ + x.