Thread:Mathmagician/@comment-3508190-20121010131546/@comment-3508190-20121010233809

Oh. Wow! Thanks for reading all of that :) You shouldn't have. Really. You shouldn't have. The reason I haven't read that entire article was not that it may have been too complicated. I just skimmed it to find out if the idea in general makes sense.

It's kinda like in computer games. There's probably a formula governing how much taking out that one guard will raise the awareness of all the other guards. But you don't want that formula. You want that formula to make sense on an intuitive level and get a feel for how you should behave for optimal results.

It does look to me like cyclomatic complexity is one of those formulas that make sense on an intuitive level. It did find the passages in my code that made me feel a little queasy.

I'm not so sure about the right number though. Five may be overly aggressive. I seem to be okay with certain sixes. I've removed the eights though and good riddance. The article suggests tens are okay. I haven't seen tens yet...

That comment thing is easy btw:

/*jshint maxcomplexity:6 */

My full comment is this:

/*jshint jquery:true, browser:true, es5:true, devel:true, camelcase:true, curly:false, undef:true, unused:true, bitwise:true, eqeqeq:true, forin:true, immed:true, latedef:true, newcap:true, noarg:true, unused:true, regexp:true, strict:true, trailing:true, maxcomplexity:6 */ /*global mediaWiki:true*/

That's a bit over the top I suppose. :)

Whatever the options, I do very much like jshint! There are quite a few gnarly errors that jshint found immediately and that may have taken me a long time to detect. It's quite the shortcut!