Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clang-Tidy: duplicate issues are not removed #2174

Closed
dsakilesh opened this issue Jun 1, 2021 · 4 comments · Fixed by #2177
Closed

Clang-Tidy: duplicate issues are not removed #2174

dsakilesh opened this issue Jun 1, 2021 · 4 comments · Fixed by #2177
Assignees
Labels
Milestone

Comments

@dsakilesh
Copy link

dsakilesh commented Jun 1, 2021

Hi Team,

For one of the file the duplicates are being up by sonarqube with sonar-cxx version 2.0.2 version. Please find the details below.

SonarQube count : 3 but expected count : 2
Jenkins warning ng count : 2 as expected

Warnings in SonarQube:

PFB the clang-tidy.log content:

/var/jenkins/0/workspace/XXXXXXXXXXXXX.hpp:122:32: warning: field '_identityFunction' is uninitialized when used here [clang-diagnostic-uninitialized]
                               _identityFunction,
                               ^
/var/jenkins/0/workspace/XXXXXXXXXXXXX.hpp:123:32: warning: field '_identityFunction' is uninitialized when used here [clang-diagnostic-uninitialized]
                               _identityFunction) {
                               ^
/var/jenkins/0/workspace/XXXXXXXXXXXXX.hpp:122:32: warning: field '_identityFunction' is uninitialized when used here [clang-diagnostic-uninitialized]
                               _identityFunction,
                               ^
/var/jenkins/0/workspace/XXXXXXXXXXXXX.hpp:123:32: warning: field '_identityFunction' is uninitialized when used here [clang-diagnostic-uninitialized]
                               _identityFunction) {
                               ^

PFB the metrics displayed by jenkins warnings ng plugin:

Warning ng plugin seems to ignore the duplicates but sonarQube seems to ignore one duplicate and displays one duplicate.

Line number, column number, warning message , rule id are all the same.

Let me know if you need more details. Thanks in advance!

Regards,
Akilesh D S

@guwirth guwirth added the bug label Jun 1, 2021
@guwirth guwirth added this to the 2.0.3 milestone Jun 1, 2021
@guwirth
Copy link
Collaborator

guwirth commented Jun 1, 2021

Hi @dsakilesh, thx seems to be a bug...

@guwirth guwirth changed the title Duplicate issues picked up in sonar cxx 2.0.2 Clang-Tidy: duplicate issues are not removed Jun 2, 2021
@guwirth
Copy link
Collaborator

guwirth commented Jun 4, 2021

@dsakilesh I had a look to this issue again:

There is different code at the same position in the same file: _identityFunction, and _identityFunction) { ==> that can't be.
Reading the report below the plugin should report 1 issue because it reads only the message and not the line behind with the code snippet.

/var/jenkins/0/workspace/XXX.hpp:122:32: warning: field '_identityFunction' is uninitialized when used here [clang-diagnostic-uninitialized]
                               _identityFunction,
                               ^
/var/jenkins/0/workspace/XXX.:123:32: warning: field '_identityFunction' is uninitialized when used here [clang-diagnostic-uninitialized]
                               _identityFunction) {
                               ^
/var/jenkins/0/workspace/XXX..hpp:122:32: warning: field '_identityFunction' is uninitialized when used here [clang-diagnostic-uninitialized]
                               _identityFunction,
                               ^
/var/jenkins/0/workspace/XXX..hpp:123:32: warning: field '_identityFunction' is uninitialized when used here [clang-diagnostic-uninitialized]
                               _identityFunction) {
                               ^

@dsakilesh
Copy link
Author

Hi @guwirth

Position is the same but the line numbers are different.

_identityFunction, is available in line 122
and _identityFunction) { is available in line 123

PFB the code snippet.

image

Regards,

@guwirth guwirth self-assigned this Jun 4, 2021
@guwirth
Copy link
Collaborator

guwirth commented Jun 4, 2021

@yachoor, @dsakilesh please try with latest snapshot. Most Clang-Tidy issues should be solved now:
https://ci.appveyor.com/project/SonarOpenCommunity/sonar-cxx/branch/master/artifacts

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

Successfully merging a pull request may close this issue.

2 participants