You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by aldana <al...@gmx.de> on 2008/04/22 14:23:18 UTC

metrics report-plugin (for cyclomatic complexity + loc)

hi, 

to make code smells more visible and to better find out refactoring targets
amongst others i want to introduce some metrics. for that i miss a plugin
which measures the cyclomatic complexity and loc (for classes, methods). 
surprisingly i did not find any maven plugin which offers this...

maybe somebody can point me out to one?

thanks.

-----
manuel aldana
aldana((at))gmx.de
software-engineering blog: http://www.aldana-online.de
-- 
View this message in context: http://www.nabble.com/metrics-report-plugin-%28for-cyclomatic-complexity-%2B-loc%29-tp16823833s177p16823833.html
Sent from the Maven - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: metrics report-plugin (for cyclomatic complexity + loc)

Posted by aldana <al...@gmx.de>.
great,

i already integrated jdepend and your other mentioned report plugins, but
did not know of javancss. this exactly seems to be the last thing i looked
for.


Paolo Compieta wrote:
> 
> Hi,
> give a try to these 2 plugins (insert the following snippet in your
> pom.xml):
> 
>     <reporting>
>         <plugins>
>             [...]
>             <plugin>
>                 <!-- JavaNCSS - A Source Measurement Suite for Java 
> 
> [...]
> 


-----
manuel aldana
aldana((at))gmx.de
software-engineering blog: http://www.aldana-online.de
-- 
View this message in context: http://www.nabble.com/metrics-report-plugin-%28for-cyclomatic-complexity-%2B-loc%29-tp16823833s177p16824263.html
Sent from the Maven - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: metrics report-plugin (for cyclomatic complexity + loc)

Posted by Paolo Compieta <pa...@gmail.com>.
Hi,
give a try to these 2 plugins (insert the following snippet in your
pom.xml):

    <reporting>
        <plugins>
            [...]
            <plugin>
                <!-- JavaNCSS - A Source Measurement Suite for Java
http://www.kclee.de/clemens/java/javancss/ -->
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>javancss-maven-plugin</artifactId>
            </plugin>
            <plugin>
                <!-- A Java package dependency analyzer that generates
design quality metrics http://clarkware.com/software/JDepend.html -->
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>jdepend-maven-plugin</artifactId>
            </plugin>
            <plugin>
            [...]
        </plugins>
    </reporting>

Both will run during the site generation phase, creating reports to link in
the project's site.
Take a look at their home pages for more details and options.

Maybe you'll be interested in these 2, as well:

            <plugin>
                <!-- PMD code analysis tool + Copy/Paste Detector tool
                       
http://maven.apache.org/plugins/maven-pmd-plugin/usage.html -->
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-pmd-plugin</artifactId>
                <configuration>
                    <targetjdk>1.4.2</targetjdk>
                    <format>xml</format>
                    <linkXref>true</linkXref>
                    <sourceEncoding>utf-8</sourceEncoding>
                </configuration>
            </plugin>

            <plugin>
                <!-- FindBugs uses static analysis to inspect Java bytecode
for occurrences of bug patterns
                       
http://mojo.codehaus.org/findbugs-maven-plugin/introduction.html  -->
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>findbugs-maven-plugin</artifactId>
                <configuration>
                    <threshold>Normal</threshold>
                    <effort>Min</effort>
                </configuration>
            </plugin>

All of them greatly integrate with the source xref plugin, linking each
problem to the source code:

            <plugin>
                <!-- JXR is a source cross referencing tool
                       
http://maven.apache.org/plugins/maven-jxr-plugin/howto.html -->
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>jxr-maven-plugin</artifactId>
            </plugin>

Cheers,
Paolo


aldana wrote:
> 
> hi, 
> 
> to make code smells more visible and to better find out refactoring
> targets amongst others i want to introduce some metrics. for that i miss a
> plugin which measures the cyclomatic complexity and loc (for classes,
> methods). 
> surprisingly i did not find any maven plugin which offers this...
> 
> maybe somebody can point me out to one?
> 
> thanks.
> 

-- 
View this message in context: http://www.nabble.com/metrics-report-plugin-%28for-cyclomatic-complexity-%2B-loc%29-tp16823833s177p16823846.html
Sent from the Maven - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


RE: metrics report-plugin (for cyclomatic complexity + loc)

Posted by "Harper, Brad" <br...@epsiia.com>.
I think you'll find that PMD supports cyclomatic complexity. There's a
m2 plugin described at

   http://maven.apache.org/plugins/maven-pmd-plugin/

Brad

> -----Original Message-----
> From: aldana [mailto:aldana@gmx.de] 
> Sent: Tuesday, April 22, 2008 7:23 AM
> To: users@maven.apache.org
> Subject: metrics report-plugin (for cyclomatic complexity + loc)
> 
> 
> hi, 
> 
> to make code smells more visible and to better find out 
> refactoring targets amongst others i want to introduce some 
> metrics. for that i miss a plugin which measures the 
> cyclomatic complexity and loc (for classes, methods). 
> surprisingly i did not find any maven plugin which offers this...
> 
> maybe somebody can point me out to one?
> 
> thanks.
> 
> -----
> manuel aldana
> aldana((at))gmx.de
> software-engineering blog: http://www.aldana-online.de
> --
> View this message in context: 
> http://www.nabble.com/metrics-report-plugin-%28for-cyclomatic-
> complexity-%2B-loc%29-tp16823833s177p16823833.html
> Sent from the Maven - Users mailing list archive at Nabble.com.
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
> 
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: metrics report-plugin (for cyclomatic complexity + loc)

Posted by Tim Moloney <t....@verizon.net>.
aldana wrote:
> hi, 
>
> to make code smells more visible and to better find out refactoring targets
> amongst others i want to introduce some metrics. for that i miss a plugin
> which measures the cyclomatic complexity and loc (for classes, methods). 
> surprisingly i did not find any maven plugin which offers this...
>
> maybe somebody can point me out to one?
>
> thanks.
>
> -----
> manuel aldana
> aldana((at))gmx.de
> software-engineering blog: http://www.aldana-online.de
>   

I have not used it yet, but one I've bookmarked for future use is:

- Java NCSS
  http://www.kclee.com/clemens/java/javancss/

- Java NCSS Maven plugin
  http://mojo.codehaus.org/javancss-maven-plugin/

Hopefully, others have used it and can give us tips, feedback, and 
comparisons against other possible tools.

Tim


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: metrics report-plugin (for cyclomatic complexity + loc)

Posted by Antti Virtanen <an...@nsn.com>.
You may want to try out Sonar (http://sonar.hortis.ch/). It is rather nice
tool for following the improvement of quality metrics.


aldana wrote:
> 
> hi, 
> 
> to make code smells more visible and to better find out refactoring
> targets amongst others i want to introduce some metrics. for that i miss a
> plugin which measures the cyclomatic complexity and loc (for classes,
> methods). 
> surprisingly i did not find any maven plugin which offers this...
> 
> maybe somebody can point me out to one?
> 
> thanks.
> 

-- 
View this message in context: http://www.nabble.com/metrics-report-plugin-%28for-cyclomatic-complexity-%2B-loc%29-tp16823833s177p16824306.html
Sent from the Maven - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org