Frank Sauer created the fancy Eclipse plugin simply called Metrics.
With this plugin you can solve two QA tasks at once…
- (OO) Code Metrics such as McCabe cyclomatic complexity and the dependency metrics by Robert Martin.
- Others include most common LOC (line-of-code), NOI (number of interfaces), PAR (number of parameters) and other common software-engineering metrics.

- Metrics can now trigger warnings that show up in the task view as well as the editors, indicating methods and types for which metrics safe ranges are being violated
- Metrics can be exported to an XML file to be processed with XSL into any kind of report you want.
- Metrics can even be generated in a nightly build in ANT
- the author recommends these books as basis and was inspired himself by them
with metrics like LOC and McCabe Cyclomatic Complexity
- that counts the number of flows through a piece of code. Each time a branch occurs (if, for, while, do, case, catch and the ?: ternary operator, as well as the && and || conditional logic operators in expressions) this metric is incremented by one. See also
- and
with metrics like Efferent Coupling (Ce) – The number of classes inside a package that depend on classes outside the package.
- a graphical dependency analysis tool based on the dynamic hyperbolic package TouchGraph

- graph can be zoomed and rotated
- a Tangle popup can be used to see why all nodes are connected to each other and how and a “Find Shortest Path” feature
Download it at the sourceforge Metrics repository
Comments
Code Metrics and Dependencies for Eclipse
Measuring quality is a good idea. And most importantly: define a reasonable scale. It's one thing to know you're driving your car with 50 km/h - but it does make a difference whether you're in a 30 km/h zone or on the Autobahn.
Lesson learned: metrics are useful within a defined context or ->standard. And once you collect metrics, you'll want to make sure they stay within a certain range (search Google on "Statistical Quality Assurance" or email me :) ) and whether your organization makes improvements over time, etc, etc.
For Java projects, you get all this and much more - automatically. Quality at the source: www.qido.at