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!


Results Window does not load session history

Something broke in release 71 or 72 in the results window. When you click on the button to load an historical session from the database, nothing appears. I select an existing session with 170 warnings recorded (I can see them on the session compare), and click Load. There is a slight pause, it appears it is reading through the warnings, but then the Prolint node appears to the left and no child-nodes nor entries in the browse. I'm guessing the subscribed signature has changed?


Exclude.p error in first run.

Greetings.

v9.1A :(
I installed first time Prolint, and followed tutorial, but first file linted issues a (247) error (sorry, don't know english message, but is something like: Impossible to understand following to-- NOT LOGICAL (247)
c:\archivos de programa\progress\prolint\filters\exclude.p
and is the following line:
IF NOT LOGICAL(DYNAMIC-FUNCTION("ProlintProperty", "filters.excludelist")) THEN
RETURN.

That means I can't run on 9.1A?

Any help will be appreciated very much.
Godspeed.


emptyblock rule

Hi,

Prolint returns an error with blocks such as enable_UI and disable_UI eg...

PROCEDURE enable_UI :
/*------------------------------------------------------------------------------
Purpose: ENABLE the User Interface
Parameters:
Notes: Here we display/view/enable the widgets in the
user-interface. In addition, OPEN all queries
associated with each FRAME and BROWSE.
These statements here are based on the "Other
Settings" section of the widget Property Sheets.


request rule: SUPER should be last call in a 'teardown' method

Consider this example code:

   METHOD PUBLIC OVERRIDE VOID CreateThis ():
     SUPER:CreateThis().
     /* add some custom stuff to 'this' */
   END METHOD.

   METHOD PUBLIC OVERRIDE VOID DeleteThis ():
     SUPER:DeleteThis(). 
     /* remove the custom stuff from 'this' */
   END METHOD. 

As you can see, SUPER:DeleteThis() is now the first statement in the DeleteThis method but I believe it makes more sense, generally, when it is the last statement.
I have no idea how to automate such a code review though.


internal/prolint/rules/abbrevtable.p - rule incorrect for DataServers

The above rule does not work for DataServers - _file is being checked in ALL connected databases, it should only be checked in the Progress databases since they are the only ones that contain _file meta info. Insert the following at line 99:

if dbtype( v-idx ) <> "PROGRESS":U then
next dbscan.


defaultframe

undefined frame

The rule "defaultframe" gives this message when it finds instances of DISPLAY and UPDATE statements that are not using a previously defined frame.

Why use this rule?
This can be useful when you are trying to identify user interface components in your code base. It can also be helpful for applying standards.

Solution
Frames should be defined with either a DEFINE FRAME or FORMAT ... WITH statement.


How to create online help for a Rule

If you have created a rule you should also create an help page for it. Your rule will probably warn progammers that some code statement is not quite good, and then those programmers will probably wonder why you think it is not good and how they can solve it.

These are the steps how to create a help page:

1. go to http://www.oehive.org/node/11


database access not allowed in certain classes

One rule to enforce application layering: the DataAccess layer is allowed to acces the database, the business logic layer is not allowed to access the database directly but should delegate that to the DataAccess layer. So, create a rule that warns when a class tries to access the database when that class derives from "BusinessEntity" or from "BusinessTask" or from any other class in a configurable list of classnames. Or the other way around: no class can access the database except classes that derive from "DataAccess".


locate private methods that are never called

Make a new Prolint rule that warns when a class appears to have a private method that is never called.


How to get started?

I'm just getting started with ProLint and have a pretty basic question. Hope this is the correct place to post. If not, please let me know where I can find some help.

Is there a list of nodetypes somewhere? (in _template.p - the last parameter to run searchnode is a list of nodetypes to search) I looked through the Proparse documentation and I'm not finding it there either.

Thanks,
Barbara


Prolint in OpenEdge Architect

Hot from the Prolint laboratory: the proof-of-concept work-in-progress alpha-prototype of Prolint inside OpenEdge Architect.

The purpose is to make it very easy and super-productive to use Prolint while you are working on your OpenEdge project in OpenEdge Architect. You need OpenEdge Architect 10.1C for this.

The toolbar gets a "run Prolint" button, somewhere close to the Run and Debug buttons, and when you press that Prolint button you start to lint the currently selected resource. That can be:
- the file in the active editor, or


how to sync editor in OpenEdge Architect??

I am trying to integrate Prolint in OpenEdge Architect (=Eclipse). I have made a new results view (programmed in ABL, not in Java) and it docks nicely in Eclipse as a tab next to the existing Console, Tasks and Problems views.
This new view has a browse widget that shows the warnings that Prolint has found.
For each line in the browse widget we know the sourcefile and line-number.


REPEAT FOR xx generates SHARE-LOCK rule

the following code:

REPEAT FOR CampaignData TRANSACTION lv_i = 1 TO 100 :

gives the incorrect rule :

FOR CampaignData has no NO-LOCK / EXCLUSIVE-LOCK


nopprsininclude

No Preprocessors in include

(explanation what this rule does, should go here. I don't know what the rule does)

This is a contributed rule, which means it is not part of the standard Prolint setup but you can download it separately from the Subversion reporistory and save it in your local prolint/contribs/rules path.
See http://www.oehive.org/node/1150 for more information on contributed rules.

Actually this is just an experiment, belonging to the proposal which is described in http://www.oehive.org/node/1150


Contributed rules

Traditional situation:
Up until Prolint release 73, Prolint supports two groups of rules: standard rules and custom rules. Standard rules are installed as part of the Prolint distribution. Custom rules don't come from the Prolint website; a custom rule is created by the Prolint user and never committed to the Prolint website and hence not available to other users.
When someone wants to share their custom rules, they have to be accepted by project admin (=Jurjen) and then wait until the next Prolint release.

New: Contributed rules


#
Syndicate content