[ANN] MetricsReloaded 0.6 released

Sixth and Red River Software is pleased to announce the release of MetricsReloaded 0.6. MetricsReloaded is a IntelliJ IDEA plugin which calculates and displays an enormous number of source code metrics for any IDEA project. MetricsReloaded is designed for use in project tracking, quality assurance, and developer training. Over 250 metrics are currently available at the project, module, package, class, and method levels. Metrics can be sorted, graphed, compared with previous metrics runs, and exported to file. Additionally, MetricReloaded offers detection, display, and visualization of class and package dependency cycles, and calculates a variety of graph-theoretic metrics for each cycle. MetricsReloaded is available via the Plugin Manager.

MetricsReloaded 0.6 is only supported against the EAP 5.0 and 5.1 (Irida) versions of IDEA. Additionally, MetricsReloaded requires that IDEA be run under a JDK 1.5 JVM, which means it will not work under a default IDEA installation on MacOS X.

Calculating project metrics with MetricsReloaded:
In use, MetricsReloaded acts much like the "Inspect Code..." panel built into IDEA, except that instead of finding code weaknesses, it calculates numeric values about your project. MetricsReloaded can be run from the main menu (under Analyze/Calculate Metrics...) or by right-clicking in the Project or Package views, or in the editor. If selected from the main menu, metrics will be calculated for all files in the project. If selected from the Project or Package views, metrics are calculated for the selected file, package, directory, or module. If selected in the editor, metrics will only be calculated for the active file. Next, a panel will appear, asking whether you wish to calculate metrics for all java files, only product files, or only test files. After you've selected here, you are then shown the main metrics configuration panel. Like choosing inspections in the inspection panel, the metrics configuration panel lets you choose which metrics you wish to run. Also like the inspection panel, the user may create multiple named inspection profiles, allowing him to have standard sets of metrics to run for different uses. Finally, the metrics configuration panel allows the user to configure thresholds for each metric. Metrics values which are outside of the selected threshold values will be highlighted in the metrics display. When calculation is complete, the metrics display panel will be become visible. The metrics display panel consists of a tabbed set of tables, filled with metrics values. Metrics values can be sorted on any column, saved as a snapshot file, compared with values from a previous snapshot file, or exported to a comma-separated value (.csv) file or xml file. By right-clicking on a column, that metric's values may be displayed in a histogram, distribution graph, or pie chart (if appropriate). It should all be pretty obvious.

Metrics Currently Supported:

259 metrics
Project Metrics
Attribute hiding factor
Attribute inheritance factor
Average cyclomatic complexity
Comment lines of code
Comment ratio
Coupling factor
Javadoc class coverage
Javadoc field coverage
Javadoc lines of code
Javadoc method coverage
Lines of HTML
Lines of JSP
Lines of XML
Lines of code
Lines of product code
Lines of test code
Method hiding factor
Method inheritance factor
Number of HTML files
Number of JSP files
Number of JUnit test assertions
Number of JUnit test cases
Number of JUnit test methods
Number of TODO comments
Number of XML files
Number of abstract classes
Number of classes
Number of concrete classes
Number of interfaces
Number of methods
Number of packages
Number of product classes
Number of test classes
Number of top-level classes
Number of top-level interfaces
Polymorphism factor
Source lines of code
Test ratio
Total cyclomatic complexity
True comment ratio
Module Metrics
Average cyclomatic complexity
Comment lines of code
Comment ratio
Encapsulation ratio
Javadoc class coverage
Javadoc field coverage
Javadoc lines of code
Javadoc method coverage
Lines of HTML
Lines of JSP
Lines of XML
Lines of code
Lines of product code
Lines of test code
Number of HTML files
Number of JSP files
Number of JUnit test assertions
Number of JUnit test cases
Number of JUnit test methods
Number of TODO comments
Number of XML files
Number of abstract classes
Number of classes
Number of concrete classes
Number of interfaces
Number of methods
Number of product classes
Number of test classes
Number of top-level classes
Number of top-level interfaces
Source lines of code
Test ratio
Total cyclomatic complexity
True comment ratio
Package Metrics
Abstractness
Adjusted Level Order
Afferent coupling
Average cyclomatic complexity
Comment lines of code
Comment lines of code (recursive)
Comment ratio
Comment ratio (recursive)
Distance to main sequence
Efferent coupling
Encapsulation ratio
Instability
Javadoc class coverage
Javadoc class coverage (recursive)
Javadoc field coverage
Javadoc field coverage (recursive)
Javadoc lines of code
Javadoc lines of code (recursive)
Javadoc method coverage
Javadoc method coverage (recursive)
Level Order
Lines of code
Lines of code (recursive)
Lines of product code
Lines of product code (recursive)
Lines of test code
Lines of test code (recursive)
Number of JUnit test assertions
Number of JUnit test assertions (recursive)
Number of JUnit test cases
Number of JUnit test cases (recursive)
Number of JUnit test methods
Number of JUnit test methods (recursive)
Number of TODO comments
Number of TODO comments (recursive)
Number of abstract classes
Number of abstract classes (recursive)
Number of classes
Number of classes (recursive)
Number of concrete classes
Number of concrete classes (recursive)
Number of cyclic package dependencies
Number of dependent packages
Number of interfaces
Number of interfaces (recursive)
Number of methods
Number of methods (recursive)
Number of package dependencies
Number of product classes
Number of product classes (recursive)
Number of test classes
Number of test classes (recursive)
Number of top-level classes
Number of top-level classes (recursive)
Number of top-level interfaces
Number of top-level interfaces (recursive)
Number of transitive package dependencies
Number of transitively dependent packages
Source lines of code
Source lines of code (recursive)
Test ratio
Total cyclomatic complexity
True comment ratio
True comment ratio (recursive)
Interface Metrics
Adjusted level order
Comment lines of code
Comment ratio
Coupling between objects
Interface size (attributes)
Interface size (operations + attributes)
Interface size (operations)
Javadoc field coverage
Javadoc lines of code
Javadoc method coverage
Level order
Lines of code
Number of TODO comments
Number of commands
Number of cyclic dependencies
Number of dependencies
Number of dependent packages
Number of dependents
Number of implementations
Number of package dependencies
Number of queries
Number of subinterfaces
Number of transitive dependencies
Number of transitive dependents
Source lines of code
True comment ratio
Class Metrics
Adjusted level order
Average number of parameters
Average operation complexity
Average operation size
Class size (attributes)
Class size (operations + attributes)
Class size (operations)
Comment lines of code
Comment ratio
Coupling between objects
Depth of inheritance tree
Halstead bugs
Halstead difficulty
Halstead effort
Halstead length
Halstead vocabulary
Halstead volume
Javadoc field coverage
Javadoc lines of code
Javadoc method coverage
Level order
Lines of code
Maximum operation complexity
Maximum operation size
Number of JUnit test assertions
Number of JUnit test methods
Number of TODO comments
Number of attributes added
Number of attributes inherited
Number of commands
Number of constructors
Number of cyclic dependencies
Number of dependencies
Number of dependent packages
Number of dependents
Number of inner classes
Number of interfaces implemented
Number of operations added
Number of operations inherited
Number of operations overridden
Number of package dependencies
Number of queries
Number of statements
Number of subclasses
Number of transitive dependencies
Number of transitive dependents
Number of type parameters
Number of type parameters
Number of type parameters
Source lines of code
True comment ratio
Weighted method complexity
Method Metrics
Comment lines of code
Comment ratio
Conditional nesting depth
Control density
Cyclomatic complexity
Design complexity
Essential cyclomatic complexity
Extended cyclomatic complexity
Halstead bugs
Halstead difficulty
Halstead effort
Halstead length
Halstead vocabulary
Halstead volume
Javadoc lines of code
Lines of code
Loop nesting depth
Nesting depth
Number of TODO comments
Number of assert statements
Number of branch statements
Number of control statements
Number of exceptions caught
Number of exceptions thrown
Number of executable statements
Number of expressions
Number of implementations
Number of loop statements
Number of method calls
Number of overriding methods
Number of parameters
Number of return points
Number of statements
Number of times called
Number of times called in product code
Number of times called in test code
Number of type cast expressions
Quality Criteria Profile (Correctness)
Quality Criteria Profile (Maintainability)
Quality Criteria Profile (Reliability)
Relative lines of code
Source lines of code
True comment ratio

Running MetricsReloaded from the command line
Metrics may be calculated as a command-line process and saved to an XML file. The command-line
syntax is as follows:

idea metrics ]]>


Finding class and package dependency cycles using MetricsReloaded:
MetricsReloaded can create reports of class or package dependency cycles in a project. Simply select "Show Package Cycles..." or "Show Class Cycles..." under the "Analyze" menu. A small popup will ask whether test code should be included in the analysis, and whether (for class dependency cycles) inner classes should be considered separately or together with their outer classes. After analyzing the project, a report window will be generated, describing the mutually dependent sets of classes or packages found, and showing certain graph-theoretic metrics for each of the cycle's complexity. Class and package cycles are known "code smells", indicating a probably weakness in the project's design and higher costs to understand or modify the code. While the topological metrics calculated for each dependency cycle have a variety of interesting mathematical properties, basically all you need to know is that any of them are over three or so the cycle is going to be a major pain in the ass to refactor. For further insight into a dependency cycle's structure, click on the cycle's row and select "Show dependency graph". A small visualization of the dependencies and their strengths will be displayed.


Changes since 0.5:
More than 25 new metrics, including the MOOD project metrics, metrics on JUnit tests and TODO comments,
and more comprehensive package dependency metrics
Command-line metrics runs
Prebuilt metrics profiles, to ease the metrics learning curve
Links to metrics websites for further exploration
Ability to toggle off the calculation of graph-theoretic metrics
Significant performance improvements
Many bug fixes.

Roadmap:
Integration with Demetra build server
Project dashboard display
Online help
Greatly enhanced cycle-graph functionality
History and trend analysis
Usability enhancements

Terms of use:
MetricsReloaded is open-source software (with the source code included in the distribution) released under the Apache-2.0 license, included in the distribution. The graphing functionality of MetricsReloaded is provided by the open source JFreeChart library (www.jfree.org). JFreeChart is available under the GNU Lessser General Public License, a copy of which is included with the MetricsReloaded distribution. Any redistribution of MetricsReloaded or JFreeChart is expected to follow the letter and spirit of that license. The graph visualization functionality of MetricsReloaded is provided by the Jung graph visualization library. Jung is available under the BSD License. Any redistribution of MetricsReloaded or Jung is expected to follow the letter and spirit of that license. More information about Jung is available at jung.sourceforge.net. Jung depends on the Apache common-collections library for it's internal data models. commons-collections is released under the Apache License. Any redistribution of MetricsReloaded or common-collections is expected to follow the letter and spirit of that license. More information about the commons-collection library is available at http://jakarta.apache.org/commons/collections. All other rights, including copyrights to the source and the MetricsReloaded trademark are reserved by Sixth and Red River Software, http://www.sixthandredriver.com .

7 comments

Great news. Especially the performance improvements.
Project-wide metrics were not really feasible for real
world projects before.

It seems that even though there is SLOC, there are no
separate SLOCp and SLOCt?!
Where is the best place to suggest such a feature?

Thanks
Stephen

0

Consider it submitted. For requests going forward, we'll have forums and tracker set up as soon as JetBrains opens up their new plugins setup. (Tomorrow???)

Sixth and Red River Software
"Code with Grace and Verve"

0

I hope day after tomorrow. And only as beta version :)

Sixth and Red River Software wrote:

Consider it submitted. For requests going forward, we'll have forums and tracker set up as soon as JetBrains opens up their new plugins setup. (Tomorrow???)

Sixth and Red River Software
"Code with Grace and Verve"

0

Yann Cebron wrote:

where is it now ;)

Oops... My hope was wrong :)
Next week probably then.

0

Great!

Would it be possible to add a feature (<extension-point> ?!) for other plugins to provide other metrics? e.g. Struts Plugin could provide "Number of Actions" etc

0

Great idea!

Sixth and Red River Software
"Code with Grace and Verve"

0

Please sign in to leave a comment.