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

Try out sonarcloud static analysis #984

Closed
jcoupey opened this issue Sep 8, 2023 · 1 comment · Fixed by #985
Closed

Try out sonarcloud static analysis #984

jcoupey opened this issue Sep 8, 2023 · 1 comment · Fixed by #985
Labels
Milestone

Comments

@jcoupey
Copy link
Collaborator

jcoupey commented Sep 8, 2023

In addition to #911 and #916, I setup a sonarcloud analysis (free for OSS projects). The result should be public at https://sonarcloud.io/summary/overall?id=VROOM-Project_vroom.

The analysis lists 4 "bugs" and quite a number of code smells. Not sure how we can actually configure the rules used there. Would be obviously very time-consuming to go through all of theses but we can probably look at a few category of suggestion types.

@jcoupey jcoupey added the CI label Sep 8, 2023
@jcoupey jcoupey added this to the v1.14.0 milestone Sep 8, 2023
@jcoupey jcoupey mentioned this issue Sep 8, 2023
3 tasks
@jcoupey
Copy link
Collaborator Author

jcoupey commented Sep 8, 2023

This is helpful. Out of the 4 bug reports:

  • 2 were related to dead code after #endif with specific compile flags (not critical but cleaner now);
  • 1 was a false positive I reported;
  • 1 was about using a non-initialized variable.

That last one is interesting: the initialized variable was set during a raw loop right after definition. Because of the internals of the algorithm, it is expected that the value must be set before reaching the end of the loop. Now to silence the warning I replaced that raw loop with a find_if which is both simpler and more expressive, plus we now have an assert in place to check that everything is as expected.

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

Successfully merging a pull request may close this issue.

1 participant