Tools to find and measure the most modified code?


I have plenty of tools for static analysis, dupe detection, linting, measuring cyclomatic complexity, etc but one of the things I'd always like to be able to find is what part of the code has been modified the most (aka "hot spots").

Does anyone have tips on tools that parse git or SVN logs to identify files/lines that have changed the most?

I believe that the most-modified code is probably the most-modified for a reason.. numerous requirements changes, buggy code, etc. Therefore, it seems like a good place to focus unit tests, code reviews, refactoring, etc.

As mentioned in the question @Aaron Sheffey linked to, StatSVN can give you file-level statistics for "hot code".

There are likely other tools out there that do similar things, but if not, or you don't find one you like, it isn't too hard to write a quick program that looks at the history of your favorite VC system and simply counts the number of times a particular file gets changed.

If you are looking for more in-depth hot spots, you will likely need to be using a VC system that can track methods and other code elements natively (git does this to some extent), and then you will need to hook into it's "blame" feature (or equivalent) and process that.