What’s new in OptimalAdvisor 4.1
- Comprehensive quality metrics reporting
- Support of PMD 3.5, a popular open source rule engine
Introduction
OptimalAdvisor is a static code analysis and refactoring tool.
OptimalAdvisor can be used to:
- understand code
- indicate problems and solutions
- assess and monitor code quality
- measure code properties
- automate technical documentation
- refactor code based on the analysis
Understand code
OptimalAdvisor visualizes high-level designs based on layered UML class and package diagrams. Read more about package design and layering.
Indicate problems and solutions
- OptimalAdvisor finds problems in dependency structures and suggests fixes for them.
- OptimalAdvisor also validates code against a set of best practice coding rules. Close to 200 coding rules are supported. The rules are based on authoritative Java publications such as Joshua Bloch's Effective Java book.
Assess and monitor code quality
OptimalAdvisor has a command line interface and ANT integration. This allows analysis to be integrated in a centralized build. Various reports can be generated from the command line.
OptimalAdvisor also enables you to validate code against a reference package design.
Refactor code based on the analysis
OptimalAdvisor allows changes to be made at the model level, allowing for 'what if' analysis. If you are satisfied with the result, just apply the changes and the code will be automatically refactored.
OptimalAdvisor supports class/package rename/move, remove unused import, and the dependency inversion refactoring.
Measure code properties
OptimalAdvisor provides a set of metrics to measure code size and quality. OptimalAdvisor introduces the ADP metric, a new way to measure the modularity of a program. Read more about metrics.
Automates technical documentation
OptimalAdvisor can also enhance Javadoc with package diagrams, for example to document JUnit.

Gallery
The following diagrams have been created with OptimalAdvisor.
|
 junit - click to enlarge
|
The open source testing framework JUnit analyzed.
Unlike most packages, JUnit does not have any cycles in the dependency structure and therefore scores 100% for the Acyclic Dependency Principle.
ADP: 100% |
|
 java - click to enlarge
|
The Java class library analyzed.
Did you know java.lang depends on java.util, java.io, java.nio, java.security?
ADP: 97% |
|
argouml - click to enlarge
|
The open source UML tool ArgoUML analyzed.
ArgoUML has a lot of cycles in its package structure.
ADP: 79% |
In a tutorial, we show you how to improve the package structure of the testing tool jmeter by removing all the cycles in the graph. |