Changing location of issue - Impact on issues flagged as FP

Hello,

I have a couple rules for a custom language in which I would like to change the issue location, making it more precise. What is currently highlighted by the rule is the entire line of the statement, and I would like to highlight only a specific keyword (which is more interesting for the developer).
Can I expect that all issues flagged as FP or Won’t Fix won’t be affected by the new location ?

message substring("xxx", 1). // Entire line was highlighted, after the change it will only be 'substring'
message  // This line was highlighted (that was dumb), after the change it will only be 'substring' on the next line
    substring("xxx", 1).

Gilles

Hey @gquerret

The issue-tracking algorithm will take the following into account (documented here):

  • If the issue is on the same rule, with the same line number and with the same line hash (but not necessarily with the same message) : MATCH
  • Detect block move inside the file, then if the issue is on the same (moved) line and on the same rule (but not necessarily with the same message) : MATCH
  • On the same rule, with the same message and with the same line hash (but not necessarily with the same line) : MATCH
  • On the same rule, with the same message and with the same line number (but not necessarily with the same line hash) : MATCH
  • On the same rule and with the same line hash (but not the same message and not the same line) : MATCH
  • Is there a matching CLOSED issue : MATCH and Reopen

Closed here does not mean marked as false-positive/won’t fix, but as Fixed/Removed.

So you should be fine if the following conditions kick in:

  • On the same rule, with the same message and with the same line hash (but not necessarily with the same line) : MATCH
  • On the same rule and with the same line hash (but not the same message and not the same line) : MATCH

Thank you @Colin, that was exactly what I was looking for. And this means it will be safe to change the location of the issues in my specific case.
Best wishes for 2024 !
Gilles

1 Like

Back at you! :partying_face:

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.