About the author of an issue raised by "javascript: S2814"

  • which versions are you using (SonarQube, Scanner, Plugin, and any relevant extension)

  • Community Edition Version 7.3 (build 15553).

  • sonar-scanner-engine-shaded-7.3-all.jar

  • sonar-javascript-plugin-5.2.1.7778.jar

  • Confirmation of specifications

  • I confirmed the actual operation


I want to check the specifications.

I’m using SonarQube Community Edition Version 7.3 (build 15553).

JavaScript analysis result Code Smell was pointed out.

(line 635)
Rename “j” as this name is already used in declaration at line 340.

Author on line 635 is Amy.
The Author of the duplicate target line 340 is Mike.

However, in chronological order, Amy created it first. Created by Mike a few months later.

Amy is in charge of pointing out despite the duplication that occurred when Mike created it.
I think Mike should be in charge.

Will this be a specification?

Hi,

Welcome to the community!

The ‘author’ of an issue is the last committer on the line the issue was raised on. So yours is really a question of where the issue is raised. It was raised on the 2nd instance in the file (the one with the higher line number) and you think it should have been raised on the one that was added last (chronologically).

On the face of it, it’s a reasonable expectation, but rules run & raise issues without any access to blame data - i.e. the rule doesn’t know which declaration came last chronologically; it can only know which came last in the file. And changing that isn’t feasible. (one reason of several is that blame data isn’t always available).

 
HTH,
Ann

Hi,

Thank you for answering.
I understood that it was a specification.

kenta