test: add multiply and divide functions - #38
Conversation
SummaryAdds two basic calculator functions to the module: Note: The PR description mentions "testing telemetry event publishing," but the actual diff shows only the two new functions with no telemetry instrumentation. Reviewers may want to clarify whether telemetry logging is expected here or handled elsewhere. What reviewers should knowQuick scan:
Minor style note: For telemetry reviewers:
|
SonarQube reviewer guide
|
| def multiply(a, b): | ||
| return a * b |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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




Summary
multiplyanddividefunctions to calculator module🤖 Generated with Claude Code