Hi,
I am the maintainer of the Checksyle plugin (GitHub - checkstyle/sonar-checkstyle: Support on Checkstyle in SonarQube. Officially transfered from https://github.com/SonarQubeCommunity/sonar-checkstyle) and I recently tried to migrate off all deprecated APIs when migrating from API v7 to API v9.
In the course of that, I have found org.sonar.api.batch.ScannerSide
(ScannerSide (plugin-api 10.7.0.2191 API)) to be deprecated and replaced with org.sonar.api.scanner.ScannerSide
(ScannerSide (plugin-api 10.7.0.2191 API)).
Shortly after, we received bug reports regarding multi-module projects and a massive slowdown of the analysis (see Slow checkstyle analyse on 10.14.2 · Issue #510 · checkstyle/sonar-checkstyle · GitHub).
Troubleshooting currently points to a change of the injected FileSystem
(FileSystem (sonar-plugin-api 8.9)), in particular the workdir method now returning a different path.
With org.sonar.api.batch.ScannerSide
, the workdir was the respective submodule directory of a multi-module project. With the change to the new annotation org.sonar.api.scanner.ScannerSide
this is now the project directory (= root directory of the multi-module project).
This change of paths seems to result in scanning the entire codebase over and over multiple times = for each module the workdir is the root directory and the scan analyses all files/modules instead of only the module itself.
Hence, the analysis time dramatically slows down with the amount of submodules and number of files, and I believe this also leads to some duplicate issues found because of analysing the same files multiple times (unconfirmed: Duplicate Issues with Latest Version. · Issue #517 · checkstyle/sonar-checkstyle · GitHub).
My questions are:
- Is replacing the deprecated
org.sonar.api.batch.ScannerSide
withorg.sonar.api.scanner.ScannerSide
correct? If not, what is the expected replacement? - How do we ensure the workdir is set/reported correctly from the injected
FileSystem
, or how do users need to change their SonarQube configuration to fix this issue?
Thank you!
Best regards,
Daniel