Skip to content

Remove dead SafeDivide overload and unreachable top-product branch #606

Closed

Description

@StuartFerguson

Summary

Remove two branches in EstateReportingAPI.BusinessLogic/ReportingManager.cs that are not reachable through the current production code paths:

  1. Integer SafeDivide overload (around lines 555–560)

    • The integer overload has no callers.
    • The reporting manager only uses the decimal overload.
  2. Null top-product branch (around line 2127)

    • BuildTopProductMetric is only called after grouped transactions have been confirmed non-empty.
    • FirstOrDefault() therefore cannot return null for the supplied list.
    • Remove the redundant null branch, or simplify the method so the control flow reflects the invariant.

Acceptance criteria

  • Remove the unused integer SafeDivide overload.
  • Remove or simplify the unreachable null top-product branch.
  • Preserve existing report behaviour.
  • Run the business-logic unit tests and API tests.
  • Confirm coverage and build remain clean.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions