Fix disagreement percentage calculation

Previously, a disagreement was defined as a core reviewer giving a
negative vote after the person had given a positive vote.  The
percentage was then the number of disagreements / all positive votes.

Later, disagreements were extended to cover the opposite case: when a
core member gives a positive vote after a person had given a negative
vote.

The percentage calculation was not updated to reflect this new
definition.  It still showed disagreements as a percentage of the
positive votes, instead of all of them (+ and -).

Change-Id: I6392055e5d95dfece86cdd427f44e258566e771a
This commit is contained in:
Russell Bryant 2013-11-21 01:34:36 -05:00
parent 4e7cc8666e
commit 19b0841eb1

View File

@ -210,11 +210,13 @@ def main(argv=None):
name = '%s%s' % (v, ' **' if in_core_team else '')
plus = float(k['votes']['2'] + k['votes']['1'])
minus = float(k['votes']['-2'] + k['votes']['-1'])
ratio = ((plus / (plus + minus)) * 100) if plus + minus > 0 else 0
all_reviews = plus + minus
ratio = ((plus / (all_reviews)) * 100) if all_reviews > 0 else 0
r = (k['total'], k['votes']['-2'],
k['votes']['-1'], k['votes']['1'],
k['votes']['2'], k['votes']['A'], "%5.1f%%" % ratio)
dratio = ((float(k['disagreements']) / plus) * 100) if plus else 0.0
dratio = (((float(k['disagreements']) / all_reviews) * 100)
if all_reviews else 0.0)
d = (k['disagreements'], "%5.1f%%" % dratio)
sratio = ((float(k['total']) / k['received']) * 100
if k['received'] else 0)