Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions calculator.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,3 +38,13 @@ def process_scores(scores: list[int]) -> dict:
"average": sum(scores) / len(scores),
"max": max(scores),
}


def multiply(a, b):
return a * b
Comment on lines +43 to +44

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Logic duplication: multiply is already defined at line 29 with type annotations (a: int, b: int) -> int). In Python the last definition wins, so the typed version is now dead code — callers silently get this untyped one. Remove this definition (the one at line 29 is the right one to keep).

  • Mark as noise



def divide(a, b):
if b == 0:
raise ValueError("Cannot divide by zero")
return a / b
Comment on lines +47 to +50

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Logic duplication: divide is already defined at line 9 with type annotations (a: float, b: float) -> float) and identical zero-division logic. This definition shadows it, making the typed version dead code. Remove this duplicate.

Missing test coverage: Whichever divide survives has no tests for either the happy path or the zero-division guard. A regression (e.g. the guard being dropped) would go undetected. Add at least: assert divide(6, 2) == 3 and a check that divide(1, 0) raises ValueError.

  • Mark as noise

Loading