Skip to content

Zero division error #63

@GoogleCodeExporter

Description

@GoogleCodeExporter
What steps will reproduce the problem?

Below steps cannot be directly reproduced since the project it was measured by 
gitinspector is proprietary.

1. Clone gitinspector.
2. Run gitinspector with following options:
python gitinspector/gitinspector.py  --format=htmlembedded 
--localize-output=true --file-types=java,xml,js,properties 
../proprietary-project/ > stats.html

What is the expected output? What do you see instead?

Expected output: generated stats.html file for proprietary-project repository.
Instead ZeroDivisionError was encountered:

Traceback (most recent call last):
  File "gitinspector/gitinspector.py", line 194, in <module>
    main()
  File "gitinspector/gitinspector.py", line 182, in main
    __run__.output()
  File "gitinspector/gitinspector.py", line 76, in output
    outputable.output(blame.BlameOutput(self.hard, self.useweeks))
  File "/home/karma/git/gitinspector/gitinspector/outputable.py", line 36, in output
    outputable.output_html()
  File "/home/karma/git/gitinspector/gitinspector/blame.py", line 243, in output_html
    blame_xml += "<td>" + ("{0:.1f}".format(Blame.get_stability(entry[0], entry[1].rows, self.changes)) + "</td>")
  File "/home/karma/git/gitinspector/gitinspector/blame.py", line 175, in get_stability
    return 100.0 * blamed_rows / changes.get_authorinfo_list()[author].insertions
ZeroDivisionError: float division by zero


Please use labels and text to provide additional information.

If submitting a patch, you guarantee that you are the original author of
the work or that the patch is based on code from a compatible license.

Original issue reported on code.google.com by kamila.chyla on 15 Apr 2015 at 6:17

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions