Add coverage percentange to stats
This commit is contained in:
parent
def41b8b1d
commit
d1aab4904a
84
reports.py
84
reports.py
|
@ -67,7 +67,9 @@ def ReportLine (text, count, pct):
|
||||||
HTMLfile.write (TRow % (HClasses[HTMLclass], text, count, pct))
|
HTMLfile.write (TRow % (HClasses[HTMLclass], text, count, pct))
|
||||||
HTMLclass ^= 1
|
HTMLclass ^= 1
|
||||||
|
|
||||||
def EndReport ():
|
def EndReport (text=None):
|
||||||
|
if text:
|
||||||
|
Outfile.write ('%s\n' % (text, ))
|
||||||
if HTMLfile:
|
if HTMLfile:
|
||||||
HTMLfile.write ('</table>\n\n')
|
HTMLfile.write ('</table>\n\n')
|
||||||
|
|
||||||
|
@ -79,7 +81,7 @@ def ComparePCount (h1, h2):
|
||||||
|
|
||||||
def ReportByPCount (hlist, cscount):
|
def ReportByPCount (hlist, cscount):
|
||||||
hlist.sort (ComparePCount)
|
hlist.sort (ComparePCount)
|
||||||
count = 0
|
count = reported = 0
|
||||||
BeginReport ('Developers with the most changesets')
|
BeginReport ('Developers with the most changesets')
|
||||||
for h in hlist:
|
for h in hlist:
|
||||||
pcount = len (h.patches)
|
pcount = len (h.patches)
|
||||||
|
@ -87,33 +89,35 @@ def ReportByPCount (hlist, cscount):
|
||||||
delta = h.added - h.removed
|
delta = h.added - h.removed
|
||||||
if pcount > 0:
|
if pcount > 0:
|
||||||
ReportLine (h.name, pcount, (pcount*100.0)/cscount)
|
ReportLine (h.name, pcount, (pcount*100.0)/cscount)
|
||||||
|
reported += pcount
|
||||||
count += 1
|
count += 1
|
||||||
if count >= ListCount:
|
if count >= ListCount:
|
||||||
break
|
break
|
||||||
EndReport ()
|
EndReport ('Covers %f%% of changesets' % ((reported*100.0)/cscount, ))
|
||||||
|
|
||||||
def CompareBCount (h1, h2):
|
def CompareBCount (h1, h2):
|
||||||
return len (h2.bugsfixed) - len (h1.bugsfixed)
|
return len (h2.bugsfixed) - len (h1.bugsfixed)
|
||||||
|
|
||||||
def ReportByBCount (hlist, totalbugs):
|
def ReportByBCount (hlist, totalbugs):
|
||||||
hlist.sort (CompareBCount)
|
hlist.sort (CompareBCount)
|
||||||
count = 0
|
count = reported = 0
|
||||||
BeginReport ('Developers with the most bugs fixed')
|
BeginReport ('Developers with the most bugs fixed')
|
||||||
for h in hlist:
|
for h in hlist:
|
||||||
bcount = len (h.bugsfixed)
|
bcount = len (h.bugsfixed)
|
||||||
if bcount > 0:
|
if bcount > 0:
|
||||||
ReportLine (h.name, bcount, (bcount*100.0)/totalbugs)
|
ReportLine (h.name, bcount, (bcount*100.0)/totalbugs)
|
||||||
|
reported += bcount
|
||||||
count += 1
|
count += 1
|
||||||
if count >= ListCount:
|
if count >= ListCount:
|
||||||
break
|
break
|
||||||
EndReport ()
|
EndReport ('Covers %f%% of bugs' % ((reported*100.0)/totalbugs, ))
|
||||||
|
|
||||||
def CompareLChanged (h1, h2):
|
def CompareLChanged (h1, h2):
|
||||||
return max(h2.added, h2.removed) - max(h1.added, h1.removed)
|
return max(h2.added, h2.removed) - max(h1.added, h1.removed)
|
||||||
|
|
||||||
def ReportByLChanged (hlist, totalchanged):
|
def ReportByLChanged (hlist, totalchanged):
|
||||||
hlist.sort (CompareLChanged)
|
hlist.sort (CompareLChanged)
|
||||||
count = 0
|
count = reported = 0
|
||||||
BeginReport ('Developers with the most changed lines')
|
BeginReport ('Developers with the most changed lines')
|
||||||
for h in hlist:
|
for h in hlist:
|
||||||
pcount = len (h.patches)
|
pcount = len (h.patches)
|
||||||
|
@ -121,17 +125,18 @@ def ReportByLChanged (hlist, totalchanged):
|
||||||
delta = h.added - h.removed
|
delta = h.added - h.removed
|
||||||
if (h.added + h.removed) > 0:
|
if (h.added + h.removed) > 0:
|
||||||
ReportLine (h.name, changed, (changed*100.0)/totalchanged)
|
ReportLine (h.name, changed, (changed*100.0)/totalchanged)
|
||||||
|
reported += changed
|
||||||
count += 1
|
count += 1
|
||||||
if count >= ListCount:
|
if count >= ListCount:
|
||||||
break
|
break
|
||||||
EndReport ()
|
EndReport ('Covers %f%% of changes' % ((reported*100.0)/totalchanged, ))
|
||||||
|
|
||||||
def CompareLRemoved (h1, h2):
|
def CompareLRemoved (h1, h2):
|
||||||
return (h2.removed - h2.added) - (h1.removed - h1.added)
|
return (h2.removed - h2.added) - (h1.removed - h1.added)
|
||||||
|
|
||||||
def ReportByLRemoved (hlist, totalremoved):
|
def ReportByLRemoved (hlist, totalremoved):
|
||||||
hlist.sort (CompareLRemoved)
|
hlist.sort (CompareLRemoved)
|
||||||
count = 0
|
count = reported = 0
|
||||||
BeginReport ('Developers with the most lines removed')
|
BeginReport ('Developers with the most lines removed')
|
||||||
for h in hlist:
|
for h in hlist:
|
||||||
pcount = len (h.patches)
|
pcount = len (h.patches)
|
||||||
|
@ -139,55 +144,59 @@ def ReportByLRemoved (hlist, totalremoved):
|
||||||
delta = h.added - h.removed
|
delta = h.added - h.removed
|
||||||
if delta < 0:
|
if delta < 0:
|
||||||
ReportLine (h.name, -delta, (-delta*100.0)/totalremoved)
|
ReportLine (h.name, -delta, (-delta*100.0)/totalremoved)
|
||||||
|
reported += -delta
|
||||||
count += 1
|
count += 1
|
||||||
if count >= ListCount:
|
if count >= ListCount:
|
||||||
break
|
break
|
||||||
EndReport ()
|
EndReport ('Covers %f%% of changes' % ((reported*100.0)/totalremoved, ))
|
||||||
|
|
||||||
def CompareEPCount (e1, e2):
|
def CompareEPCount (e1, e2):
|
||||||
return e2.count - e1.count
|
return e2.count - e1.count
|
||||||
|
|
||||||
def ReportByPCEmpl (elist, cscount):
|
def ReportByPCEmpl (elist, cscount):
|
||||||
elist.sort (CompareEPCount)
|
elist.sort (CompareEPCount)
|
||||||
count = 0
|
count = total_pcount = 0
|
||||||
BeginReport ('Top changeset contributors by employer')
|
BeginReport ('Top changeset contributors by employer')
|
||||||
for e in elist:
|
for e in elist:
|
||||||
if e.count != 0:
|
if e.count != 0:
|
||||||
ReportLine (e.name, e.count, (e.count*100.0)/cscount)
|
ReportLine (e.name, e.count, (e.count*100.0)/cscount)
|
||||||
|
total_pcount += e.count
|
||||||
count += 1
|
count += 1
|
||||||
if count >= ListCount:
|
if count >= ListCount:
|
||||||
break
|
break
|
||||||
EndReport ()
|
EndReport ('Covers %f%% of changesets' % ((total_pcount*100.0)/cscount, ))
|
||||||
|
|
||||||
def CompareEBCount (e1, e2):
|
def CompareEBCount (e1, e2):
|
||||||
return len (e2.bugsfixed) - len (e1.bugsfixed)
|
return len (e2.bugsfixed) - len (e1.bugsfixed)
|
||||||
|
|
||||||
def ReportByBCEmpl (elist, totalbugs):
|
def ReportByBCEmpl (elist, totalbugs):
|
||||||
elist.sort (CompareEBCount)
|
elist.sort (CompareEBCount)
|
||||||
count = 0
|
count = reported = 0
|
||||||
BeginReport ('Top bugs fixed by employer')
|
BeginReport ('Top bugs fixed by employer')
|
||||||
for e in elist:
|
for e in elist:
|
||||||
if len(e.bugsfixed) != 0:
|
if len(e.bugsfixed) != 0:
|
||||||
ReportLine (e.name, len(e.bugsfixed), (len(e.bugsfixed)*100.0)/totalbugs)
|
ReportLine (e.name, len(e.bugsfixed), (len(e.bugsfixed)*100.0)/totalbugs)
|
||||||
|
reported += len(e.bugsfixed)
|
||||||
count += 1
|
count += 1
|
||||||
if count >= ListCount:
|
if count >= ListCount:
|
||||||
break
|
break
|
||||||
EndReport ()
|
EndReport ('Covers %f%% of bugs' % ((reported*100.0)/totalbugs, ))
|
||||||
|
|
||||||
def CompareELChanged (e1, e2):
|
def CompareELChanged (e1, e2):
|
||||||
return e2.changed - e1.changed
|
return e2.changed - e1.changed
|
||||||
|
|
||||||
def ReportByELChanged (elist, totalchanged):
|
def ReportByELChanged (elist, totalchanged):
|
||||||
elist.sort (CompareELChanged)
|
elist.sort (CompareELChanged)
|
||||||
count = 0
|
count = reported = 0
|
||||||
BeginReport ('Top lines changed by employer')
|
BeginReport ('Top lines changed by employer')
|
||||||
for e in elist:
|
for e in elist:
|
||||||
if e.changed != 0:
|
if e.changed != 0:
|
||||||
ReportLine (e.name, e.changed, (e.changed*100.0)/totalchanged)
|
ReportLine (e.name, e.changed, (e.changed*100.0)/totalchanged)
|
||||||
|
reported += e.changed
|
||||||
count += 1
|
count += 1
|
||||||
if count >= ListCount:
|
if count >= ListCount:
|
||||||
break
|
break
|
||||||
EndReport ()
|
EndReport ('Covers %f%% of changes' % ((reported*100.0)/totalchanged, ))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -199,16 +208,17 @@ def ReportBySOBs (hlist):
|
||||||
totalsobs = 0
|
totalsobs = 0
|
||||||
for h in hlist:
|
for h in hlist:
|
||||||
totalsobs += len (h.signoffs)
|
totalsobs += len (h.signoffs)
|
||||||
count = 0
|
count = reported = 0
|
||||||
BeginReport ('Developers with the most signoffs (total %d)' % totalsobs)
|
BeginReport ('Developers with the most signoffs (total %d)' % totalsobs)
|
||||||
for h in hlist:
|
for h in hlist:
|
||||||
scount = len (h.signoffs)
|
scount = len (h.signoffs)
|
||||||
if scount > 0:
|
if scount > 0:
|
||||||
ReportLine (h.name, scount, (scount*100.0)/totalsobs)
|
ReportLine (h.name, scount, (scount*100.0)/totalsobs)
|
||||||
|
reported += scount
|
||||||
count += 1
|
count += 1
|
||||||
if count >= ListCount:
|
if count >= ListCount:
|
||||||
break
|
break
|
||||||
EndReport ()
|
EndReport ('Covers %f%% of signoffs' % ((reported*100.0)/totalsobs, ))
|
||||||
|
|
||||||
#
|
#
|
||||||
# Reviewer reporting.
|
# Reviewer reporting.
|
||||||
|
@ -221,16 +231,17 @@ def ReportByRevs (hlist):
|
||||||
totalrevs = 0
|
totalrevs = 0
|
||||||
for h in hlist:
|
for h in hlist:
|
||||||
totalrevs += len (h.reviews)
|
totalrevs += len (h.reviews)
|
||||||
count = 0
|
count = reported = 0
|
||||||
BeginReport ('Developers with the most reviews (total %d)' % totalrevs)
|
BeginReport ('Developers with the most reviews (total %d)' % totalrevs)
|
||||||
for h in hlist:
|
for h in hlist:
|
||||||
scount = len (h.reviews)
|
scount = len (h.reviews)
|
||||||
if scount > 0:
|
if scount > 0:
|
||||||
ReportLine (h.name, scount, (scount*100.0)/totalrevs)
|
ReportLine (h.name, scount, (scount*100.0)/totalrevs)
|
||||||
|
reported += scount
|
||||||
count += 1
|
count += 1
|
||||||
if count >= ListCount:
|
if count >= ListCount:
|
||||||
break
|
break
|
||||||
EndReport ()
|
EndReport ('Covers %f%% of reviews' % ((reported*100.0)/totalrevs, ))
|
||||||
|
|
||||||
def CompareRevsEmpl (e1, e2):
|
def CompareRevsEmpl (e1, e2):
|
||||||
return len (e2.reviews) - len (e1.reviews)
|
return len (e2.reviews) - len (e1.reviews)
|
||||||
|
@ -240,16 +251,17 @@ def ReportByRevsEmpl (elist):
|
||||||
totalrevs = 0
|
totalrevs = 0
|
||||||
for e in elist:
|
for e in elist:
|
||||||
totalrevs += len (e.reviews)
|
totalrevs += len (e.reviews)
|
||||||
count = 0
|
count = reported = 0
|
||||||
BeginReport ('Top reviewers by employer (total %d)' % totalrevs)
|
BeginReport ('Top reviewers by employer (total %d)' % totalrevs)
|
||||||
for e in elist:
|
for e in elist:
|
||||||
scount = len (e.reviews)
|
scount = len (e.reviews)
|
||||||
if scount > 0:
|
if scount > 0:
|
||||||
ReportLine (e.name, scount, (scount*100.0)/totalrevs)
|
ReportLine (e.name, scount, (scount*100.0)/totalrevs)
|
||||||
|
reported += scount
|
||||||
count += 1
|
count += 1
|
||||||
if count >= ListCount:
|
if count >= ListCount:
|
||||||
break
|
break
|
||||||
EndReport ()
|
EndReport ('Covers %f%% of reviews' % ((reported*100.0)/totalrevs, ))
|
||||||
|
|
||||||
#
|
#
|
||||||
# tester reporting.
|
# tester reporting.
|
||||||
|
@ -262,16 +274,17 @@ def ReportByTests (hlist):
|
||||||
totaltests = 0
|
totaltests = 0
|
||||||
for h in hlist:
|
for h in hlist:
|
||||||
totaltests += len (h.tested)
|
totaltests += len (h.tested)
|
||||||
count = 0
|
count = reported = 0
|
||||||
BeginReport ('Developers with the most test credits (total %d)' % totaltests)
|
BeginReport ('Developers with the most test credits (total %d)' % totaltests)
|
||||||
for h in hlist:
|
for h in hlist:
|
||||||
scount = len (h.tested)
|
scount = len (h.tested)
|
||||||
if scount > 0:
|
if scount > 0:
|
||||||
ReportLine (h.name, scount, (scount*100.0)/totaltests)
|
ReportLine (h.name, scount, (scount*100.0)/totaltests)
|
||||||
|
reported += scount
|
||||||
count += 1
|
count += 1
|
||||||
if count >= ListCount:
|
if count >= ListCount:
|
||||||
break
|
break
|
||||||
EndReport ()
|
EndReport ('Covers %f%% of test credits' % ((reported*100.0)/totaltests, ))
|
||||||
|
|
||||||
def CompareTestCred (h1, h2):
|
def CompareTestCred (h1, h2):
|
||||||
return h2.testcred - h1.testcred
|
return h2.testcred - h1.testcred
|
||||||
|
@ -281,15 +294,16 @@ def ReportByTestCreds (hlist):
|
||||||
totaltests = 0
|
totaltests = 0
|
||||||
for h in hlist:
|
for h in hlist:
|
||||||
totaltests += h.testcred
|
totaltests += h.testcred
|
||||||
count = 0
|
count = reported = 0
|
||||||
BeginReport ('Developers who gave the most tested-by credits (total %d)' % totaltests)
|
BeginReport ('Developers who gave the most tested-by credits (total %d)' % totaltests)
|
||||||
for h in hlist:
|
for h in hlist:
|
||||||
if h.testcred > 0:
|
if h.testcred > 0:
|
||||||
ReportLine (h.name, h.testcred, (h.testcred*100.0)/totaltests)
|
ReportLine (h.name, h.testcred, (h.testcred*100.0)/totaltests)
|
||||||
|
reported += h.testcred
|
||||||
count += 1
|
count += 1
|
||||||
if count >= ListCount:
|
if count >= ListCount:
|
||||||
break
|
break
|
||||||
EndReport ()
|
EndReport ('Covers %f%% of test credits' % ((reported*100.0)/totaltests, ))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -304,16 +318,17 @@ def ReportByReports (hlist):
|
||||||
totalreps = 0
|
totalreps = 0
|
||||||
for h in hlist:
|
for h in hlist:
|
||||||
totalreps += len (h.reports)
|
totalreps += len (h.reports)
|
||||||
count = 0
|
count = reported = 0
|
||||||
BeginReport ('Developers with the most report credits (total %d)' % totalreps)
|
BeginReport ('Developers with the most report credits (total %d)' % totalreps)
|
||||||
for h in hlist:
|
for h in hlist:
|
||||||
scount = len (h.reports)
|
scount = len (h.reports)
|
||||||
if scount > 0:
|
if scount > 0:
|
||||||
ReportLine (h.name, scount, (scount*100.0)/totalreps)
|
ReportLine (h.name, scount, (scount*100.0)/totalreps)
|
||||||
|
report += scount
|
||||||
count += 1
|
count += 1
|
||||||
if count >= ListCount:
|
if count >= ListCount:
|
||||||
break
|
break
|
||||||
EndReport ()
|
EndReport ('Covers %f%% of report credits' % ((reported*100.0)/totalreps, ))
|
||||||
|
|
||||||
def CompareRepCred (h1, h2):
|
def CompareRepCred (h1, h2):
|
||||||
return h2.repcred - h1.repcred
|
return h2.repcred - h1.repcred
|
||||||
|
@ -323,15 +338,16 @@ def ReportByRepCreds (hlist):
|
||||||
totalreps = 0
|
totalreps = 0
|
||||||
for h in hlist:
|
for h in hlist:
|
||||||
totalreps += h.repcred
|
totalreps += h.repcred
|
||||||
count = 0
|
count = reported = 0
|
||||||
BeginReport ('Developers who gave the most report credits (total %d)' % totalreps)
|
BeginReport ('Developers who gave the most report credits (total %d)' % totalreps)
|
||||||
for h in hlist:
|
for h in hlist:
|
||||||
if h.repcred > 0:
|
if h.repcred > 0:
|
||||||
ReportLine (h.name, h.repcred, (h.repcred*100.0)/totalreps)
|
ReportLine (h.name, h.repcred, (h.repcred*100.0)/totalreps)
|
||||||
|
reported += h.repcred
|
||||||
count += 1
|
count += 1
|
||||||
if count >= ListCount:
|
if count >= ListCount:
|
||||||
break
|
break
|
||||||
EndReport ()
|
EndReport ('Covers %f%% of report credits' % ((reported*100.0)/totalreps, ))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -343,15 +359,16 @@ def ReportByESOBs (elist):
|
||||||
totalsobs = 0
|
totalsobs = 0
|
||||||
for e in elist:
|
for e in elist:
|
||||||
totalsobs += e.sobs
|
totalsobs += e.sobs
|
||||||
count = 0
|
count = reported = 0
|
||||||
BeginReport ('Employers with the most signoffs (total %d)' % totalsobs)
|
BeginReport ('Employers with the most signoffs (total %d)' % totalsobs)
|
||||||
for e in elist:
|
for e in elist:
|
||||||
if e.sobs > 0:
|
if e.sobs > 0:
|
||||||
ReportLine (e.name, e.sobs, (e.sobs*100.0)/totalsobs)
|
ReportLine (e.name, e.sobs, (e.sobs*100.0)/totalsobs)
|
||||||
|
reported += e.sobs
|
||||||
count += 1
|
count += 1
|
||||||
if count >= ListCount:
|
if count >= ListCount:
|
||||||
break
|
break
|
||||||
EndReport ()
|
EndReport ('Covers %f%% of signoffs' % ((reported*100.0)/totalsobs, ))
|
||||||
|
|
||||||
def CompareHackers (e1, e2):
|
def CompareHackers (e1, e2):
|
||||||
return len (e2.hackers) - len (e1.hackers)
|
return len (e2.hackers) - len (e1.hackers)
|
||||||
|
@ -361,16 +378,17 @@ def ReportByEHackers (elist):
|
||||||
totalhackers = 0
|
totalhackers = 0
|
||||||
for e in elist:
|
for e in elist:
|
||||||
totalhackers += len (e.hackers)
|
totalhackers += len (e.hackers)
|
||||||
count = 0
|
count = reported = 0
|
||||||
BeginReport ('Employers with the most hackers (total %d)' % totalhackers)
|
BeginReport ('Employers with the most hackers (total %d)' % totalhackers)
|
||||||
for e in elist:
|
for e in elist:
|
||||||
nhackers = len (e.hackers)
|
nhackers = len (e.hackers)
|
||||||
if nhackers > 0:
|
if nhackers > 0:
|
||||||
ReportLine (e.name, nhackers, (nhackers*100.0)/totalhackers)
|
ReportLine (e.name, nhackers, (nhackers*100.0)/totalhackers)
|
||||||
|
reported += nhackers
|
||||||
count += 1
|
count += 1
|
||||||
if count >= ListCount:
|
if count >= ListCount:
|
||||||
break
|
break
|
||||||
EndReport ()
|
EndReport ('Covers %f%% of hackers' % ((reported*100.0)/totalhackers, ))
|
||||||
|
|
||||||
|
|
||||||
def DevReports (hlist, totalchanged, cscount, totalremoved):
|
def DevReports (hlist, totalchanged, cscount, totalremoved):
|
||||||
|
|
Loading…
Reference in New Issue