java - About the value range of "Assignment Branch Condition" -


in work, have rule has limit abc (assignment branch condition) value. know what's best value metric , reason?

the abc metric is

counting number of assignments, branches , conditions section of code. counting rules in original c++ report article c, c++ , java languages, , defined as:

  • assignment -- explicit transfer of data variable, e.g. = *= /= %= += <<= >>= &= |= ^= >>>= ++ --

  • branch -- explicit forward program branch out of scope -- function call, class method call, or new operator

  • condition -- logical/boolean test, == != <= >= < > else case default try catch ? , unary conditionals.

a scalar abc size value (or "aggregate magnitude") computed as:

     |abc| = sqrt((a*a)+(b*b)+(c*c)) 

this question tagged java c# , ruby have different syntax , coding styles don't think there 1 size fits metric this.

in general think want keep number in "goldilocks" range of not low , not high. higher threshold, longer allow methods be. longer methods more complex, harder understand , harder test. if force methods short, hard read jumping different sub-methods.


Comments

Popular posts from this blog

qt - Using float or double for own QML classes -

Create Outlook appointment via C# .Net -

ios - Swift Array Resetting Itself -