37

The vc-annotate in Emacs is a nice tool to see the "maturity" (age) of each line of code in colors. More blue dark, more mature, more red, less mature. This functionality has already been considered to be implemented in MediaWiki (but I don't know if it ever came to be). Usually, in a active project, untouchables lines or functions are very stable (it's applicable to Wiki too - information not disputed tend to be better) and bug-free.

Is there a tool to make a analysis of maturity of a code on Git based on the age of each line? That output something like:

Total lines: 500
Until 1 month lines: 100
1mo-6mo lines: 200
6mo-1yr lines: 100
more than 1yr lines: 100

This could be very useful in active projects (in abandoned maybe it is useless since the entire code would be false-flagged to "mature").

2
  • Hello Felipe, welcome to SO :) As answered below by O.F., SonarQube has this feature. I did use something similar but the use of this feature made the syntactic colorization quite unreadable, so the leaddev did modify background colors with dark gray scales instead of text colors.
    – Benj
    Commented Sep 13, 2019 at 22:26
  • 2
    I think a better word may be "age". Also does changing the indentation level of a snippet reset this counter? This could happen if something was put inside a conditional without changing the code itself. Commented Sep 15, 2019 at 13:25

5 Answers 5

41

I think you can use: https://github.com/erikbern/git-of-theseus

It can visualize the amount of code still in use since its conception.

This is a graph of the Git codebase itself:

enter image description here

2
  • 7
    Funny. It hints at a soft ceiling for the amount of LOC in use. Commented Sep 13, 2019 at 17:07
  • 19
    @Mindwin to go beyond that border is the land of enterprise code Simba. You must never venture there.
    – mbrig
    Commented Sep 13, 2019 at 18:16
12

On browsing through the of @Niels van Reijmersdal answer, I found this written in the README

Markovtsev Vadim implemented a very similar analysis that claims to be 20%-6x faster than Git of Theseus. It's named Hercules and there's a great blog post about all the complexity going into the analysis of Git history.

So well lookup Hercules and go through the blog post.

Disclaimer: I have neither used Hercules, nor git-of-theseus.

11

Well, SonarQube has a metric actually called Maturity, so, yeah. :)

2

The best tool I know is Codescene https://codescene.io.

2

You can check Codacy. This will give some insight about code.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.