Skip to content

Commit 03f863d

Browse files
committed
Move remediation points to constants
1 parent a23ad28 commit 03f863d

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

lib/cc/engine/bundler_audit/remediation.rb

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,12 @@ module CC
22
module Engine
33
module BundlerAudit
44
class Remediation
5+
MAJOR_UPGRADE_POINTS = 50_000_000
6+
MINOR_UPGRADE_POINTS = 5_000_000
7+
PATCH_UPGRADE_POINTS = 500_000
8+
UNPATCHED_VERSION_POINTS = 500_000_000
9+
10+
511
def initialize(gem_version, patched_versions)
612
@gem_version = gem_version
713
@patched_versions = patched_versions
@@ -12,15 +18,15 @@ def points
1218
upgrade_versions.map do |upgrade_version|
1319
case
1420
when current_version.major != upgrade_version.major
15-
50_000_000
21+
MAJOR_UPGRADE_POINTS
1622
when current_version.minor != upgrade_version.minor
17-
5_000_000
23+
MINOR_UPGRADE_POINTS
1824
when current_version.tiny != upgrade_version.tiny
19-
500_000
25+
PATCH_UPGRADE_POINTS
2026
end
2127
end.min
2228
else
23-
500_000_000
29+
UNPATCHED_VERSION_POINTS
2430
end
2531
end
2632

0 commit comments

Comments
 (0)