Skip to content

Commit a19fe1c

Browse files
committed
Default to normal severity when unspecified by advisory
Code Climate expects the severity to be one of the following values: "critical", "normal", or "info". This commit defaults the severity to "normal" when unspecified by the vulnerability advisory.
1 parent cf9b05f commit a19fe1c

File tree

2 files changed

+11
-11
lines changed

2 files changed

+11
-11
lines changed

lib/cc/engine/bundler_audit/unpatched_gem_issue.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ def remediation_points
6767
end
6868

6969
def severity
70-
SEVERITIES[advisory.criticality]
70+
SEVERITIES.fetch(advisory.criticality, "normal")
7171
end
7272

7373
def solution

spec/fixtures/unpatched_versions/issues.json

+10-10
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
"path": "Gemfile.lock"
1717
},
1818
"remediation_points": 50000,
19-
"severity": null,
19+
"severity": "normal",
2020
"type": "Issue"
2121
},
2222
{
@@ -36,7 +36,7 @@
3636
"path": "Gemfile.lock"
3737
},
3838
"remediation_points": 50000,
39-
"severity": null,
39+
"severity": "normal",
4040
"type": "Issue"
4141
},
4242
{
@@ -56,7 +56,7 @@
5656
"path": "Gemfile.lock"
5757
},
5858
"remediation_points": 50000,
59-
"severity": null,
59+
"severity": "normal",
6060
"type": "Issue"
6161
},
6262
{
@@ -76,7 +76,7 @@
7676
"path": "Gemfile.lock"
7777
},
7878
"remediation_points": 50000,
79-
"severity": null,
79+
"severity": "normal",
8080
"type": "Issue"
8181
},
8282
{
@@ -96,7 +96,7 @@
9696
"path": "Gemfile.lock"
9797
},
9898
"remediation_points": 50000,
99-
"severity": null,
99+
"severity": "normal",
100100
"type": "Issue"
101101
},
102102
{
@@ -116,7 +116,7 @@
116116
"path": "Gemfile.lock"
117117
},
118118
"remediation_points": 50000,
119-
"severity": null,
119+
"severity": "normal",
120120
"type": "Issue"
121121
},
122122
{
@@ -136,7 +136,7 @@
136136
"path": "Gemfile.lock"
137137
},
138138
"remediation_points": 5000000,
139-
"severity": null,
139+
"severity": "normal",
140140
"type": "Issue"
141141
},
142142
{
@@ -196,7 +196,7 @@
196196
"path": "Gemfile.lock"
197197
},
198198
"remediation_points": 500000,
199-
"severity": null,
199+
"severity": "normal",
200200
"type": "Issue"
201201
},
202202
{
@@ -216,7 +216,7 @@
216216
"path": "Gemfile.lock"
217217
},
218218
"remediation_points": 500000,
219-
"severity": null,
219+
"severity": "normal",
220220
"type": "Issue"
221221
},
222222
{
@@ -236,7 +236,7 @@
236236
"path": "Gemfile.lock"
237237
},
238238
"remediation_points": 5000000,
239-
"severity": null,
239+
"severity": "normal",
240240
"type": "Issue"
241241
}
242242
]

0 commit comments

Comments
 (0)