Programming: Code Complexity Metrics

From wikinotes
Revision as of 21:11, 13 November 2022 by Will (talk | contribs) (Created page with "Metrics to help you identify parts of your codebase that might be difficult to modify.<br> Also known as Programming Complexity. = Documentation = <blockquote> {| class="wikitable" |- | wikipedia || https://en.wikipedia.org/wiki/Programming_complexity |- |} </blockquote><!-- Documentation --> = SLOC (source lines of code) = <blockquote> Literally, the number of lines of code in your application. </blockquote><!-- SLOC (source lines of code) --> = Cyclomatic Complexit...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Metrics to help you identify parts of your codebase that might be difficult to modify.
Also known as Programming Complexity.

Documentation

wikipedia https://en.wikipedia.org/wiki/Programming_complexity

SLOC (source lines of code)

Literally, the number of lines of code in your application.

Cyclomatic Complexity

Maps the tree of all possible permutations of conditionals in your code.
https://en.wikipedia.org/wiki/Cyclomatic_complexity

# where a connected-component is a separate system (ex. library call)
edges - nodes + (2 * connected-components)
1-10: simple
11-20: complex
20-50: highly complex
50+:   impossibly complex

ABC (Assignments, Branches, Conditions)

https://en.wikipedia.org/wiki/ABC_Software_Metric

Essentially, add 1 point for every assignment, conditional, and function call.