DSACMS / metrics

Experimentations in Open Source Repository Metrics
https://dsacms.github.io/metrics/
Other
6 stars 2 forks source link

Fix Error In Report Generation #119

Closed IsaacMilarky closed 3 months ago

IsaacMilarky commented 3 months ago

Fix Error in Report Generation

Problem

There is a missing set of parenthesis in the boolean logic in reports generation to determine whether a number is highlighted green or red. This was causing unintended behavior.

Below is an example of the unintended evaluation:

Screenshot 2024-04-09 at 1 27 36 PM

The problem is hard to spot at first; because of a missing set of parenthesis the inequality operator != was evaluating the numeral 0 instead of raw_diff > 0.

Solution

Add extra sets of parenthesis to this section of gen_reports.py.

Result

This will result in the desired colors being used to highlight report diffs.