3 ms·
It occurs to me this could be a metaphor for code complexity at various levels of abstraction. I'm picturing a recursive method that: - calculates LOC of a top
by SNACKeR99 8y ago
It occurs to me this could be a metaphor for code complexity at various levels of abstraction. I'm picturing a recursive method that:
- calculates LOC of a top-level method
- calculates lines of code for each method called within that
- builds an hourglass visualization showing as you go up or down the abstraction layers how the LOC changes
It seems like this might be useful for seeing
- where in the abstraction layers there are major changes in density of functions
- where there is over-abstraction (many, many tiny functions)
- where there is not enough abstraction (a bulge in LOC, or overall large numbers)
Combining this with cyclomatic complexity may provide a more nuanced view for code analysis. It would allow you to quickly hone in on parts of the code-base that have too much density.