@@ -295,11 +295,11 @@ newtype TCodeIndentifierDeviation =
295
295
} or
296
296
TMultiLineDeviation (
297
297
DeviationRecord record , DeviationBegin beginComment , DeviationEnd endComment , string filepath ,
298
- int suppressedStartLine , int suppressedEndLine
298
+ int suppressedStartLine , int suppressedEndLine , int suppressedEndColumn
299
299
) {
300
300
isDeviationRangePaired ( record , beginComment , endComment ) and
301
301
beginComment .getLocation ( ) .hasLocationInfo ( filepath , suppressedStartLine , _, _, _) and
302
- endComment .getLocation ( ) .hasLocationInfo ( filepath , suppressedEndLine , _, _ , _ )
302
+ endComment .getLocation ( ) .hasLocationInfo ( filepath , _ , _, suppressedEndLine , suppressedEndColumn )
303
303
} or
304
304
TCodeIdentifierDeviation ( DeviationRecord record , DeviationAttribute attribute ) {
305
305
attribute .getADeviationRecord ( ) = record
@@ -310,7 +310,7 @@ class CodeIdentifierDeviation extends TCodeIndentifierDeviation {
310
310
DeviationRecord getADeviationRecord ( ) {
311
311
this = TSingleLineDeviation ( result , _, _, _)
312
312
or
313
- this = TMultiLineDeviation ( result , _, _, _, _, _)
313
+ this = TMultiLineDeviation ( result , _, _, _, _, _, _ )
314
314
or
315
315
this = TCodeIdentifierDeviation ( result , _)
316
316
}
@@ -321,18 +321,27 @@ class CodeIdentifierDeviation extends TCodeIndentifierDeviation {
321
321
bindingset [ e]
322
322
pragma [ inline_late]
323
323
predicate isElementMatching ( Element e ) {
324
- exists ( string filepath , int elementLocationStart |
325
- e .getLocation ( ) .hasLocationInfo ( filepath , elementLocationStart , _, _, _)
324
+ exists ( string filepath , int elementLocationStart , int elementLocationColumnStart |
325
+ e .getLocation ( )
326
+ .hasLocationInfo ( filepath , elementLocationStart , elementLocationColumnStart , _, _)
326
327
|
327
328
exists ( int suppressedLine |
328
329
this = TSingleLineDeviation ( _, _, filepath , suppressedLine ) and
329
330
suppressedLine = elementLocationStart
330
331
)
331
332
or
332
- exists ( int suppressedStartLine , int suppressedEndLine |
333
- this = TMultiLineDeviation ( _, _, _, filepath , suppressedStartLine , suppressedEndLine ) and
334
- suppressedStartLine < elementLocationStart and
333
+ exists ( int suppressedStartLine , int suppressedEndLine , int suppressedEndColumn |
334
+ this =
335
+ TMultiLineDeviation ( _, _, _, filepath , suppressedStartLine , suppressedEndLine ,
336
+ suppressedEndColumn ) and
337
+ suppressedStartLine < elementLocationStart
338
+ |
339
+ // Element starts before the end line of the suppression
335
340
suppressedEndLine > elementLocationStart
341
+ or
342
+ // Element exists on the same line as the suppression, and occurs before it
343
+ suppressedEndLine = elementLocationStart and
344
+ elementLocationColumnStart < suppressedEndColumn
336
345
)
337
346
)
338
347
or
@@ -362,9 +371,8 @@ class CodeIdentifierDeviation extends TCodeIndentifierDeviation {
362
371
endcolumn = getLastColumnNumber ( filepath , suppressedLine )
363
372
)
364
373
or
365
- this = TMultiLineDeviation ( _, _, _, filepath , suppressedLine , endline ) and
366
- suppressedColumn = 1 and
367
- endcolumn = 1
374
+ this = TMultiLineDeviation ( _, _, _, filepath , suppressedLine , endline , endcolumn ) and
375
+ suppressedColumn = 1
368
376
or
369
377
exists ( DeviationAttribute attribute |
370
378
this = TCodeIdentifierDeviation ( _, attribute ) and
@@ -384,11 +392,13 @@ class CodeIdentifierDeviation extends TCodeIndentifierDeviation {
384
392
suppressedLine
385
393
)
386
394
or
387
- exists ( int suppressedStartLine , int suppressedEndLine |
388
- this = TMultiLineDeviation ( _, _, _, filepath , suppressedStartLine , suppressedEndLine ) and
395
+ exists ( int suppressedStartLine , int suppressedEndLine , int suppressedEndColumn |
396
+ this =
397
+ TMultiLineDeviation ( _, _, _, filepath , suppressedStartLine , suppressedEndLine ,
398
+ suppressedEndColumn ) and
389
399
result =
390
400
"Deviation of " + getADeviationRecord ( ) .getQuery ( ) + " applied to " + filepath + " Line " +
391
- suppressedStartLine + ":" + suppressedEndLine
401
+ suppressedStartLine + ":" + suppressedEndLine + " (Column " + suppressedEndColumn + ")"
392
402
)
393
403
)
394
404
or
0 commit comments