False positive for php:S2037 "Static members should be referenced with "static::"

49 views
Skip to first unread message

Gabriele Santini

unread,
Dec 1, 2015, 10:26:55 AM12/1/15
to SonarQube
Hi, I think there is a problems with this rule.

I get a report even if the class including the static reference is declared "final".
For me this is a false positive, as in this case you cannot distinguish between the use of "self" and of "static".

Pierre-Yves Nicolas

unread,
Dec 4, 2015, 7:56:56 AM12/4/15
to Gabriele Santini, SonarQube
Hi Gabriele,

Your suggestion seems reasonable.
We should probably also filter out cases where the called method is declared as final, don't you think?

Regards,
Pierre-Yves

--
You received this message because you are subscribed to the Google Groups "SonarQube" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sonarqube+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/sonarqube/fc82a4ff-1a2e-4ecc-abf2-db0b5329e4f6%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Gabriele Santini

unread,
Dec 6, 2015, 12:34:34 PM12/6/15
to SonarQube, gab.s...@gmail.com
Hi Pierre-Yves,

Yes definitely. 

Thank you for hearing :)

Pierre-Yves Nicolas

unread,
Dec 7, 2015, 4:20:26 AM12/7/15
to Gabriele Santini, SonarQube
Hi Gabriele,

I created the following ticket:
https://jira.sonarsource.com/browse/SONARPHP-598

Thanks!

Pierre-Yves

Reply all
Reply to author
Forward
0 new messages