MetricsReloaded progress report

Because several people have asked, here's a progress report on my next plugin, MetricsReloaded. It's a plugin for calculating various code metrics for an IDEA project, and displaying them in a variety of helpful ways. Based on my current schedule, I'd bet on it beta-ing somewhere in early-to-mid April. Any suggestions or comments would be greatly appreciated


Specify that metrics are to be calculated for entire project, a given module,
a given directory, or a single file. --50% done
Optionally skip metrics calculation for test code --50% done (UI needed)
Configuration panel for selecting metrics to run, thresholds, seeing descriptions
--50% done. Serious cosmetic issues with tree display and window sizing. Assistance or examples requested.
Show a progress window during the calculation of metrics, with
a cancel button: 0% complete. SHOWSTOPPER. Assistance or examples requested.
Provide upper and lower thresholds of acceptable metrics values --Done
Tabbed tabular display of metric results, with sorting and coloring for metrics outside threshold --Done
Ability to rerun metrics --Done
Ability to save a snapshot of a metrics calculation --Done
Ability to provide a difference view between current metrics and previously calculated snapshot -- Done
Ability to view a histogram of a given metric --90% done (endpoint selection, cosmetics)
Ability to view a distribution graph of a given metric --90% done (endpoint selection, cosmetics)
Ability to view a pie chart of a given (appropriate) metric --80% done (tooltips, cosmetics)
Ability to view a comparison histogram of a given current metric and previous snapshot--90% done (endpoint selection, cosmetics)
Ability to view a comparison distribution graph of a given current metric and previous snapshot --90% done (endpoint selection, cosmetics)
Ability to move from comparison view to non-comparison view --80% done
Export to CSV- 90% done: cosmetics
Export to XML- 75% done: cosmetics, refactoring, documentation needed

Provided metrics (code complete, documentation needed)

Project-level Metrics
Number of packages
Number of classes
Number of abstract classes
Number of concrete classes
Number of interfaces
Number of product classes
Number of test classes
Number of top-level classes
Number of top-level interfaces
Lines of code
Lines of product code
Lines of test code
Lines of comments
Comment ratio (lines of comments/lines of code)
Test code ratio (lines of test code/lines of code)

Module-level Metrics (just the same as project, but broken out by module)
Number of packages
Number of classes
Number of abstract classes
Number of concrete classes
Number of interfaces
Number of product classes
Number of test classes
Number of top-level classes
Number of top-level interfaces
Lines of code
Lines of product code
Lines of test code
Lines of comments
Comment ratio (lines of comments/lines of code)
Test code ratio (lines of test code/lines of code)

Package-level Metrics
Number of classes
Number of abstract classes
Number of concrete classes
Number of interfaces
Number of product classes
Number of test classes
Number of top-level classes
Number of top-level interfaces
Lines of code
Lines of product code
Lines of test code
Lines of comments
Comment ratio (lines of comments/lines of code)
Test code ratio (lines of test code/lines of code)
Afferent coupling
Efferent coupling
Stability
Abstractness
Distance to main sequence

Class metrics
Number of attributes (fields)
Number of attributes added
Number of attributes inherited
Number of operations (methods)
Number of operations added
Number of operations inherited
Number of operations overridden
Number of attributes + operations
Total number of statements
Total operation complexity
Average operation complexity
Average operation size
Average operation number of parameters
Depth of inheritence
Number of dependencies
Number of visible dependencies
Number of dependents
Lines of code
Lines of comments
Comment ratio
Number of subclasses
Number of inner classes
Number of constructors

Interface-level metrics
Number of attributes
Number of operations
Number of attributes + operations
Number of implementations
Number of subinterfaces
Lines of code
Lines of comments
Comment ratio

Method level metrics
Lines of code
Lines of comments
Comment ratio
Relative lines of code (lines of code/class lines of code)
Cyclomatic complexity
Number of parameters
Number of statements
Number of control statements
Number of executable (non-control) statements
Control density (number of control statements/number of statements)
Number of return points
Number of loops
Number of method calls
Number of non-local branches
Number of dependency classes
Maximum nesting depth
Number of implementations (for abstract methods)
Number of overrides (for concrete methods)
Number of times method is called in product code
Number of times method is called in test code

--Dave Griffith

16 comments

Isn't something like this going to be in 4.1? You might want to try to work
with JetBrains so you don't duplicate efforts.

--
Norris Shelton
Sun Certified Java Programmer


"Dave Griffith" <dave.griffith@cnn.com> wrote in message
news:15063347.1080052868025.JavaMail.itn@is.intellij.net...

Because several people have asked, here's a progress report on my next

plugin, MetricsReloaded. It's a plugin for calculating various code metrics
for an IDEA project, and displaying them in a variety of helpful ways.
Based on my current schedule, I'd bet on it beta-ing somewhere in
early-to-mid April. Any suggestions or comments would be greatly
appreciated
>
>

Specify that metrics are to be calculated for entire project, a given

module,

a given directory, or a single file. --50% done
Optionally skip metrics calculation for test code --50% done (UI needed)
Configuration panel for selecting metrics to run, thresholds, seeing

descriptions

--50% done. Serious cosmetic issues with tree display and window

sizing. Assistance or examples requested.

Show a progress window during the calculation of metrics, with
a cancel button: 0% complete. SHOWSTOPPER. Assistance or examples

requested.

Provide upper and lower thresholds of acceptable metrics values --Done
Tabbed tabular display of metric results, with sorting and coloring for

metrics outside threshold --Done

Ability to rerun metrics --Done
Ability to save a snapshot of a metrics calculation --Done
Ability to provide a difference view between current metrics and

previously calculated snapshot -- Done

Ability to view a histogram of a given metric --90% done (endpoint

selection, cosmetics)

Ability to view a distribution graph of a given metric --90% done

(endpoint selection, cosmetics)

Ability to view a pie chart of a given (appropriate) metric --80% done

(tooltips, cosmetics)

Ability to view a comparison histogram of a given current metric and

previous snapshot--90% done (endpoint selection, cosmetics)

Ability to view a comparison distribution graph of a given current metric

and previous snapshot --90% done (endpoint selection, cosmetics)

Ability to move from comparison view to non-comparison view --80% done
Export to CSV- 90% done: cosmetics
Export to XML- 75% done: cosmetics, refactoring, documentation needed

>

Provided metrics (code complete, documentation needed)

>

Project-level Metrics
Number of packages
Number of classes
Number of abstract classes
Number of concrete classes
Number of interfaces
Number of product classes
Number of test classes
Number of top-level classes
Number of top-level interfaces
Lines of code
Lines of product code
Lines of test code
Lines of comments
Comment ratio (lines of comments/lines of code)
Test code ratio (lines of test code/lines of code)

>

Module-level Metrics (just the same as project, but broken out by

module)

Number of packages
Number of classes
Number of abstract classes
Number of concrete classes
Number of interfaces
Number of product classes
Number of test classes
Number of top-level classes
Number of top-level interfaces
Lines of code
Lines of product code
Lines of test code
Lines of comments
Comment ratio (lines of comments/lines of code)
Test code ratio (lines of test code/lines of code)

>

Package-level Metrics
Number of classes
Number of abstract classes
Number of concrete classes
Number of interfaces
Number of product classes
Number of test classes
Number of top-level classes
Number of top-level interfaces
Lines of code
Lines of product code
Lines of test code
Lines of comments
Comment ratio (lines of comments/lines of code)
Test code ratio (lines of test code/lines of code)
Afferent coupling
Efferent coupling
Stability
Abstractness
Distance to main sequence

>

Class metrics
Number of attributes (fields)
Number of attributes added
Number of attributes inherited
Number of operations (methods)
Number of operations added
Number of operations inherited
Number of operations overridden
Number of attributes + operations
Total number of statements
Total operation complexity
Average operation complexity
Average operation size
Average operation number of parameters
Depth of inheritence
Number of dependencies
Number of visible dependencies
Number of dependents
Lines of code
Lines of comments
Comment ratio
Number of subclasses
Number of inner classes
Number of constructors

>

Interface-level metrics
Number of attributes
Number of operations
Number of attributes + operations
Number of implementations
Number of subinterfaces
Lines of code
Lines of comments
Comment ratio

>

Method level metrics
Lines of code
Lines of comments
Comment ratio
Relative lines of code (lines of code/class lines of code)
Cyclomatic complexity
Number of parameters
Number of statements
Number of control statements
Number of executable (non-control) statements
Control density (number of control statements/number of statements)
Number of return points
Number of loops
Number of method calls
Number of non-local branches
Number of dependency classes
Maximum nesting depth
Number of implementations (for abstract methods)
Number of overrides (for concrete methods)
Number of times method is called in product code
Number of times method is called in test code

>

--Dave Griffith



0

Sounds good. Can't wait to see the first beta.

Thanks for the development efforts.

Regards

Thomas Gülden
Munich, Germany

0


I've been following the 4.1 rumors/progress reports pretty closely, and haven't seen anything like this. The closest things I've noticed are "package dependencies" and "duplicate code checker", neither of which really covers more than a fraction of this. If someone at JetBrains knows differently, I'd love to hear it.

--Dave Griffith

0

Hi!

DG> Because several people have asked, here's a progress report on my
DG> next plugin, MetricsReloaded. It's a plugin for calculating

Sounds great. Only one question. When?

___
/** WBR @author Denis Tsyplakov */


0

Beta in early-to-mid April, schedule permitting.

0

"Dave Griffith" <dave.griffith@cnn.com> wrote in message
news:15063347.1080052868025.JavaMail.itn@is.intellij.net...

Because several people have asked, here's a progress report on my next

plugin, MetricsReloaded.


Is JetBrains paying you for this? :)

Vince.


0

Everybody needs a hobby. Mine is working on the best piece of software I've ever seen.

--Dave Griffith

0

Awesome! That's the kind of stuff that makes IDEA compete against Eclipse from a plugins perspective!

0

Are you referring to your plugins or IDEA? :)

"Dave Griffith" <dave.griffith@cnn.com> wrote in message
news:32075211.1080060770095.JavaMail.itn@is.intellij.net...

Everybody needs a hobby. Mine is working on the best piece of software

I've ever seen.
>

--Dave Griffith



0

In article <15063347.1080052868025.JavaMail.itn@is.intellij.net>,
Dave Griffith <dave.griffith@cnn.com> wrote:

Because several people have asked, here's a progress report on my next
plugin, MetricsReloaded. It's a plugin for calculating various code metrics
for an IDEA project, and displaying them in a variety of helpful ways. Based
on my current schedule, I'd bet on it beta-ing somewhere in early-to-mid
April. Any suggestions or comments would be greatly appreciated


Very impressive! I am quite staggered by the utility this is going to
have. Metrics are like unit tests - very useful in the right context,
and a great way to waste time if implemented or judged poorly. We try
to use them right, and this plugin sure looks like it will help.

Off the top of my head, a few long term suggestions arise to put on the
queue. I would rather have you finish 1.0 before implementing any of
these, but they might be useful for the future.

Snapshots:
Compare metrics to those for a given CVS or local history state.
Justification: it is useful to have hard numbers for the effect of a
refactoring frenzy. An offline task would be fine for this.

Javadoc metrics:
Presence of javadoc comments per class
Presence of javadoc comments per method
Presence of package-usage.html
Parameters/returns/exceptions documented
Justification: crummy javadoc comments are pretty rampant. An error or
warning might be overkill, but having it show up in a metrics report
might get sufficient attention.

Outside-of-idea metrics:
A way to generate the xml report via an ant task running outside of
idea. Preferably w/o idea installed, but I can understand it if this
requires their API to work.
Justification: we build our code nightly. If we can generate a metric
report that will match that of the developers, they are more likely to
take it seriously. Put another way - you can argue until you are blue
in the face about something, but developers often act only if they can
see it in their IDE while coding. Thus, if I am going to hit people
with the Wet Trout of Behavioral Modification, it is handy to have a
report that will match theirs.

Scott

0

Why do you call them attributes and operations? I'm more familiar with calling them fields and methods.

0


Software metrics has a long (and occasionally dubious) history, including it's own terms and abbreviations. They tend to be specifically chosen to be language-neutral. I have to choose between using the "standard" notation from the literature, and using the usual Java terms. So far, I'm sticking with the metrics-standard terminology, although I admit I'm tempted to dump it.

--Dave Griffith

0

Your audience is probably Java developers, not metrics fans. I might be wrong though, maybe the people who tend to look at metrics (management or something like that) are used to it.

Everyone who uses Java knows what fields and methods are. If you're going to be giving your metrics to someone who isn't familiar with Java, which seems like a rare thing, you could manually search and replace the output to convert "field" to "attribute" and "method" to "operation."

That's what I think, anyway, I won't be upset about it either way.

0

In article <7177413.1080091306251.JavaMail.itn@is.intellij.net>,
Keith Lea <keith@cs.oswego.edu> wrote:

Your audience is probably Java developers, not metrics fans. I might be wrong
though, maybe the people who tend to look at metrics (management or something
like that) are used to it.


This is a compelling argument for me. The people I have to sell a
metric to are going to want to research them. It would be nice if the
UI I show them matches their terminology.

Everyone who uses Java knows what fields and methods are. If you're going to
be giving your metrics to someone who isn't familiar with Java, which seems
like a rare thing, you could manually search and replace the output to
convert "field" to "attribute" and "method" to "operation."


I suspect that most Java programmers will figure it out pretty quickly,
especially since the metrics field seems to be using most of the same
terms as the OO gurus.

That's what I think, anyway, I won't be upset about it either way.


Same here - I disagree on the conclusion, but both are ultimately
acceptable.

Scott

0

Dave,

I know that you asked for metrics ideas (no pun intended), and I don't know if you have seen the following survey:

http://edu.eap.gr/pli/pli10/info/xenos/Personal_page_files/C14%20-%20Object%20Oriented%20Metrics%20-%20a%20Survey.pdf

It seems like it has a pretty comprehensive list of references to measures. Not sure about the usefulness of them, though, but at least there is a big list :)

Mike

p.s. Your wife can thank me later :)

0

Please sign in to leave a comment.