The Dopefly Tech Blog

<< The Dopefly Tech Blog Main page

Introducing the CFML Complexity Metric Tool

posted under category: Free Code For You on June 8, 2011 at 1:00 am by MrNate

A little bit ago I committed my first code to GitHub in the form of a project I've been tinkering with, a cyclomatic complexity measuring tool for your CFML apps. It's just a few files and a snazzy interface that will give you a heatmap kind of display to help highlight areas of complexity in your ColdFusion apps.

It's a quick toy to play with, and maybe it can help you reduce or refactor some of the more complex aspects of your applications, so give it a try!

RIAForge site
Project & Files on Github

And screenshots, so you know what you're getting in to:

Finally, big props to Sean Coyne for already dropping a patch on it. I like this Github stuff, but I don't understand all the terminology yet.

Too old to comment!
On Jun 8, 2011 at 1:00 AM Rob Brooks-Bilson (rbils via said:

Thanks for releasing this. Any thought given to turning it into a CF Builder extension?

On Jun 8, 2011 at 1:00 AM Nathan Strutz ( said:
Great idea. Now, who can give me a license? :p
Seriously though, I hadn't thought of it. I wonder... Thanks for the idea!

On Jun 8, 2011 at 1:00 AM mike henke (henke.mike of said:
nice! i like the github and less css usage.

On Jun 8, 2011 at 1:00 AM eapen (eapen7, by way of said:
Can you add .hg and .git directory exclusions as well?

On Jun 8, 2011 at 1:00 AM Nathan Strutz ( said:
Yes... as soon as I figure out how to update my local repo... I think I may install TortoiseGIT because eGIT is just so confusing. Seriously, sheesh. Cyclomatic complexity indexing and relative heat-mapping is nothing to me, it's Git that has me confused.

On Jun 9, 2011 at 1:00 AM Dan Fredericks (fmdano sends love to said:
So, as the code gets more or less red, does that mean the specific section is very complex or not at all? I have not read your applications code, so what designates some code is more red than other code? I know some of the apps I work on are very crazy spaghetti code, while my FW1 file is less of that code, but it seems to rate a lot more complex, so what is complex to your app?


On Jun 9, 2011 at 1:00 AM Nathan Strutz ( said:
Dan, blue = simpler, red = more complex. It's a relative heat-map, depending on what code you have in view, so if you have a function with 1 cfif, it will start off bright blue, that if block will be bright red, and the rest of the function will be something in-between, maybe a dark blue. The deeper you embed your logic, the higher your complexity rating will climb. If you are talking about a file-by-file complexity rating, if you put a lot of logic in one big component, that file will have a high ranking. And remember the coloring is on a relative curve, if you have one crazy file and 300 easy files, all but the one may look blue. I'm thinking of a way to hide the bottom 5% and adjust the color ranking so the color scale maxes out at the top 5%. Just thoughts at the moment.

You can read up on cyclomatic complexity at Wikipedia probably, I think I caught my first hint from the book Code Complete, which I highly recommend.

On Jun 9, 2011 at 1:00 AM Dan Fredericks (fmdano has underestimated the power of said:
Thanks...I was not sure what was what because my list of files would show a number next to it. I would click on a high number, and then the file may start out blue, then get more red as I scrolled down the page. Guess I need to read about cyclomatic complexities :)

On Jun 17, 2011 at 1:00 AM Sean Coyne ( said:
I have Code Complete sitting on my desk. I really need to get around to reading it.

RE: Git GUIs, I tried Tower for Mac and it was nice, but has a fairly high price tag. Worth it if yo use Git a lot, which I don't, so I typically use eGit for simple commits and pushes, but I use the command line for basically everything else.
Too old to comment!