@@ -36,13 +36,13 @@ module CC::Engine::Analyzers
36
36
"path" => "foo.go" ,
37
37
"lines" => { "begin" => 6 , "end" => 6 } ,
38
38
} )
39
- expect ( json [ "remediation_points" ] ) . to eq ( 820_000 )
39
+ expect ( json [ "remediation_points" ] ) . to eq ( 500_000 )
40
40
expect ( json [ "other_locations" ] ) . to eq ( [
41
41
{ "path" => "foo.go" , "lines" => { "begin" => 7 , "end" => 7 } } ,
42
42
] )
43
43
expect ( json [ "content" ] [ "body" ] ) . to match ( /This issue has a mass of 16/ )
44
44
expect ( json [ "fingerprint" ] ) . to eq ( "484ee5799eb0e6c933751cfa85ba33c3" )
45
- expect ( json [ "severity" ] ) . to eq ( CC ::Engine ::Analyzers ::Base ::MAJOR )
45
+ expect ( json [ "severity" ] ) . to eq ( CC ::Engine ::Analyzers ::Base ::MINOR )
46
46
end
47
47
48
48
it "prints an issue for similar code" do
@@ -82,7 +82,7 @@ module CC::Engine::Analyzers
82
82
"path" => "foo.go" ,
83
83
"lines" => { "begin" => 5 , "end" => 7 } ,
84
84
} )
85
- expect ( json [ "remediation_points" ] ) . to eq ( 1_540_000 )
85
+ expect ( json [ "remediation_points" ] ) . to eq ( 1_220_000 )
86
86
expect ( json [ "other_locations" ] ) . to eq ( [
87
87
{ "path" => "foo.go" , "lines" => { "begin" => 9 , "end" => 11 } } ,
88
88
{ "path" => "foo.go" , "lines" => { "begin" => 13 , "end" => 15 } } ,
@@ -129,14 +129,48 @@ module CC::Engine::Analyzers
129
129
130
130
it "does not flag duplicate comments" do
131
131
create_source_file ( "foo.go" , <<-EOGO )
132
+ // This is a comment.
133
+ // This is a comment.
134
+ // This is a comment.
135
+ // This is also a comment.
136
+ // This is also a comment.
137
+
132
138
package main
133
139
140
+ func main() {
141
+ }
142
+
143
+ /* This is a multiline comment */
144
+ /* This is a multiline comment */
145
+ /* This is a also multiline comment */
146
+ /* This is a also multiline comment */
147
+
148
+ // func add(x int, y int) int {
149
+ // return x + y
150
+ // }
151
+
152
+ // func add(x int, y int) int {
153
+ // return x + y
154
+ // }
155
+
156
+ // func add(x int, y int) int {
157
+ // return x + y
158
+ // }
159
+
160
+ // func add(x int, y int) int {
161
+ // return x + y
162
+ // }
163
+ EOGO
164
+
165
+ create_source_file ( "bar.go" , <<-EOGO )
134
166
// This is a comment.
135
167
// This is a comment.
136
168
// This is a comment.
137
169
// This is also a comment.
138
170
// This is also a comment.
139
171
172
+ package main
173
+
140
174
func main() {
141
175
}
142
176
@@ -178,7 +212,7 @@ def engine_conf
178
212
} ,
179
213
'languages' => {
180
214
'go' => {
181
- 'mass_threshold' => 3 ,
215
+ 'mass_threshold' => 11 ,
182
216
} ,
183
217
} ,
184
218
} ,
0 commit comments