Skip to content

feat: Implement Project Risk Scoring System (#273)#414

Merged
mijinummi merged 2 commits into
MDTechLabs:mainfrom
SharifIbrahimDev:issue-273-project-risk-scoring
May 29, 2026
Merged

feat: Implement Project Risk Scoring System (#273)#414
mijinummi merged 2 commits into
MDTechLabs:mainfrom
SharifIbrahimDev:issue-273-project-risk-scoring

Conversation

@SharifIbrahimDev
Copy link
Copy Markdown

Description

Implements a new ProjectRiskScorer class that aggregates individual findings from an analysis run into a single, project-level risk score. Closes #273.

What Changed

New Files

  • src/analysis/scoring/project-risk-scorer.ts — Core scoring class
  • src/analysis/scoring/project-risk-scorer.spec.ts — Full unit test coverage

Features

  • Overall score normalized to 0–100 with letter grade (AF) and risk level (low / medium / high / critical)
  • Severity breakdown — counts per Critical / High / Medium / Low / Info
  • Impact breakdown — counts across security, gas, performance, maintainability
  • Total gas savings aggregated across all findings
  • Top 5 findings ranked by score for immediate developer visibility
  • Actionable recommendations auto-generated based on findings (e.g. critical security alerts, gas optimisation tips)
  • Supports both raw Finding[] and standard AnalysisResult as input
  • Configurable normalizationCeiling and ScoringConfig via constructor options

Testing

All new logic is covered by the unit tests in project-risk-scorer.spec.ts.

Closes #273

@mijinummi mijinummi merged commit 8d792d2 into MDTechLabs:main May 29, 2026
1 of 5 checks passed
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.

📊 Project Risk Scoring System

2 participants