code-base-investigator icon indicating copy to clipboard operation
code-base-investigator copied to clipboard

Refactor setmap into an object

Open Pennycook opened this issue 1 year ago • 0 comments

Feature/behavior summary

The concept of a "setmap" is littered throughout the code. The type of each setmap is defaultdict[frozenset[str, int], int], and it's not really obvious how to interpret the information it stores. The functionality used to determine which platforms are in a setmap, count the number of SLOC, etc, is spread out across utility functions.

Request attributes

  • [X] Would this be a refactor of existing code?
  • [ ] Does this proposal require new package dependencies?
  • [X] Would this change break backwards compatibility?

Related issues

No response

Solution description

We should design an implement an object that encapsulates the setmap and exposes the utility functions as members.

Additional notes

Given a setmap, it is currently possible to query the number of lines associated with a given platform set, but it is not possible to query which lines belong to which set. We should consider whether it makes sense to replace the setmap with something like a Coverage object that stores more information, but this should wait until after #41 is merged.

Pennycook avatar Dec 09 '24 11:12 Pennycook