Analyzing source code through static analysis
In IBM® Rational® products,
the analysis framework provides static analysis capabilities to integrate
several analysis domains. Each domain can supply tools that provide different
forms of analysis, such as code review or architectural discovery, but the
interface for the tools remains consistent.
Using analysis configurations that specify domains, rules, and the
scope of an analysis, you can run static analyses of the resources that you
work with to detect violations of rules and rule categories, or to look for
patterns and antipatterns in source code. An analysis generates a list of
categorized results in an Analysis Results
analysis framework enables both independent tool vendors and anyone writing
new tools to integrate different forms of analysis without changing how to
perform analysis operations.
- Static analysis
In IBM Rational products, you can use the static analysis capabilities to analyze the components and resources of an application without having to run the application.
- Rules and rule categories for static analysis
Rules are the smallest building blocks of a static analysis configuration. Each analysis configuration applies different rules, or sets of rules, that define the conditions that generate results and that assess the quality, or determine the structure, of resources. A rule category is a collection of analysis rules, or other categories, that focuses on a particular aspect of standards compliance, or on an accepted practice.
- Static analysis results
In IBM Rational products, an architectural discovery analysis result identifies a pattern or an antipattern. A code review analysis result is a concise explanation of a rule violation. In either case, the result is a line item in the Analysis Results view that shows that the resource matches, or does not comply with the rules that you applied.
- Enabling capabilities for static analysis
The Java™ and Debug perspectives include analysis capabilities by default, but you can add analysis capabilities to any other perspective if you want to run a static analysis on resources other than Java source code files.
- Creating and editing static analysis configurations
In IBM Rational products, you can create an analysis configuration that specifies the domain, rule categories, and rules with which to analyze your resources.
- Creating custom rule categories and rules for static analysis
In IBM Rational products, you can create custom rule categories and custom rules to add to an analysis configuration in addition to those supplied by analysis providers. For example, a Java development team might use a specific set of providers, rule categories, and rules defined in a custom rules file to analyze source code.
- Creating rules files
You can create rules files that contain sets of rules to apply during a static analysis code review that you can run outside a standard analysis configuration at the command line, or in an Ant script.
- Creating reports from static analysis results
After you run an analysis configuration and generate results, you can capture the results in HTML-format reports.