Skip to content

refactor: typing for pillar scores#51

Merged
cdklabs-automation merged 4 commits intomainfrom
behuang/refactor_typing_pillar_score
Nov 20, 2025
Merged

refactor: typing for pillar scores#51
cdklabs-automation merged 4 commits intomainfrom
behuang/refactor_typing_pillar_score

Conversation

@huang-benny
Copy link
Contributor

Replaced generic Record<string, number> with a strongly typed PillarScores interface to improve type safety and code clarity.

Changes

  • Created PillarScores interface with explicit properties for MAINTENANCE, QUALITY, and POPULARITY
  • Applied Readonly to the public API (ScoreResult.pillarScores) while keeping internal operations mutable
  • Added helper methods (updateSignalScore, updatePillarScore) directly into calculateSignalScores
  • Simplified normalizePillarScores to normalize all pillars in a single function
  • Refactored getSignalWeights to use Object.fromEntries and map
  • Simplified calculateTotalScore by removing unnecessary checks
  • Moved ScoreResult interface from analyzer.ts to types.ts

There are no changes to the CLI input or output.

Copy link
Contributor

@kaizencc kaizencc left a comment

Choose a reason for hiding this comment

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

nice. no additional hardcoding happens in this refactor, you are just pulling out the pillars into an enum so they can be easily referenced elsewhere

@cdklabs-automation cdklabs-automation added this pull request to the merge queue Nov 20, 2025
Merged via the queue into main with commit d29efc8 Nov 20, 2025
7 checks passed
@cdklabs-automation cdklabs-automation deleted the behuang/refactor_typing_pillar_score branch November 20, 2025 15:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants