Auditing legacy code

I came across a very interesting post from xebia :

which discuss a very handful code representation mixing vcs history, cognitive complexity and coverage.
I guess it wouldn’t be difficult to generate such representation in sonar and that would be very helpful when discussing where to put effort to refactor code.



Hey there.

Without commenting on this specific representation, such attempts to point to those pain points exist in SonarQube already.

Bubbles in the upper-right being where the most attention is needed (complex, untested code)

Hi Colin,

The graph that you are referring to mixes code coverage and cognitive complexity which is very helpful indeed but doesn’t help when you want to know where to start refactoring.

One want to start refactoring by functions with a high complexity which change often since that means that they are at risk since it is very likely to change in the future (either because they are buggy or because their scope changes).