8
Code Inspector checks The Code Inspector is a tool for checking static ABAP coding and DDIC objects (i.e. generally all objects of the Object Repository) under aspects of functional correctness, performance, security, reliability and statistical information. It helps developers to adhere to programming standards and guidelines by creating messages on less-than-optimal coding. The Code Inspector offers various possibilities to define object sets and to combine multiple single checks in so-called "check variants". These functions and the tool's parallel processing framework, make the Code Inspector a flexible and effective development assistant. SAP delivers standard global check variants 'DEFAULT' and 'TRANSPORT' to inspect objects in the development workbench and in transport requests, respectively. Another global check variant delivered with every SAP system is 'PERFORMANCE_CHECKLIST' which helps to detect less-than-optimal coding with regard to application performance. These check variants can be modified by the customer as needed. During IV, code inspector check needs to be carried out on custom packages (i.e. Classes, function modules, programs etc.). Developers can define which objects are to be checked and which quality aspect of the code is to be inspected (e.g. performance, security etc). When the Inspection run finishes, results of the Inspection are ordered hierarchically. The system only displays the checks that were applied in the Inspection. How to perform code inspector checks 1. Calling the code inspector The easiest way to call the Code Inspector for a single object is from ABAP workbench (SE80), ABAP editor (SE38),function builder (SE37), or the class builder (SE24) with Object -> Check -> Code Inspector where ‘Object’ stands for ‘Program’, ‘Function module’ or ‘Class’. The respective single objects (program, function module, or class) are then checked with a either the ‘Custom (if already maintained by customer)’ or ‘Default’ Check Variant of the Code Inspector. During an IV, the code inspector check would be performed on a number of objects, for example all objects of the custom package relevant to an application. To perform this, use transaction SCI.

Code Inspector Guidelines for IV

Embed Size (px)

DESCRIPTION

Code Inspector Guidelines for IV

Citation preview

Page 1: Code Inspector Guidelines for IV

Code Inspector checks

The Code Inspector is a tool for checking static ABAP coding and DDIC objects (i.e. generally all objects of the Object Repository) under aspects of functional correctness, performance, security, reliability and statistical information. It helps developers to adhere to programming standards and guidelines by creating messages on less-than-optimal coding. The Code Inspector offers various possibilities to define object sets and to combine multiple single checks in so-called "check variants". These functions and the tool's parallel processing framework, make the Code Inspector a flexible and effective development assistant.

SAP delivers standard global check variants 'DEFAULT' and 'TRANSPORT' to inspect objects in the development workbench and in transport requests, respectively. Another global check variant delivered with every SAP system is 'PERFORMANCE_CHECKLIST' which helps to detect less-than-optimal coding with regard to application performance. These check variants can be modified by the customer as needed.

During IV, code inspector check needs to be carried out on custom packages (i.e. Classes, function modules, programs etc.). Developers can define which objects are to be checked and which quality aspect of the code is to be inspected (e.g. performance, security etc).

When the Inspection run finishes, results of the Inspection are ordered hierarchically. The system only displays the checks that were applied in the Inspection.

How to perform code inspector checks

1. Calling the code inspector The easiest way to call the Code Inspector for a single object is from ABAP workbench (SE80), ABAP editor (SE38),function builder (SE37), or the class builder (SE24) with Object -> Check -> Code Inspector where ‘Object’ stands for ‘Program’, ‘Function module’ or ‘Class’. The respective single objects (program, function module, or class) are then checked with a either the ‘Custom (if already maintained by customer)’ or ‘Default’ Check Variant of the Code Inspector.

During an IV, the code inspector check would be performed on a number of objects, for example all objects of the custom package relevant to an application. To perform this, use transaction SCI.

Page 2: Code Inspector Guidelines for IV

2. Create an object set that contains the custom objectsIn transaction SCI, enter a suitable name for new Object Set and click Create.

Page 3: Code Inspector Guidelines for IV

Select the Custom Package and review the object selection (E.g.: Classes, function group, program etc.) relevant for the check as shown in the screenshot below.

Page 4: Code Inspector Guidelines for IV

3. Select the check variant which contains the checks that would be executed on the objects. If a custom check variant exists, review the variant for relevant checks, otherwise select the ‘Default’ or ‘Global’.

Page 5: Code Inspector Guidelines for IV

The ‘DEFAULT’ check variant should look as below:

Page 6: Code Inspector Guidelines for IV

4. Create an Inspection and execute it.Create an Inspection by selecting the Object Set and Check Variant defined in the above steps and execute it.

If DEFAULT check variant is used, remember that DEFAULT is delivered by SAP as Global and maintain it as in the check variant type as shown below.

Page 7: Code Inspector Guidelines for IV

When the Inspection run is finished, you get the results of the Inspection, which are ordered hierarchically. The system only displays the checks that were applied in the Inspection.

The messages will have source code position and explanatory text. An information text is available for many of the checks, providing an explanation of the problem and further links within the Code Inspector online documentation, which needs to be reviewed for further corrective action.

Other useful link:

http://scn.sap.com/docs/DOC-15932http://wiki.scn.sap.com/wiki/display/ABAP/Code+Inspector