ARCAD CodeChecker for RDi
The ARCAD CodeChecker plug-in for RDi is designed for the RDi integrated development environment (IDE).
The plug-in is designed for developers working in the RDi IDE. It enables developers to test the quality of the source code they are working on by executing active rule sets or specific quality rules, and know instantly if the source code does not comply with the standards set for the development team. With the plug-in, developers can easily know which quality rules are failing and identify which part of their source code is causing the failure. The portions of code causing the failures are clearly identified, making it easy for developers to modify their source code to comply with the quality standards.
The ARCAD CodeChecker plug-in for RDi must be connected to the CodeChecker Server to access and use all the elements required for carrying out a code review process.
The plug-in cannot be used if it is not connected to the CodeChecker Server.
Follow the subsequent steps to connect to the CodeChecker Server.
Step 1 To access the Preferences window, open the Window menu then select Preferences.
Step 2 Expand the ARCAD CodeChecker node on the left-hand side of the window and select Connection.
Step 3 Define the following fields:
- Connection
- Sets a unique name for the connection to the CodeChecker Server.
- Address/IP
- Sets the http, https or IP address used to connect to the CodeChecker Server
- Port
- Sets the port number used to connect to the CodeChecker Server. By default, the CodeChecker Server uses the 5253 port number or the 52530 port number for the secured connection (HTTPS), but these numbers may have been changed during configuration.
- Use HTTPS
- Enable this option to use a secure connection.
Step 4 Click Test connection to make sure the connection is successful after entering your ARCAD CodeChecker credentials to access the server.
Step 5 To save any changes made, click Apply.
Result The plug-in is connected to the CodeChecker Server and is ready to be used.
If the plug-in is not connected to the CodeChecker Server and you try to use one of its features, a message appears to inform you that a connection to the server is required.
Click Yes to access the Server Configuration menu and connect to the server, or No to cancel the operation.
Editing the TLS settings makes it possible to specify the Trust Store to use when connecting to CodeChecker Server through secure URL (https).
Follow the subsequent steps to redefine the security store parameters.
Step 1 Click on the Edit TLS Settings button.
Step 2 Edit the absolute paths to the Trust- and KeyStore as well as the passwords required to access and modify the files to use your own keys.
Trust Store Properties | Key Store Properties | |
---|---|---|
File Name | The absolute path to the TrustStore file. | The absolute path to the KeyStore file. |
Password | The password required to access to this file. The default password for the ARCAD key file is quadra. | The password required to access to this file. The default password for the ARCAD key file is quadra. |
Step 3 Click the Import Certificate button to import your own certificates into the file indicated in the TrustStore path.
Step 4 Click OK to save your changes or Cancel to keep the default settings.
Result The plug-in is connected to the CodeChecker Server and is ready to be used.
The Reset button resets the security store file information to the default values provided by ARCAD.
The ARCAD CodeChecker plug-in for RDi can be accessed two ways in RDi:
- from the Remote Systems view of the Remote System Explorer perspective,
- within an i Project in the i Projects perspective.
The plug-in does not have its own perspective in RDi: the features are accessed from the contextual menu.
To access the plug-in, right-click on a program file to open the contextual menu. The features are available in the ARCAD CodeChecker menu.
The plug-in is only available for source members. It is not available if you open the contextual menu for another type of file.
These preferences options are specific to the RDi studio. The Configuration Management role is required for this task.
To access the Preferences window, open the Window menu then select Preferences. Open the Rules execution settings.
- Maximum concurrent executions
- Set the maximum number of concurrent executions of rules in ARCAD CodeChecker. When executing with the ARCAD CodeChecker plug-in for RDi, executions of the rules will be queued.
- Disable delta comparison (from ARCAD Skipper)
- By default, when running an execution on ARCAD Skipper components, a delta comparison process is applied on issues found in the component in version and issues found in the component in the application repository. If the issues are found in both versions, they are ignored.
- Tick this checkbox to disable this comparison process when running executions on ARCAD Skipper.
This parameter does not apply to executions performed from the Remote System Explorer.
The Quality rules used to analyze the source code of an application are grouped into rule sets in the CodeChecker Studio.
Use rule sets to organize quality rules in a logical way: by language, by theme, and so on. The standard quality rules are already organized into several generic rule sets. You can create new rule sets to manage and categorize your custom quality rules, or re-organize the standard quality rules to fit your needs.
A rule set must be activated to be used.
When a rule set is activated, it becomes available in the plug-in and it is possible to execute all of its quality rules to test the code quality of a source member.
The list of active rule sets is displayed in the Rule Sets view. To access this view, either:
- right-click on a source member and select ARCAD CodeChecker > Display rule sets, or
- open the Window menu and select Show View > Other..., then open the ARCAD CodeChecker node and select Display rule sets. Click OK.
The Rule Sets view displays the list of active rule sets available, and gives more information about the rule sets and the quality rules they contain. In the rule sets, double-click on a quality rule to open its documentation in a your default web-browser.
Contact the person in charge of managing quality rules in the CodeChecker Studio if difficulties are encountered with the quality rules.
- Rule set
- Rule sets are identified by the rule set icon and are used to organize quality rules in a logical way. Expand a rule set's node to display the quality rules contained in it.
- Name
-
The names of the rule sets and quality rules are displayed:
- for rule sets, the name is followed by the rule set's ID between parentheses,
- for quality rules, the name is followed by the list of applicable languages between square brackets.
Warning!Quality rules can only be executed on source members written in one of their applicable languages.
- Failure level
-
The icons that identify each quality rule indicate the failure level given to each rule.
There are three hierarchical levels of failure in ARCAD CodeChecker:
- FATAL, the most critical,
- WARNING, and
- NOTICE, the least critical.
The failure level given to a quality rule depends on the code quality that needs to be achieved.
Users with the Rule Management role in the CodeChecker Studio determine the failure level to give to each quality rule, and give the appropriate meaning to each failure level.
- Description
- Select a rule set or a quality rule to display its short description below the list of active rule sets. Double-click on a quality rule to open its documentation in a your default web-browser.
Executing quality rules on a source member means that the source code of that source member is analyzed and compared with the logical conditions defined in the quality rules. If the source code complies with the quality rules, the execution does not return errors in the Error List view. If the source code does not comply with one or several quality rules, the execution returns errors with different failure levels depending on the failing quality rules.
For more information about the error list, refer to Managing error lists.
There are several options to execute quality rules on a source member:
- Executing all the quality rules contained in all the active rule sets.
- Selecting and execute quality rules to only execute specific quality rules.
- Executing the last-used quality rules sets to execute the last-used quality rules.
Quality rules should only be executed on a limited number of source member at a time for better performance. The number of concurrent executions can be set in the preferences.
For more information about the rule execution preferences, refer to Setting rules execution preferences.
You can execute all of the quality rules to any selected source. Follow the subsequent steps to execute all the quality rules at once on a source member.
Step 1 From the Remote Systems view of the Remote System Explorer perspective, or within an i Project in the i Projects perspective, right-click on the source member to analyze.
Step 2 Select ARCAD CodeChecker > Execute all quality rules.
Result The execution starts in a batch job. The selected quality rules are loaded and applied one after the other to the selected source member.
The execution status is displayed in the Running Executions view.
When the execution is complete, the results of the analysis are displayed in the Error List view, which opens automatically.
Follow the subsequent steps to select specific quality rules to execute on a source member.
Step 1 From the Remote Systems view of the Remote System Explorer perspective, or within an i Project in the i Projects perspective, right-click on the source member to analyze.
Step 2 Select ARCAD CodeChecker > Select and execute quality rules.
Step 3 In the wizard, expand each rule set's node and check the boxes of the quality rules to execute.
By default, all the rule sets and quality rules are checked. Uncheck a rule set to automatically uncheck all its quality rules.
Click Finish.
Result The execution starts in a batch job. The selected quality rules are loaded and applied one after the other to the selected source member.
The execution status is displayed in the Running Executions view.
When the execution is complete, the results of the analysis are displayed in the Error List view, which opens automatically.
You can execute the last-used rule sets to any selected source. Follow the subsequent steps to re-execute the last-used rule sets to a source.
Step 1 From the Remote Systems view of the Remote System Explorer perspective, or within an i Project in the i Projects perspective, right-click on the source member to analyze.
Step 2 Select ARCAD CodeChecker > Re-execute last-used rule set.
Result The execution starts in a batch job. The selected quality rules are loaded and applied one after the other to the selected source member.
The execution status is displayed in the Running Executions view.
When the execution is complete, the results of the analysis are displayed in the Error List view, which opens automatically.
The Running Executions view displays all the executions launched. It enables you to get detailed information about the status of the execution (succeeded / failed, running, pending) and the execution duration and parse status.
The execution logs and parse problems can be accessed from this view. Right-click on an execution result and choose the desired option the contextual menu:
- Show execution logs
- Show parse problems
To remove past executions, right-click in the view and choose Clear finished executions.
Follow the subsequent steps to export issues.
Step 1 Select the execution result the Running Executions view. Multiple lines can be selected to aggregate the issues in a single export.
Step 2 Right-click on the selected execution result(s) and choose Export issues.
Step 3 Select the export format (CSV, XML or JSon) in the dialog. Click OK.
Step 4 Choose the name of the export file and the location where to save the .file. Click Save.
Result When the export is finished, a dialog is displayed to confirm the status of the export.
Re-executing the rules of an execution allows to perform again the same quality rule checks on the same sources than the selected issue.
To re-execute past executions, select the execution result the Running Executions view. Multiple lines can be selected to re-execute several issues. Right-click on the selected execution result(s) and choose Re-executing. The execution results are refreshed in the view.
When quality rules have been executed on a source member, the execution can return errors if the source code of the member did not comply with the quality rules. These errors are displayed and managed in the Error List view.
To access this view, either:
- right-click on a source member and select ARCAD CodeChecker > Show latest execution results to display the error list returned during the last execution, or
- execute quality rules on a source member.
The Error List view opens automatically when the execution is complete.
For more information about executing quality rules, refer to Executing quality rules.
The Error List view displays all the errors returned during the execution for each quality rule executed. If a quality rule is not displayed in this view, it means the source code complies with that quality rule.
The ID column displays the quality rule's name. The icon indicating the failure level is displayed to the left of the ID column.
For more information about failure levels, refer to Failure level.
The Message column explains why the quality rule is failing. This message gives more information to help understand what is making the quality rule fail.
The Severity column displays a value depending on the failure level of the quality rule: 0 for NOTICE, 10 for WARNING, 30 for FATAL, and 40 for ERROR.
The Line column displays the line number of the source member where the error is located.
The Location column displays the source library and the source file of the member.
The Connection column displays the server on which the source member is located.
Each failure represents an occurrence in the source code of the member where the condition defined in a quality rule was not respected. Follow the subsequent steps to correct the failures displayed in the Error List view.
Step 1 In the Error List view, double-click on the desired failure line.
Result If it was not already, the source member opens in an LPEX editor. The source member opens at the line number where the failure is located, and shows the failure in context. The failure is highlighted and is followed by the quality rule's name and the failure description, written in pink.
Some failures cannot be shown in context. For example, if a quality rule checks that there is at least one line of comment in the source code and the comment line does not exist, the program opens with the cursor on the first line and the failure is not highlighted.
Step 2 Modify the source code to correct the failure. The modifications will depend on the source code, on the failure, and on the condition defined in the quality rule.
Step 3 Save any changes made to the source code.
Step 4 Execute the quality rule on the source member again to refresh the list of failures in the Error List view and to make sure that the failure is no longer detected in the list.