Go to main content
Oracle® Developer Studio 12.6: Code Analyzer User's Guide

Exit Print View

Updated: June 2017
 
 

Data Analyzed by Code Analyzer

Code Analyzer analyzes three types of data:

  • Static code errors detected during compilation

  • Dynamic memory access errors and warnings detected by the discover utility, the memory error discovery tool

  • Code coverage data measured by the uncover utility, the code coverage tool

In addition to providing you access to each individual type of analysis, Code Analyzer integrates static code checking with dynamic memory access analysis and code coverage analysis, to enable you to find many important errors in your applications that cannot be found by other error detection tools working separately.

Code Analyzer also pinpoints the core issues in your code, that, when fixed, are likely to eliminate the other issues. A core issue usually combines several other issues because, for example, the issues have a common allocation point, or occur at the same data address in the same function.

Static Code Checking

Static code checking detects common programming errors in your code during compilation. The –xprevise=yes option for the C and C++ compilers leverages the compilers' control and data flow analysis frameworks to analyze your application for potential programming and security flaws.


Note -  You can also use the –xanalyze=code option to collect static code errors, but this option is EOL. Using the –xprevise=yes option is recommended.

For information on collecting static error data, see Collecting Static Error Data.

For a list of the static code errors Code Analyzer analyzes, see Static Code Issues.

Dynamic Memory Access Checking

Memory-related errors in your code are often difficult to find. When you instrument your program with discover before running it, discover catches and reports memory access errors dynamically during program execution. For example, if your program allocates an array and does not initialize it and then tries to read from a location in the array, the program is likely to behave erratically. If you instrument the program with discover and then run it, discover will catch the error.

For information about collecting dynamic memory access error data, see Collecting Dynamic Memory Access Data.

For a list of the dynamic memory access issues that Code Analyzer analyzes, see Dynamic Memory Access Errors.

Code Coverage Checking

Code coverage provides information on which areas of your code are exercised in testing and which are not, enabling you to improve your test suites to test more of your code. Code Analyzer uses data collected by uncover to determine which functions in your program are uncovered and the percentage of coverage that will be added to the total coverage for the application if a test covering the relevant function is added.

For information about collecting code coverage data, see Collecting Code Coverage Data.