fix(security): calculate compliance score from total scanned dependencies#930
Conversation
|
@stablegenius49 - please accept the CLA so that we can merge your PRs. |
|
@microsoft-github-policy-service agree |
…mpliance scoring
- scanner functions return @{ TotalCount; Violations } instead of flat arrays
- add mandatory TotalDependencies parameter to Get-ComplianceReportData
- add ValidateSet on DependencyViolation.Severity
- add CalculateScore() method to ComplianceReport class
- update all 118 Pester tests for new return format
Closes microsoft#929
🔧 - Generated by Copilot
|
Hey @stablegenius49, thank you for jumping on this one! Your PR correctly identified the root cause — scanner functions weren't tracking total dependencies, making I happened to be working the same fix in parallel on #931, so I merged a complementary approach into your branch that refactors the scanner functions to return Your original commit is preserved in the branch history. Appreciate the contribution — looking forward to more! |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #930 +/- ##
==========================================
+ Coverage 85.86% 85.88% +0.01%
==========================================
Files 27 27
Lines 5152 5159 +7
==========================================
+ Hits 4424 4431 +7
Misses 728 728
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
Summary
Get-ComplianceReportDataso compliance is based on scanned dependencies instead of violation countSeverity -ne 'Info'filter from unpinned countingNotes
Closes #929
Testing