Prolint

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!


Prolint and RoundTable10.1B?

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.


False positive on bufdbfunc

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:


The noeffect rule should exclude NEXT-VALUE(SomeSequence)

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).").


upcasepreproces

Preprocessors should be in UPPERCASE

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:


release

Release may be used incorrectly

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:


nowait

Exclusive Lock used without NO-WAIT

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.


nooutputto

Instead of Output To, Use Log Manager

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:


nonestinc

Nesting Include Files is not difficult to maintain

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?


nolonglines

Line is longer than 80 characters

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.


nolike

LIKE is Not Allowed When Defining Variables Or Temp Table Fields

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:


nohardcodeemail

Hard Coded Email Addresses are not allowed

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.


noglobaldefine

Global Defined Preprocessors are not allowed

The rule “noglobaldefine” presents a warning when it encounters an uncommented string “&GLOB”. This practice, while necessary in certain limited cases, encourages bad practices and makes code very difficult to maintain.

The Risk:


nobreakby

Unnecessary Break By encountered

The rule “nobreakby” gives a warning if it encounters a “BREAK BY” without a corresponding FIRST() FIRST-OF() LAST() or LAST-OF() function. This can be solved by removing the word “BREAK”.

The Risk:
A BREAK BY causes extra sorting before processing the selected record set. If you are writing a report that needs control breaks, this can save a bit of effort. If you do not need the break points, you are adding unnecessary overhead to your program – BY without the BREAK will give you the sort order you need.


mustincludepcf

Batch Programs Must Include PCF

The PCF rule gives a warning whenever the following include is not found in the compilation unit: {sys/batch_api.i}. This is a rule specific to EarthLink. All batch jobs must invoke the Process Control Framework and report their status to it. This rule should be disabled by anyone not at EarthLink. If encountered in a non-batch program, this indicates that the developer is using the wrong rule profile.

The Risk:
Violation of EarthLink coding standards.

How to solve this:


Prolint 70 is now available

Prolint 70 is now available! Note: It requires ProParse 3.1a released in April 2007.

This release is all about the Prolint database. It provides a session identifier with any lint session, like Progress Profiler’s Profiler ID, so that you can compare sessions over time. This allows you to see the improvement (or the opposite) over time as people work on the code.


#
Syndicate content