summaryrefslogtreecommitdiff
path: root/reports.py
diff options
context:
space:
mode:
authorJonathan Corbet <corbet@lwn.net>2015-03-26 13:33:57 -0600
committerJonathan Corbet <corbet@lwn.net>2015-03-26 13:33:57 -0600
commit5516be6e392b210a32d95f61cda0f50a8bcf5be4 (patch)
tree804dfab69fa888c9afa1ccc5fde184e00735cb9e /reports.py
parent5e7f0d50fb869b0af4e3f2c9c7b3ebf04ebe4adb (diff)
Make "lines changed" accounting consistent
We were calculating "total lines changed" on a per-patch basis, while a developer's lines changed were max(added,removed) for the entire period under study. Track developer changed lines per-patch as well...this has the nice effect of making the percentages add up to 100...
Diffstat (limited to 'reports.py')
-rw-r--r--reports.py8
1 files changed, 3 insertions, 5 deletions
diff --git a/reports.py b/reports.py
index 084089e..1c707d0 100644
--- a/reports.py
+++ b/reports.py
@@ -106,7 +106,7 @@ def ReportByPCount(hlist, cscount):
EndReport()
def CompareLChanged(h1, h2):
- return max(h2.added, h2.removed) - max(h1.added, h1.removed)
+ return h2.changed - h1.changed
def ReportByLChanged(hlist, totalchanged):
hlist.sort(CompareLChanged)
@@ -114,10 +114,8 @@ def ReportByLChanged(hlist, totalchanged):
BeginReport('Developers with the most changed lines')
for h in hlist:
pcount = len(h.patches)
- changed = max(h.added, h.removed)
- delta = h.added - h.removed
- if (h.added + h.removed) > 0:
- ReportLine(h.name, changed, (changed*100.0)/totalchanged)
+ if h.changed > 0:
+ ReportLine(h.name, h.changed, (h.changed*100.0)/totalchanged)
count += 1
if count >= ListCount:
break