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!


findstate-tt reports on FIND when unique index is used

Have following code:

DEFINE TEMP-TABLE ttAccount NO-UNDO
FIELD Id AS CHARACTER
INDEX i1 IS UNIQUE PRIMARY Id.

FIND ttAccount WHERE ttAccount.Id = "xyz" NO-ERROR.

The findstate-tt rule reports this and suggests a "FIRST/LAST" or "IF AMBIGUOUS" but the index is UNIQUE.

Is this expected behaviour?


tablename rule reports unqualified fields in FIELDS()

Code such as
FOR EACH Customer FIELDS(Id Name) NO-LOCK:

reports that the "Id" "Name" should be qualified with table name.

Is this intentional behaviour or should I log an issue?


Prolint results screen - Open sourcefile in Editor

On the 'Prolint results screen' there is a button labelled 'Open sourcefile in Editor'.

I run Prolint from PRO*Tools and use the 'Lint Active AB' button.

When I click the 'Open sourcefile in Editor' button nothing happens. Is something supposed to happen?


new rule help

Hi, all.

We just recently acquired proparse and prolint. I am looking into writing some new rules. I have not finished reading all the doc available at joanju.com, or fully absorbed the syntax tree. But I was hoping you folks could help me short-circuit the process a little. I am wondering if any of you
a) have written these rules
b) have suggested starting points to help me locate how to find them in the tree
c) be able to tell me "No can do"

on several rules I am looking at implementing.
1) No nested includes


Can you dynamically change the propath with proLint?

Just like you can do with Progress. I work on lots of projects and this ability would be great.


nestedfunc

function is defined inside a code block

Prolint rule "nestedfunc" warns when it finds a function definition (or a procedure definition) inside a code block.
For example:

FOR EACH customer :
    FUNCTION Foo RETURNS CHARACTER (city AS CHARACTER) :
    END FUNCTION.
END.

... because it is plain silly and ugly to do that, even if the compiler accepts it.
Functions (and procedures) should not be defined inside code blocks.


inclowercase

Compile will fail on Unix, use only lower-case includefiles

Rule "inclowercase" will raise this warning when it finds an include directive that has uppercase characters. For example:

   {subdirectory/IncludeFile.i}

The reason for this warning is that this sourcefile will not compile on Unix. Change the name to all lowercase so the source can be compiled on Unix and on Windows.
The assumption is of course, that sourcefiles are FTP'd to Unix with the "lowercase name conversion" option set in the FTP program.


incslash

Compile will fail on Unix, don't use backslash in includefiles

Rule "incslash" will raise this warning when it finds an include directive with backslashes. For example:

   {subdirectory\includefile.i}

The reason for this warning is that this sourcefile will not compile on Unix. Change the backslash into a forward slash so the source can be compiled on Unix and on Windows.


Prolint release 69 is now available

Prolint 69 is ready!
It requires Proparse 3.1a that was released by John two days ago.

This release of Prolint could be aliased as "the OOABL release", because it can analyze every Object Oriented syntax construction. When it analyzes a class, it even looks in inherited classes to take inherited properties and non-private variables from those ancestors into the equation. Try that with grep :-)
But of course Prolint can still run in Progress 9 and analyze "traditional" procedural code as well.

In fact there are some new rules that are usefull for procedural source:


usingpkg

USING package, replace by USING type (without wildcards)

Rule "usingpkg" warns when it finds a USING statement with package globs. In other words:

USING package.ClassName

is recommended instead of:

USING package.*

The use of fully qualified class names, rather than package globs, seems to be a commonly preferred practice in other languages with similar language features.


Rule to discourage the use of package globs

I'd like to suggest a low priority rule to discourage the use of package globs. In other words:

USING package.ClassName

is recommended instead of:

USING package.*

The use of fully qualified class names, rather than package globs, seems to be a commonly preferred practice in other languages with similar language features.


Prolint doesn't see function definition

Prolint doesn't find the definition of a function inside a do...end block. Therefore i get false positives on rule Tablename... this is unexpected. Since we use the results of Prolint to determine whether an object can be checked in to RoundTable or not, i can't complete the object to which this problem applies.

Example:

if test = true then
do:
function MyFunction returns logical
(input cTest as character):
end function.
end.


Engine Overheating - How can I turn this off?

This is a time-consuming process to have to enter the 3 char code every couple of minutes. Can this be turned off or bypassed?

Can prolint be run as a batch process?


Prolint release 67 available

Only one week after release 66, so this must be a bugfix release...

Prolint learned some more about OOABL syntax. A new rule was added (publicvar) to search for PUBLIC VARIABLE statements in class files, because they have to be replaced by PROPERTIES in my humble opinion.

Not everything in release 66/67 is about OOABL.
The new rules bufdbproc, bufdbfunc and bufdbmeth are effective in "oldfashioned" procedural ABL too. But last week I made a silly bug in those rules and fixed it.

To get your free copy..... go to the download page!


publicvar

replace public variable &1 by property

Rule "publicvar" gives this warning when it finds a DEFINE PUBLIC VARIABLE statement in a class. The statement should be replaced by a (public) PROPERTY.

Motivation

Encapsulation: a class is responsible for its own state. A public variable allows other objects and procedures outside the class to manipulate the state of the class, so that can't be right.


#
Syndicate content