@@ -295,11 +295,11 @@ newtype TCodeIndentifierDeviation =
295295 } or
296296 TMultiLineDeviation (
297297 DeviationRecord record , DeviationBegin beginComment , DeviationEnd endComment , string filepath ,
298- int suppressedStartLine , int suppressedEndLine
298+ int suppressedStartLine , int suppressedEndLine , int suppressedEndColumn
299299 ) {
300300 isDeviationRangePaired ( record , beginComment , endComment ) and
301301 beginComment .getLocation ( ) .hasLocationInfo ( filepath , suppressedStartLine , _, _, _) and
302- endComment .getLocation ( ) .hasLocationInfo ( filepath , suppressedEndLine , _, _ , _ )
302+ endComment .getLocation ( ) .hasLocationInfo ( filepath , _ , _, suppressedEndLine , suppressedEndColumn )
303303 } or
304304 TCodeIdentifierDeviation ( DeviationRecord record , DeviationAttribute attribute ) {
305305 attribute .getADeviationRecord ( ) = record
@@ -310,7 +310,7 @@ class CodeIdentifierDeviation extends TCodeIndentifierDeviation {
310310 DeviationRecord getADeviationRecord ( ) {
311311 this = TSingleLineDeviation ( result , _, _, _)
312312 or
313- this = TMultiLineDeviation ( result , _, _, _, _, _)
313+ this = TMultiLineDeviation ( result , _, _, _, _, _, _ )
314314 or
315315 this = TCodeIdentifierDeviation ( result , _)
316316 }
@@ -321,18 +321,27 @@ class CodeIdentifierDeviation extends TCodeIndentifierDeviation {
321321 bindingset [ e]
322322 pragma [ inline_late]
323323 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 , _, _)
326327 |
327328 exists ( int suppressedLine |
328329 this = TSingleLineDeviation ( _, _, filepath , suppressedLine ) and
329330 suppressedLine = elementLocationStart
330331 )
331332 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
335340 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
336345 )
337346 )
338347 or
@@ -362,9 +371,8 @@ class CodeIdentifierDeviation extends TCodeIndentifierDeviation {
362371 endcolumn = getLastColumnNumber ( filepath , suppressedLine )
363372 )
364373 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
368376 or
369377 exists ( DeviationAttribute attribute |
370378 this = TCodeIdentifierDeviation ( _, attribute ) and
@@ -384,11 +392,13 @@ class CodeIdentifierDeviation extends TCodeIndentifierDeviation {
384392 suppressedLine
385393 )
386394 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
389399 result =
390400 "Deviation of " + getADeviationRecord ( ) .getQuery ( ) + " applied to " + filepath + " Line " +
391- suppressedStartLine + ":" + suppressedEndLine
401+ suppressedStartLine + ":" + suppressedEndLine + " (Column " + suppressedEndColumn + ")"
392402 )
393403 )
394404 or
0 commit comments