@@ -2,11 +2,11 @@ module CC
2
2
module Engine
3
3
module BundlerAudit
4
4
class Issue
5
- GEM_REGEX = /^\s *(?<name>\S +) \( [\d .]+\) / . freeze
5
+ GEM_REGEX = /^\s *(?<name>\S +) \( [\d .]+\) /
6
6
SEVERITIES = {
7
7
high : "critical" ,
8
8
medium : "normal" ,
9
- low : "info" ,
9
+ low : "info"
10
10
} . freeze
11
11
12
12
def initialize ( result , gemfile_lock_lines )
@@ -17,7 +17,7 @@ def initialize(result, gemfile_lock_lines)
17
17
18
18
def to_json ( *a )
19
19
{
20
- categories : [ " Security" ] ,
20
+ categories : %w[ Security ] ,
21
21
check_name : "Insecure Dependency" ,
22
22
content : {
23
23
body : content_body
@@ -32,7 +32,7 @@ def to_json(*a)
32
32
} ,
33
33
remediation_points : remediation_points ,
34
34
severity : severity ,
35
- type : "Issue" ,
35
+ type : "Issue"
36
36
} . to_json ( a )
37
37
end
38
38
@@ -45,15 +45,15 @@ def content_body
45
45
"**Advisory**: #{ identifier } " ,
46
46
"**Criticality**: #{ advisory . criticality . capitalize } " ,
47
47
"**URL**: #{ advisory . url } " ,
48
- "**Solution**: #{ solution } " ,
48
+ "**Solution**: #{ solution } "
49
49
] . join ( "\n \n " )
50
50
end
51
51
52
52
def line_number
53
53
@line_number ||= begin
54
- gemfile_lock_lines . find_index do |line |
55
- ( match = GEM_REGEX . match ( line ) ) && match [ :name ] == gem . name
56
- end + 1
54
+ gemfile_lock_lines . find_index do |line |
55
+ ( match = GEM_REGEX . match ( line ) ) && match [ :name ] == gem . name
56
+ end + 1
57
57
end
58
58
end
59
59
0 commit comments