Tuesday, 10 October 2017

Code Inspector Checks

The purpose of this blog is to describe SAP NetWeaver AS, Code Inspector checks. Code Inspector is a tool used to perform static analysis of ABAP programs and other SAP repository objects. It is a framework where all the categories and checks are based on ABAP classes. SAP continuously delivers new built-in checks for new tools and new objects.

In this blog I will focus on 4 categories of checks.
  • Programming Convention Checks
  • S/4 HANA Readiness Checks
  • User Interface Checks
  • Performance Checks

Programming Convention Checks


This category contains:

ABAP naming convention checks which examine whether the naming conventions specified by the test parameters are met for the various objects (such as types, classes, or fields) defined in an ABAP program.

Extended check on naming conventions in ABAP programs examines whether the naming conventions specified by the test parameters are met for the various objects (such as types, classes, or fields) defined in an ABAP program.

Pretty Print State check in ABAP Programs establishes whether the ABAP code is formatted with respect to the configured Pretty Print variants.

ABAP unit test conventions check helps you to detect flaws in the code of Unit Tests. Unit Tests are special code fragments that execute the domain code in order to detect functional errors within the domain code. The test fragments – typically local classes – underlie some constraints. For example, they must not require interactive user input in order to ensure the capability of fully automated test execution.

Extended Check for ABAP Doc Comments are checked for completeness. In other words, the system checks if there is a comment for all the entities activated via the parameters.

S/4 HANA Readiness Checks


S/4 HANA Readiness Checks category contains checks for the conversion to SAP S/4HANA.

Field length extensions check searches – in the context of an SAP S/4HANA conversion – for statements where problems occur due to field length extension. This check is also able to check objects in a remote system.

Search for database operations is a check which searches – in the context of an SAP S/4HANA conversion – for database statements which are not permitted in the ABAP source code.

Search for usages of simplified objects is a check which searches – in the context of an SAP S/4HANA conversion – for usages of simplified objects (i.e. objects mentioned in the Simplification Database) within ABAP repository objects.

Search for ABAP Dictionary enhancements check searches – in the context of an SAP S/4HANA conversion – for customers’ ABAP Dictionary enhancements:
  • append structures
  • append views
  • customizing includes enhancing structures, database tables and database views mentioned in Simplification Database.
  • Suppressing messages on solved issues
Not all the above dependencies are being reported, however: if Simplification Database information states that the enhanced table or view has a proxy object and the proxy object should be accessed instead of the enhanced table or view, then the proxy object is validated.

The check message is suppressed if the proxy object can be used at runtime.

This check is also able to check objects in a remote system

Search for base tables of ABAP Dictionary views check searches – in the context of an SAP S/4HANA conversion – for simplified (i.e. mentioned in Simplification Database) database tables which are used as base tables in customers’ ABAP Dictionary views.The check analyzes classic ABAP Dictionary view types:
  • database view
  • projection view
  • maintenance view
  • help view
If a base table is found in the Simplification Database, further criteria apply to decide whether the finding is being reported, that includes:
  • view type
  • view maintenance status – access type read only or modify
  • simplification category of the base table
This check is also able to check objects in a remote system.

Search for S/4-related syntax errors check executes the Syntax-Check operation for a certain set of objects. An attempt is made to match the findings to SAP notes describing simplification items. We use a heuristic method to search for relevant SAP notes that might be related to the syntax error. That is why not all relevant notes or too many notes may be found.

User Interface Checks


This category contains:

Web Dynpro Component – Active Components check uses technology, such as Java, Adobe Flash, Microsoft Silverlight or others, to provide enriched functionality to the user.

Due to security constraints and the ongoing improvement of HTML, CSS and JavaScript, some of these technologies are no longer necessary or can be replaced by native functions. Additionally, browser vendors have started to block such plugin technologies.

This check identifies UI elements which are active components to provide an opportunity to analyze the usage of these elements. The rules of the check are:
  • Usage of Adobe Flash based component which requires a Adobe Flash plugin to be available in the Web browser of the user.
  • Usage of Adobe Forms based component which requires the Adobe Reader plugin to be available in the Web browser of the user.
  • Usage of Java applet based component which requires the installation of the JAVA runtime on the user machine. Additionally, a plugin is required in the Web browser of the user
  • Usage of Microsoft ActiveX based component which requires the usage of Microsoft Internet Explorer as Web browser.
  • Usage of Microsoft Office integration component which requires the installation of Microsoft Office and a Microsoft-based Web browser, e.g. Internet Explorer.
  • Usage of Microsoft Silverlight based component which requires the Microsoft Silverlight plugin to be available in the Web browser of the user.
Web Dynpro Component – Standard Check delegates the analysis of Web Dynpro Components to the technical check also used by the IDE. The IDs of findings are mapped generically by the priority used in the IDE. If you compare the information about the findings in the IDE and in the Code Inspector adapter, the IDE contains more information.

Web Dynpro Conventions for Source Text allows you to enhance the declaration of the user interface using code in certain places.

This Code Inspector test enables you to identify these problematic statements and avoid problems before they arise. These checks cover the following areas:
  • Database access
  • File access
  • Lists & Dynpro technology
  • Changes to the program flow
  • Low-level commands
  • Including source code
  • Direct method call
  • Querying the parameter interface
Dynpro Checks are checks on dynpros and resource consumption.

This check contains all usability and accessibility checks for dynpros and the scope of the check is identical to that in the menu function Check -Layout in Screen Painter (used for dynpro editing in the integrated SAP GUI).

‘SAP Script’ Scanner analyzes SAP Script content (SE61-documentation).

The following issues can be identified by the scanner:
  • Inconsistencies between transport key repository (TADIR) and document repository
  • Inactive document content
  • Inconsistent document content, like malformed tags
  • Invalid meta data, like missing master language

No comments:

Post a Comment