i am having some issues whereby code are being analysed if copied over to app/code folder but not under my vendor folder.
I did include my “vendor/module” folder to the sources folder ( Settings>Directories) but it is still not working.
Any ideas or suggestions how to resolve this please?
Hello, welcome to the community! And thank you for your question.
This is the default behavior of our PHP analyzer: any directory named
vendor is ignored, since for most project, this is where
composer puts 3rd party dependencies - and our reasoning is that raising issues on 3rd party code would be noise for most projects.
This behavior is configured through analysis property
sonar.php.exclusions, which has a default value of
**/vendor/**, and can be overridden in the IDE settings:
If I understand correctly, in your project (is this a Magento project?), you want to analyze the contents of (at least)
vendor/module. In my screenshot above, I put a value of
<nothing> which will result in all PHP files being analyzed.
This is probably not what you want for your project, and you might need to adjust the value of
sonar.php.exclusions to suit your needs - see this SonarQube documentation page for the expected format.
Thank you [Jean-Baptiste Lievremont]
Yes you guessed it right, it is a Magento project. We use composer and we will be developing our own modules under our own folder “/vendor/ myvendor ”.
I will try your suggestions and get back.
i have used the analysis properties you suggested itself and its working ok now
I could not find any other ways of doing it, i tried the sonar.sources to point it to my particular vendor directory also does not work.
This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.