mirror of
https://github.com/ejwa/gitinspector.git
synced 2024-09-28 18:31:30 +02:00
Prevent ZeroDivisionError in get_stability method (Fixes #63).
Signed-off-by: Adam Waldenberg <adam.waldenberg@ejwa.se>
This commit is contained in:
parent
30a20e6b52
commit
96e2b0fdf0
@ -172,8 +172,8 @@ class Blame:
|
||||
@staticmethod
|
||||
def get_stability(author, blamed_rows, changes):
|
||||
if author in changes.get_authorinfo_list():
|
||||
return 100.0 * blamed_rows / changes.get_authorinfo_list()[author].insertions
|
||||
|
||||
author_insertions = changes.get_authorinfo_list()[author].insertions
|
||||
return 100 if author_insertions == 0 else 100.0 * blamed_rows / author_insertions
|
||||
return 100
|
||||
|
||||
@staticmethod
|
||||
|
Loading…
Reference in New Issue
Block a user