Calculates various metrics for projects, packages and compilation units. Includes both simple counts like lines of code as well as more complex metrics such as the McCabe cyclomatic complexity.
Cobertura is a free Java tool that calculates the percentage of code accessed by tests. It can be used to identify which parts of your Java program are lacking test coverage. It is based on jcoverage.