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