You can also let your source code be analyzed by static analysis ("lint") during the code generation. This determines whether or not your source code complies with the coding guidelines that you defined – according to the idea behind the "lint" analysis tool.
-
You activate the rules to the checked in the “Project Settings” dialog, “Static Analysis Light” category. The check itself is performed automatically each time code is generated, for example when you click “Build Generate Code”. If divergence from the rules is determined, then it is reported as an error message in the “Build” category of the message view. The reported errors have the prefix
SA<number>
.




NOTICE

For static code analysis with “Static Analysis Light”, only the application code of the project is checked. Libraries are excluded from the check.
GVL variables in the “POUs” view are not necessarily checked: If you have a project with several applications, then only the objects in the active application are checked. If you have only one application, then the objects in the common POU pool are also affected.
“Static Analysis Light” includes only a reduced set of rules in the default development system. A larger set of rules, additional naming conventions, and metrics are available when you install the CODESYS Static Analysis add-on.
-
Deactivating lines of code in the implementations with pragmas from the static analysis
-
Excluding programming objects with pragmas from the static analysis