Skip to end of metadata
Go to start of metadata

Plugin Information

View RubyMetrics on the plugin site for more information.

Ruby metric reports for Jenkins. Rcov, Rails stats, Rails notes and Flog.

Rcov support

Rcov plugin parses rcov html report files and shows it in Jenkins with a trend graph.

Once we've installed the RubyMetrics plugin, we have to introduce the output report directory into the job configuration:

If the build was successfully, Jenkins generates the trend report and the graph:

Rails stats support

Once the plugin is installed we can publish rails stats reports checking the right option:

Jenkins generates a report by each successful build and keeps an historic version while the project goes forward:

Rails notes support

Flog support

Flog measures code complexity. It shows you the most torturous code you wrote.

Check the right option in your job's configuration and add the directories that you want to monitorize, i.e app/models

Changelog

Full changelog can be accessed here

7 Comments

  1. Unknown User (karl.baum@gmail.com)

    Getting the following exception when I try to install:

    java.io.IOException: Dependency rake (1.5) doesn't exist
        at hudson.ClassicPluginStrategy.loadPluginDependencies(ClassicPluginStrategy.java:318)
        at hudson.ClassicPluginStrategy.load(ClassicPluginStrategy.java:183)
        at hudson.PluginManager.<init>(PluginManager.java:154)
        at hudson.model.Hudson.<init>(Hudson.java:541)
        at hudson.WebAppMain$2.run(WebAppMain.java:191)

    Hudson: 1.303
    Ruby: 1.8.7 (2008-08-11 patchlevel 72) i686-darwin9.6.0
    Java: 1.5.0_16
    RubyMetrics: 1.2.3

    Anyone run into this one before?

    thx.

    1. I believe you need to install the Hudson Rake plugin .  I experienced a similar error on Windows after installing v1.4 of RubyMetrics; and installing v1.6.2 of the Rake plugin resolved the issue.  Hope this helps.

  2. These are great. Thanks for the hard work. And of course I have a feature request. It would be great if the flog plugin was configurable so that you could display/graph just the method complexities. Its hard to weed though the numbers since a single class with 100 methods could have the same score as a single class with one really complicated method.

  3. Unknown User (kwolf@backstopsolutions.com)

    Ruby metrics doesn't appear to be displaying rcov, rails stats or annotations charted on 'unstable' builds.  For example if our defined coverage requirements aren't met, none of the charts are updated.  It also doesn't appear to update the actual coverage report (coverage/index.html).  Is this a known issue?  I didn't see anything open in JIRA.

    Thanks,

    Kevin.

  4. Does this support RVM? Or is that a non-issue?

  5. I want to report an issue, or actually an inconvenience, and I hope for a solution :)

    When  I run rake spec through Jenkins and some tests fail, then rubyMetrics gives outpu: Build faild, skipping rcov coverage report. I edited rubyMetrics source code and made it to not to skip coverage report on fail and compiled it and it works, but: the coverage trend chart created by rubyMetrics and rcov is not up to date.

    What I mean is that when I go to job/my_job/rcov it redirects me to for example /job/my_job/100/rcov/? where 100 is my latestSuccessfull build and my last buid is for example 120 but it fails.

    Even though my last build fails (because some rspec tests fail) I want the chart in main job page to display lastBuild chart and not lastSuccessfulBuild chart and the link to rcov report to redirect to LastBuild data and NOT lastSuccessfulBuild data.

    I've been searching through  rubyMetrics source code the whole day and found nothing.

    Please anyone help me? How can I override Jenkins or rubyMetrics to show me the chart of lasteBuild when I am on a job page (ie. /job/my_job/)

    Thanks in advance for any help!!

  6. I'm using RVM, Rails 3.0.3, Ruby 1.9.2p180. I'd tried to get this plugin working initially for Rails stats output, and had no luck. It would run and act like it was running the stats after build step, but never captured any output. Eventually I turned it on for flog and rcov and they did generate some results. I kept trying different tweaks of the configuration, thinking it was RVM that was getting in the way somehow.

    When I was just about to throw in the towel for this plugin, I installed metric_fu ( version 1.5.1 ) to try a different plugin for gathering Ruby metrics. This gem installs a bunch of other dependencies. When I checked after the next build, it had actually collected the stats and annotations as requested.

    So my suspicion is there is a hidden, or at least not documented dependency on something metric_fu installed.

    But its working great now. Thanks!