[ statsvn-Bugs-1995305 ] Wrong lines of Code calculation

1 message Options
Embed this post
Permalink
SourceForge.net

[ statsvn-Bugs-1995305 ] Wrong lines of Code calculation

Reply Threaded More More options
Print post
Permalink
Bugs item #1995305, was opened at 2008-06-16 12:34
Message generated for change (Comment added) made by jkealey
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=833326&aid=1995305&group_id=164845

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: None
Group: None
>Status: Closed
>Resolution: Invalid
Priority: 5
Private: No
Submitted By: Jordi Floriach (jordiflor)
Assigned to: Nobody/Anonymous (nobody)
Summary: Wrong lines of Code calculation

Initial Comment:
subversion-1.4.4-30
statsvn-0.4.0

Hello,

stats made on different revisions show different lines of code on past commits.

For example, I checked out rev 42 and 80 and generate stats for each one (using full log).

For a given file, I get these dumps:

--- Revision 42

File 11/ src/foo.c         LOC:687
        Revision:27     Delta:878       Lines:878       Ini::Y  BegLog:N        Dead:N  SumDelta:878   null
        Revision:31     Delta:-84       Lines:794       Ini::N  BegLog:N        Dead:N  SumDelta:794   null
        Revision:34     Delta:0         Lines:794       Ini::N  BegLog:N        Dead:N  SumDelta:794   null
        Revision:36     Delta:-2        Lines:792       Ini::N  BegLog:N        Dead:N  SumDelta:792   null
        Revision:37     Delta:-105      Lines:687       Ini::N  BegLog:N        Dead:N  SumDelta:687   null
        Revision:39     Delta:0         Lines:687       Ini::N  BegLog:N        Dead:N  SumDelta:687   null
        Revision:41     Delta:0         Lines:687       Ini::N  BegLog:N        Dead:N  SumDelta:687   null


--- Revision 80

File 11/ src/foo.c         LOC:801
        Revision:27     Delta:1143      Lines:1143      Ini::Y  BegLog:N        Dead:N  SumDelta:1143  null
        Revision:31     Delta:-84       Lines:1059      Ini::N  BegLog:N        Dead:N  SumDelta:1059  null
        Revision:34     Delta:0         Lines:1059      Ini::N  BegLog:N        Dead:N  SumDelta:1059  null
        Revision:36     Delta:-2        Lines:1057      Ini::N  BegLog:N        Dead:N  SumDelta:1057  null
        Revision:37     Delta:-105      Lines:952       Ini::N  BegLog:N        Dead:N  SumDelta:952   null
        Revision:39     Delta:0         Lines:952       Ini::N  BegLog:N        Dead:N  SumDelta:952   null
        Revision:41     Delta:0         Lines:952       Ini::N  BegLog:N        Dead:N  SumDelta:952   null
        Revision:43     Delta:1         Lines:953       Ini::N  BegLog:N        Dead:N  SumDelta:953   null
        Revision:44     Delta:-64       Lines:889       Ini::N  BegLog:N        Dead:N  SumDelta:889   null
        Revision:45     Delta:-86       Lines:803       Ini::N  BegLog:N        Dead:N  SumDelta:803   null
        Revision:46     Delta:45        Lines:848       Ini::N  BegLog:N        Dead:N  SumDelta:848   null
        Revision:47     Delta:14        Lines:862       Ini::N  BegLog:N        Dead:N  SumDelta:862   null
        Revision:50     Delta:-9        Lines:853       Ini::N  BegLog:N        Dead:N  SumDelta:853   null
        Revision:55     Delta:-69       Lines:784       Ini::N  BegLog:N        Dead:N  SumDelta:784   null
        Revision:56     Delta:-45       Lines:739       Ini::N  BegLog:N        Dead:N  SumDelta:739   null
        Revision:59     Delta:-13       Lines:726       Ini::N  BegLog:N        Dead:N  SumDelta:726   null
        Revision:60     Delta:34        Lines:760       Ini::N  BegLog:N        Dead:N  SumDelta:760   null
        Revision:61     Delta:0         Lines:760       Ini::N  BegLog:N        Dead:N  SumDelta:760   null
        Revision:63     Delta:31        Lines:791       Ini::N  BegLog:N        Dead:N  SumDelta:791   null
        Revision:65     Delta:54        Lines:845       Ini::N  BegLog:N        Dead:N  SumDelta:845   null
        Revision:66     Delta:35        Lines:880       Ini::N  BegLog:N        Dead:N  SumDelta:880   null
        Revision:68     Delta:-13       Lines:867       Ini::N  BegLog:N        Dead:N  SumDelta:867   null
        Revision:71     Delta:-29       Lines:838       Ini::N  BegLog:N        Dead:N  SumDelta:838   null
        Revision:75     Delta:-37       Lines:801       Ini::N  BegLog:N        Dead:N  SumDelta:801   null


The fact is that in rev 27 (this file's initial) file has 677 lines.
Every stat with a greater revision increases the original size of the file (and this applies to all files). I cannot figure out how this numbers are calculated. The fact is that LOC graphics each time has a bigger scale on past events.
Final number of lines is correct, but initial and deltas aren't.


Regards,
Jordi Floriach

----------------------------------------------------------------------

>Comment By: Jason Kealey (jkealey)
Date: 2008-06-16 22:57

Message:
Logged In: YES
user_id=1498924
Originator: NO

Thanks! Closing bug.

----------------------------------------------------------------------

Comment By: Jordi Floriach (jordiflor)
Date: 2008-06-16 15:14

Message:
Logged In: YES
user_id=2069575
Originator: YES

Hi,

I apologize for making you loss your time. It looked like so awful bug
that it wasn't possible that nobody had submitted it before.
Problem was originated in a "missing revision" due to some irregularity in
cvs2svn process.
I've recreated SVN repository again and all stuff looks pretty OK.

Thanks,
Jordi

----------------------------------------------------------------------

Comment By: Jason Kealey (jkealey)
Date: 2008-06-16 13:56

Message:
Logged In: YES
user_id=1498924
Originator: NO

You may have found a real bug here. I wonder if we even use those past
values anywhere in the reports ...
(Haven't tried -dump on my project yet.). I think we only work with the
diffs and final counts, never the actual past line counts. (to be
investigated if this is a bug in the -dump or a bug in the data model)

By the way, expect a few data inconsistencies because we don't support
branch svn move or copy (they are seen as deletion+addition or addition).
The current results aren't perfect, but they give a good idea of what is
going on.


----------------------------------------------------------------------

Comment By: Jordi Floriach (jordiflor)
Date: 2008-06-16 13:51

Message:
Logged In: YES
user_id=2069575
Originator: YES

Thanks for fast answer.

Now I figured out... deltas are well calculated, but applied backwards
with opposite sign and on the n-1 affected revision.

These are linecounts (wc -l) for revisions with changes, resulting deltas
match with dump, but the sign:
878 r63/src/foo.c
847 r65/src/foo.c   +31
793 r66/src/foo.c   -54
758 r68/src/foo.c   -35
771 r71/src/foo.c   +13
800 r75/src/foo.c   +29


Now the question is: is this problem reproducible or only affects to me?


Regards,
Jordi



----------------------------------------------------------------------

Comment By: Jason Kealey (jkealey)
Date: 2008-06-16 12:48

Message:
Logged In: YES
user_id=1498924
Originator: NO

Interesting.

What does the svn diff of foo.c between revisions 66 and 68 give you, for
example.

(FYI, we start with the current line count in the working copy, and work
our way back using the log and svn diff.)





----------------------------------------------------------------------

You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=833326&aid=1995305&group_id=164845

-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
Statsvn-developers mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/statsvn-developers