English

Navigation
Powered by Squarespace
Foobaruy mwe

Buy my book on <a href="lulu.com">lula</a>

« method name of the day | Main | Long workday »
Donnerstag
Sep112008

flogger: unit test your flog scores


Flog is a simple ABC metric (Assignments, Branches, Calls) for ruby code. It gives you a hint on size and complexity of your code. How to interprete your flog scores is a bit difficult. As usual in Software Engineering: 'it depends'.

Jake Scruggs interpretes the values like this:



  • 0-10: Awesome

  • 11-20: Good enough

  • 21-40: Might need refactoring

  • 41-60: Possible to justify

  • 61-100: Danger

  • 100-200: Whoop, whoop, whoop

  • 200 + Someone please think of the children




(and smarticus says that a score of 60+ means 'WTF are you doing').



So how can you integrate this in your continous integration environment? Or just your in your unit tests?
Enter flogger:



def test_flog_scores()
assert_flog('somefile.rb')
end




Flogger just adds an assert_flog() assertion which you can use in your unit tests. Simple.


Find more in the README

Reader Comments

There are no comments for this journal entry. To create a new comment, use the form below.

PostPost a New Comment

Enter your information below to add a new comment.

My response is on my own website »
Author Email (optional):
Author URL (optional):
Post:
 
Some HTML allowed: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <code> <em> <i> <strike> <strong>