Code Inspector Specification Document in Sap
Code Inspector Specification Document in Sap
Code Inspector
Features
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.
The Code Inspector can be used in various scenarios with different types of checks, thus providing insights into the code
quality from various angles.
Usage scenarios
1.
2.
3.
Syntax
Syntax check; extended program check
Performance
Analysis of WHERE clauses for SELECT, UPDATE and DELETE; SELECT statements that bypass the table buffer; Low
performance operations on internal tables ; table attributes check
Security
Usage of critical statements; dynamic and cross-client database accesses; use of ADBC-interface
Robustness
Check of SY-SUBRC handling; suspect conversions; activation check for DDIC objects
Programming Conventions
Naming conventions
Search Functions
Search of ABAP tokens; search ABAP statement patterns; search for ABAP statements with regular expressions
Select the relevant program in the object list and choose Check -> Extended Program Check from
1.
Test enviroment - verify if the program is active. The Extended Check verify only active programs.
2.
Call Function interfaces - verify if the parameters' type is correct, the using of exceptions.
3.
4.
5.
Problematic Semantics - It shows to you better codes, like "WRITE TO can be replaced by more efficient MOVE
TO"
6.
Syntax check warnings - Pay attention to use conversion functions to compare fields. Or it will be listed in syntax
check warnings' topic... and select statements are verified too.
7.
In this example, the form f_validade was declared but not called in the program. Sometimes, in interface programs (BAPIs
for example) you need to create forms that the BAPI will call it. This error message will appear, but you will not need to
correct it, of course.
Double click in the message and you will be redirected to the code. Then, do the needed changes, active your program and
do the Extended Check again!
Usage scenarios
1.
2.
3.
In addition checks can be invoked automatically on release of a transport. This way, you can disable transports not matching
your quality criteria from being sent to further systems.
4.