Code Watch app

The Code Watch app performs a custom code analysis based on transports, ChaRM change requests, named objects, development classes, or developers who have created or modified custom code. The app reports on rule violations in the ‘Run and Optimize’ quality scenario.

DevOps categories

Development.

Prerequisites

If a support pack or transport has not been applied to the Analysis system, it must be disassembled before the Code Watch app can analyze it. This can be done in SAP by running the SAINT transaction and selecting ‘Disassemble OCS Package’ from the Utilities menu. Alternatively, the support pack or transport may be disassembled in LiveCompare using the Package Disassembler app.

This prerequisite does not apply if the app is used to analyze other items, for example, custom objects, development classes or developers.

Run the app

To run the Code Watch app, select the app from the Apps screen and create an app variant. Complete the variant screen as follows:

Objects to Analyze

  • If required, edit the ‘Transports’ table to provide a list of transports to be analyzed on the Analysis system.

  • If required, edit the ‘ChaRM Change Requests’ string list to provide a list of ChaRM change requests to be analyzed on the SAP Solution Manager system.

  • If required, edit the ‘Development Classes’ table to provide a list of development classes to be analyzed on the Analysis system. The wildcard character * may be used when specifying development classes.

  • If required, edit the ‘Developers’ table to provide a list of developers to be analyzed on the Analysis system.

  • If required, edit the ‘Objects’ table to provide a list of objects to be analyzed on the Analysis system.

SAP systems

  • Set the ‘Analysis System’ field to the RFC Destination for the system that contains the transports, named objects or developers to analyze.
  • If you wish to analyze one or more ChaRM change requests, set the ‘SAP Solution Manager System’ field to the RFC Destination for your Solution Manager system.

Analysis options

  • The app is configured to use the ‘Run and Optimize’ quality scenario. Edit the ‘Analyze ABAP Quality Rule Selections’ parameter if required to specify the quality scenarios, categories and rules to be used in the analysis.

  • Set the ‘Changed Code Only’ switch to On to perform a code quality analysis for changed code only. This applies to includes (INCL), functions (FUNC) and programs (PROG). Set the switch to Off to perform a code quality analysis of all the code.

  • If the ‘Changed Code Only’ switch is set to on, set the Compare Revision field to the number of revisions to go back when identifying changed code. The default value is 1, which means use the previous revision.

Click ‘Run’. When the variant has completed, its results may be accessed from the App Cockpit screen.

App results

The Code Watch app generates a Dashboard report, which includes the following charts:

  • The Quality Scorecard column chart displays the number of code objects in the Low, Medium and High complexity rankings for each of the analyzed rule categories.
  • The Warning vs Error Summary pie chart summarizes the number of rule violations in the Error and Warning classes, excluding rules in the ^ ABOVE TRIGGERED BY ^ class.
  • The Errors by Rule (Top 10) bar chart lists the top 10 violated rules in the Error class, displaying the number of code objects that triggered each rule.

The Dashboard report also includes links to the following reports:

Code Watch Details

This Excel report includes the following spreadsheets:

Dashboard

This spreadsheet includes the charts described above.

Help (Quality Scorecard Chart)

This spreadsheet lists descriptions for the quality scores used in each of the categories.

Quality Scorecard

This spreadsheet provides a quality score for each custom object, in each of the analyzed categories.

Rule Break Summary

This spreadsheet provides a summary of the quality rules that were triggered for each custom object.

Rule Break Detail

This spreadsheet provides details for each custom object that triggered one or more quality rules. In this spreadsheet:

  • The LINE_NUMBER column stores ABAP source code line number in which the violation was detected. For Web DYNPRO (WDYN) objects, methods are stored in include files, and the line number refers to the position of the source code line within its method. For other object types, if the INCLUDE column for the violation contains a value, the line number refers to a line in the INCLUDE file.
  • The SEQ column stores the ABAP source code line number in which the violation was detected. For Web DYNPRO (WDYN) objects, this column refers to a line number in the object’s INCLUDE file. This column may be used when sorting the Rule Break Detail dataset to display the violations for each object ordered by line number.

Detections by Rule

This spreadsheet lists each of the rules specified in the app’s ‘Analyze ABAP Quality Rule Selections’ parameter, and the number of times each rule was invoked by the app’s source objects. Each rule’s scenario and category are also shown.

Analysis Input Data

This Excel report contains a copy of the input parameters used to produce the app’s Dashboard report. The value of each input parameter is stored in a separate worksheet, which is named after the parameter whose value it contains.

Standard apps