Creating user-written rules

User-written rules are implemented by Java™ classes that call COBOL or PL/I code review APIs. The code review rules are written in Java 8, therefore any user-written rules or rule or category extensions must be written in Java 8. Software Analyzer does not support Java 11.

Before you begin

Eclipse plug-in development requires the Plug-in Development perspective. This perspective is not enabled by default in Developer for z/OS®. To enable it:
  1. Open the Preferences window.
  2. Navigate to General > Capabilities.
  3. On the Capabilities page, expand Development and select Plug-in Development.
  4. Click Apply and Close.
To open the perspective, click Window (on Windows) or IBM® Developer for z/OS (on macOS) > Perspective > Open Perspective > Other, and then select Plug-in Development and click Open.

About this task

To create a user-written rule, follow these steps:
  1. Use a wizard to generate a plug-in project for COBOL or PL/I code analysis. Specify the types of code statements that you want to analyze.
  2. Develop Java code that calls the code-analysis APIs. You can inspect the types of code statements that you are interested in and either accept or reject each instance.
  3. Install your user-written rule plug-in into the development workbench.

Each of these steps is described in more detail in the following topics.

After you create and install a user-written rule project, you can later add more rules to it. See the links at the end of the topic.

Note: User-written rules are different from custom categories and custom rules. You create custom categories and rules with wizards in which you can select processing options for certain types of rules. See the link at the end of the topic.