Organizations often want to improve code quality by forcing developers to meet certain criteria before allowing them to commit code to their source control system. IBM Rational Team Concert (RTC) allows project administrators to define preconditions that must be met prior to source code delivery. Some typical RTC source control delivery preconditions are Prohibit Workspace Errors and Require Work Items. With Rational Application Developer (RAD), users can also select code delivery preconditions such as “Prohibit Unsatisfactory Code Coverage” to ensure code coverage analysis is run and meets a certain predefined threshold.
With Rational Application Developer v9.5 Beta installed in the same package group as RTC client, RTC administrators can now select a delivery precondition that requires Software Analyzer to be run and for change sets to pass predefined static code analysis rules. When setting the Require Satisfactory Software Analyzer Result precondition, administrators are able to select which static code analysis rules to enforce. This precondition prevents any change sets from being delivered that contain selected static code analysis rule violations.
Software Analyzer Team Advisor requires IBM Rational Team Concert client 4.x or 5.x to be installed and requires RTC administrator privileges for its configuration.
- Open a project area from the Team Artifacts or Team Organization view.
- Click on the Process Configuration tab in the project area editor view.
- Expand the Team Configuration section and click the Operation Behavior section.
- In the Operations list, select Source Control > Deliver (client) and then select the icon in the specified user group column, e.g. selecting Everyone (default) would have this precondition applied for everyone.
- In the Preconditions list, click Add.
- In the Add Preconditions dialog box, select Require Satisfactory Software Analyzer Result and then click OK.
- In the Preconditions list, ensure that Require Satisfactory Software Analyzer Result is selected. This will cause the precondition description area to populate with settings that are specific to Software Analyzer.
- In the precondition description area Rules list, select the Software Analyzer rules that you want to enforce for all code delivery. Custom rules can also be defined to supplement the existing Java Code Review and Software Metrics rules.
- Select the Severity Threshold for gating delivery. Code delivery will be prevented if any rules with a severity level at or above the selected threshold are violated. Only rules that have a severity level will be affected by the Severity Threshold setting.
- Save the change made to the project area.
With the Require Satisfactory Software Analyzer Result source delivery precondition set, every time a team member attempts to deliver a change set, the change set is analyzed, checking for any selected rule violations. If the change set violates the threshold set for any of the selected rules, code delivery will fail and the Team Advisor view will open, indicating that an Unsatisfactory Software Analyzer result prevented successful delivery.
Clicking the Software Analyzer Results link will bring up the Software Analyzer Results view allowing the developer to see which static analysis rules were violated, and in some cases providing the developer with suggested quick fixes. The developer must fix all rules violations shown in the Software Analyzer Results before being able to successfully deliver their code changes.
Here are examples of some Software Analyzer Results for Java code review and Java Software Metrics. The Software Analyzer Results can also be exported in an XML file or as an HTML or PDF report.
Java Code Review result view as Tree:
Java Code Review result view as Table:
Java Software Metrics result view By Rule:
Java Software Metrics result view By Resource:
With the Software Analyzer RTC Team Advisor feature in Rational Application Developer v9.5 Beta, organizations using IBM Rational Team Concert for source control can easily select static analysis rules to gate code delivery, thereby improving code quality.
For more information about Software Analyzer Team Advisor, visit our Knowledge Center
* To find out more about Rational Application Developer V9.5 Beta, visit our Early Program site
* To join a discussion or ask questions about Rational Application Developer V9.5 Beta, visit our Beta Forum
* To learn more about IBM Rational Application Developer, visit our product wiki