Skip to content

Commit

Permalink
Apply review suggestions
Browse files Browse the repository at this point in the history
  • Loading branch information
PromiseFru committed Feb 1, 2024
1 parent e9c0f50 commit 27d55c4
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions bugbot/rules/performancebug.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,13 @@

class PerformanceBug(BzCleaner):
def __init__(self, confidence_threshold: float = 0.9):
"""
Initialize the PerformanceBug class.
Args:
confidence_threshold: The confidence threshold for
considering a bug as a performance bug.
"""
super().__init__()
self.confidence_threshold = confidence_threshold

Expand Down Expand Up @@ -63,13 +70,9 @@ def get_bugs(self, date="today", bug_ids=[]):
"id": bug_id,
"summary": bug["summary"],
"confidence": nice_round(prob[1]),
"autofixed": False,
"autofixed": prob[1] >= self.confidence_threshold,
}

# Only autofix results for which we are sure enough.
if prob[1] >= self.confidence_threshold:
results[bug_id]["autofixed"] = True

return results


Expand Down

0 comments on commit 27d55c4

Please sign in to comment.