[PHP] False positive on php:S2036 - Files that define symbols should not cause side-effects

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

[PHP] False positive on php:S2036 - Files that define symbols should not cause side-effects

David RACODON
Hi,

On the following code, from my understanding, the issue is raised against "require_once(...", correct?
If so, isn't it a false positive? If so, could you please handle this case?

Inline image 1

Thank you

Regards,

David RACODON
Freelance QA Consultant
Reply | Threaded
Open this post in threaded view
|

Re: [PHP] False positive on php:S2036 - Files that define symbols should not cause side-effects

Linda Martin
Hello,

It seems to me that the rule description is self-explanatory: http://nemo.sonarqube.org/coding_rules#rule_key=php%3AS2036.
Here is the origin of the rule (as its tag "psr1" indicates): http://www.php-fig.org/psr/psr-1/. See the paragraph 2.3 Side-effects.

If you think that this part of the PSR1 convention has been mis-interpreted, please explain.

Regards,

Linda.

On 6 May 2015 at 14:39, David Racodon <[hidden email]> wrote:
Hi,

On the following code, from my understanding, the issue is raised against "require_once(...", correct?
If so, isn't it a false positive? If so, could you please handle this case?

Inline image 1

Thank you

Regards,

David RACODON
Freelance QA Consultant

Reply | Threaded
Open this post in threaded view
|

Re: [PHP] False positive on php:S2036 - Files that define symbols should not cause side-effects

David RACODON
OK. Got it now.
Would that make sense to link to the PSR-1 documentation from the rule description?

David RACODON
Freelance QA Consultant

On Tue, May 19, 2015 at 10:46 AM, Linda Martin <[hidden email]> wrote:
Hello,

It seems to me that the rule description is self-explanatory: http://nemo.sonarqube.org/coding_rules#rule_key=php%3AS2036.
Here is the origin of the rule (as its tag "psr1" indicates): http://www.php-fig.org/psr/psr-1/. See the paragraph 2.3 Side-effects.

If you think that this part of the PSR1 convention has been mis-interpreted, please explain.

Regards,

Linda.

On 6 May 2015 at 14:39, David Racodon <[hidden email]> wrote:
Hi,

On the following code, from my understanding, the issue is raised against "require_once(...", correct?
If so, isn't it a false positive? If so, could you please handle this case?

Inline image 1

Thank you

Regards,

David RACODON
Freelance QA Consultant