Fixing metrics in phpUnderControl 0.5.0

I recently upgraded our buildbox to phpUnderControl 0.5.0 being really curious about new CodeBrowser feature. And indeed CodeBrowser addon is really cool (see Manuel Pichler announcement on his site for details), but after the upgrade I found Metrics tab broken. Instead of nice shiny graphs it showed me Java exception like this:

Metrics exception

Metrics exception

It took me a while to figure out what caused this strange behaviour. I have found the answer when I have run graph generation manually:

#> phpuc graph logs/PHPUnit-3.5/ artifacts/PHPUnit-3.5/

It returned pretty instantly the following error:

The value '1' that you were trying to assign to setting 'labelCount' is invalid. Allowed values are: int > 1.

A little bit of googling and I actually found the answer, again on Manuel Pichler site, in the comments for the announcement.

Basically with phpUnderControl 0.5.0 a file has been released called ClassComplexityInput.php. It is not ready yet to generate a graphs (I suspect it’s gonna be a graph representing class complexity), but phpUnderControl goes through all available input processors to generate graphs for the metrics page.

Fix in that case is pretty trivial, just remove the file (it’s in phpUnderControl/Graph/Input/ directory) and voila – your graphs are back!

Metrics fixed

Metrics fixed

  1. I did this and it doent work…
    Problem i see is there is artifacts dir….

    Can you help me on this..

    Thanks
    Saket

  2. There is no Artifacts dir…

  3. If you haven’t got artifacts directory your cruisecontrol is not setup properly. Then command is suppose to process files in your logs directory and output the results in your artifacts directory. Standards cruisecontrol/phpUnderControl installation should have the following directory structure:

    cruisecontrol
    – artifacts
    — YourProject
    – logs
    — YourProject
    – projects
    — YourProject
    – config.xml

Leave a Comment


NOTE - You can use these HTML tags and attributes:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>