We are running the python analysis, importing a PyLint report in addition to the SonarQube analysis.
The imported PyLint issues are being created with each run, SonarQube does not seem to be track already existing issues and re-creates them with each run.
See an example for the Pylint rule Unused variable in the attached image. sonarqube_duplicate_error|690x324
In addition to these duplicate warnings, resolving the code smell does not remove the existing, duplicated warnings.
Using SonarCube version 7.9.1 and SonarQube Scanner 4.2.0.1873
PyLint report was generated with pylint-2.7.4 and python 3.7, running pylint --output-format=parseable.
Any help in resolving this would be greatly appreciated.
When you click ‘See Rule’ do you see the same rule identifier attached to each image? I ask because that’s part of how SonarQube identifies which issues are new
Hi Ann,
I’m working with Julian, unfortunately we don’t have SonarQube 8.8 as we are using LTS version and we don’t have test environment for SonarQube (We have a Developer edition).
My request to have a 14 days trail license to test new version was refused. I did this request in the past to test the new version before to deploy it in production (as we need it to test PL/SQL part of our projects) but it was refused because trail licenses are only for new customers (Sonar contact’s answer).
I read that the 8.x LTS version should be avail Q2 2021, so before we can’t test. Except if now there is way to build test environment.
A Community Edition of SonarQube v8.8 should give you a good environment to test in. Python analysis has changed significantly in the v8.x series, particularly with regard to importing Pylint issues.
All that said – I would check your Pylint report to see if thee issues are being reported multiple times (in which case, SonarQube is just doing the right thing with the information it’s given and reporting issues)
Hi @Colin
Yes correct but I don’t want to build a test environment to cover only 5% of our code. Our main usage of SonarQube is to scan PL/SQL. If I’m not wrong Community Edition does not scan PL/SQL.
We have now upgraded to SonarQube 8.9.
However upon importing a PyLint report duplicate Issues are still being created.
In attached screenshot, building the same code three times produced the issue pylint:R1705 three times, all on L97.
The same is happening with all other PyLint issues.
SonarQube issues are functioning as expected.
Oddly enough, the duplicate issues keep the creation date of the initial issue.
In the screenshot, the runs where executed within 20 minutes of each other, however all three issues show 39 minutes ago
While reproducing, I discovered the source of the problem.
Due to a problem in our Jenkins setup, the workspace was not being cleaned between runs.
This caused the pylint report to append to the previously present report, duplicating the issues in the report which were then imported into SonarQube.
We used tee to write the report and output to stdout alongside the -a flag.
This caused the append but was only outputting the newly appended report to stdout.
In the end, this was all due to a miss-configuration on our side.