gitinspector icon indicating copy to clipboard operation
gitinspector copied to clipboard

Advanced Statistics and Ranking

Open bonanza123 opened this issue 8 years ago • 9 comments

would it be possible to extend the ranking and statistics in the following way?

  • Differentiate in the general statistics between "actual code" and "comments" in addition to the already existing "Insertions" and "Deletions"
  • Allow ranking of the authors by: Insertions, Deletions, Lines of actual code, comments or code complexity (provided by metrics)

bonanza123 avatar Sep 24 '16 17:09 bonanza123

Hi @bonanza123. You mean show insertions ad deletions in the timeline ? Or do you simply mean the amount of inserted / deleted comments ? I don't see the use case for this functionality and what it would contribute over the "percentage in comments" calculation we already have.

Sorting can already be done in the HTML output in the stable branches (I'm unsure of the status in the master branch, as the HTML output is being rewritten).

adam-waldenberg avatar Sep 24 '16 20:09 adam-waldenberg

@adam-waldenberg, Ahh I see.. I mean e.g. in the image, it would be nice to have additional columns in the second section / paragraph showing also current complexity of survived code on a per-user basis.

bonanza123 avatar Sep 24 '16 20:09 bonanza123

@bonanza123 You mean to show the cyclomatic complexity metric per-user ? I think that would be impossible to calculate, as most of the time, many authors edit the same file and/or method/function. So how would the attribution work ? Who get's "blamed" for any added complexity ?

adam-waldenberg avatar Sep 24 '16 21:09 adam-waldenberg

@bonanza123 It's an intersting thought, but the question is if it can be done in any logical way.

adam-waldenberg avatar Sep 24 '16 21:09 adam-waldenberg

@adam-waldenberg Maybe its a stupid idea but what about doing it proportional to the number lines where each author contributed to. E.g. if there is a code like

if ( x > 0 ) {
     f(x); // this line has been edited by author A and B
     g(x); // this line has only been edited by author A
}

Then I would say author A gets + 2 lines of complexity and author B only + 1.

bonanza123 avatar Sep 24 '16 21:09 bonanza123

@bonanza123 Doubtful. Another way to look at it is that the person that added the if statement is the culprit as he is the one that actually increased the complexity by adding another nesting.

It's an interesting idea, but I'm not quite sure what the "correct" and most logical way to implement it would be.

adam-waldenberg avatar Sep 29 '16 07:09 adam-waldenberg

Let's keep the issue open for now. It might be interesting to look into this. Also, maybe somebody else has some additional ideas for a solution to this.

adam-waldenberg avatar Sep 29 '16 07:09 adam-waldenberg

Hey guys, just started using this tool today and was particularly happy to see this complexity measure. For our team, when we introduce these metrics, it will be

  1. a way to find some hotspots that need work and
  2. give a warm fuzzy idea about the delta complexity introduced by a stack of changes slated to be merged into master.

So for 2, basically you just have to look at the commit-by-commit complexity, with the change in complexity due to a single commit attributable to a single author.

If you handled it like this, you would see the complexity bump up with the commit when the if was introduced which could then be attributed to the author of the commit.

This is probably something you want to be really clear about enabling because it will take forever, but man would it be cool!

wawiesel avatar Aug 11 '17 22:08 wawiesel

Thanks @wawiesel. Interesting idea - but would also mean we would have to add a whole new section to the report for the complexity measurements. And as you say, it would be incredibly painful and take quite a lot of time :). However - it might be something to think about once the incremental stats discussed in #22 are working well.

adam-waldenberg avatar Aug 15 '17 14:08 adam-waldenberg