Using SonarQube Enterprise Edition Version 8.9.10 (build 61524) and sonar-scanner-4.7.0.2747-linux
After restructuring an existing project (use shared components via symlinks) it is reported that the branch has no line of code.
Previous C++ project structure:
MyRepository
| MyProject
| | 3rdparty
| | application
| | hw
| | os
| | …
| | sonar-project.properties
The 3rdparty code was excluded by “Sonar.exclusions=3rdparty/**”
There were no explicite sonar.inclusions or sonar.sources specified.
With this as expected all the code within application, hw, os, … was scanned.
The current C++ project structure has changed to:
MyRepository
| 3rdparty
| component
| | hw
| | os
| | …
| platform
| | MyProject
| | | application
| | | 3rdparty → …/…/…/3rdparty
| | | component
| | | | hw → …/…/…/component/hw
| | | | os → …/…/…/component/os
| | | | …
| | | sonar-project.properties
With the same settings in sonar-project.properties now only the code in MyProject/application can be scanned, this is the part which is not invoked by symlinks. The code in hw and os which was scanned before is now no longer visible. The build itself is successful that means the symlinks are correct.
I tried a couple of workarounds with both sonar.sources and sonar.inclusions but nothing worked as expected.
When I specify
sonar.souces=application,component/hw/
even the code in application is no longer visible, there is no line of code in the whole project which can be found.
When I specify
sonar.inclusions=component/hw/**
nothing changes.
I have to admit, now I’m a little lost - how can I scan the code behind a symlink?
Regards,
Hubert