Statistics

Members : 4
Content : 14
Web Links : 4
Content View Hits : 6956
October
Number of Try Blocks (per Method)
Written by Peter Perhac   

I have successfully tweaked the code of the Eclipse Metrics Plugin by StateOfFlow to extend it by another simple metric: Number of Try Blocks (NOTB). This is calculated for each method of a class and only goes to point out methods that are perhaps trying to do too much in one place.

Methods containing more than one try block are a bad programming practice. Luckily though, having applied the extended metrics plugin to several projects, there don't seem to be too many methods of this kind.

Last Updated on Wednesday, 04 November 2009 10:06
Read more...
 
Eclipse Metrics Plugin by StateOfFlow
Written by Peter Perhac   

StateOfFlow logoI hav been using the Metrics plugin for Eclipse developed by Lance Walton (for StateOfFlow) over the last couple of months. The plugin is very elegant and I thought it would be great if I could have a look at how it's computing the individual metrics. So I contacted the author, Lance, and enquired about the source code. Turned out that not only the code is available (from the CVS repository at sourceforge), but also that Lance has some interesting ideas he's willing to share.

Last Updated on Tuesday, 03 November 2009 12:41
Read more...
 
JKD "metric" - pretty pictures and no meaning
Written by Peter Perhac   

Histogram picture 'Java Keyword Density' (JKD) is a little hocus-pocus software metric of mine. A Java source file is analysed so that the individual words (i.e. operands and operators) are counted and also the number of Java keywords (e.g. new, public, class, for, void, int). The "metric" is calculated as:

JKD = (keyword count)/(word count)
Last Updated on Monday, 02 November 2009 23:26
Read more...
 
Code Stripper
Written by Peter Perhac   

Eclipse GalileoAs usual, I started off by plunging directly into coding. After many hours of frustration I managed to come up with a Java application which takes a folder name (or an idividual .java file name) and goes through every single java file within that folder and removes all empty lines, tabs, leading and trailing spaces, end-of-line comments, multi-line comments (and Javadocs), and replaces all occurrences of hard-coded string constants by "STRING".

Java source code thus modified is rather easy to analyse -- well, as far as some of the simpler code metrics go.

Last Updated on Saturday, 07 November 2009 20:06
Read more...
 


RocketTheme Joomla Templates