Skip to content

Fix ValueError when APK score is negative#761

Merged
haeter525 merged 1 commit into
ev-flow:masterfrom
haeter525:fix_valueerror_with_negative_apk_score
Jun 8, 2025
Merged

Fix ValueError when APK score is negative#761
haeter525 merged 1 commit into
ev-flow:masterfrom
haeter525:fix_valueerror_with_negative_apk_score

Conversation

@haeter525

@haeter525 haeter525 commented Jun 7, 2025

Copy link
Copy Markdown
Member

Close #760

When an APK receives a score higher than the total rule score or below zero, Weight.calculate() raises a ValueError, which causes issue #760. This PR enhances Weight.calculate() to handle APK scores in these two cases:

  • If an APK receives scores higher than the total rule score, Weight.calculate() now categorizes it as high-risk.
  • If an APK receives scores below zero, Weight.calculate() now categorizes it as low-risk.

@haeter525 haeter525 force-pushed the fix_valueerror_with_negative_apk_score branch from cfee6d0 to 29f04ad Compare June 7, 2025 01:35
@codecov

codecov Bot commented Jun 7, 2025

Copy link
Copy Markdown

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 80.65%. Comparing base (d4493b3) to head (29f04ad).
Report is 1 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #761      +/-   ##
==========================================
- Coverage   80.68%   80.65%   -0.04%     
==========================================
  Files          75       75              
  Lines        6253     6243      -10     
==========================================
- Hits         5045     5035      -10     
  Misses       1208     1208              
Flag Coverage Δ
unittests 80.65% <100.00%> (-0.04%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@pulorsok pulorsok left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM

@haeter525 haeter525 merged commit 49c75e5 into ev-flow:master Jun 8, 2025
19 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ValueError when analyzing non-malicious APKs with new rule weights

2 participants