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

clean-up Technical Debt #1594

Merged
merged 9 commits into from
Nov 21, 2018
Merged

clean-up Technical Debt #1594

merged 9 commits into from
Nov 21, 2018

Conversation

guwirth
Copy link
Collaborator

@guwirth guwirth commented Nov 20, 2018

  • S00103
  • S1258
  • S00117
  • S3415
  • LeftCurlyBraceEndLineCheck
  • S2131
  • S1213
  • S2333

This change is Reviewable

@guwirth guwirth added this to the 1.2.1 milestone Nov 20, 2018
@guwirth guwirth self-assigned this Nov 20, 2018
@guwirth guwirth changed the title clean-up Texhnical Debt clean-up Technical Debt Nov 20, 2018
@guwirth guwirth merged commit de8db84 into SonarOpenCommunity:master Nov 21, 2018
Copy link
Contributor

@ivangalkin ivangalkin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed 56 of 56 files at r1.
Reviewable status: all files reviewed, 3 unresolved discussions (waiting on @guwirth)


cxx-checks/src/main/java/org/sonar/cxx/checks/regex/FileHeaderCheck.java, line 75 at r1 (raw file):

Charset.forName("UTF-8");

This pattern repeats several time in our code. I believe, that using of named constants instead of lookup would be a better idea

import java.nio.charset.StandardCharsets;
...
private Charset charset = StandardCharsets.UTF_8;

cxx-checks/src/main/java/org/sonar/cxx/checks/regex/FileRegularExpressionCheck.java, line 63 at r1 (raw file):

Charset.forName("UTF-8");

same here and in more than 30 other places


cxx-squid/src/main/java/org/sonar/cxx/CxxAstScanner.java, line 253 at r1 (raw file):

    int max = min(lenOfB, lenOfA);

I believe, that every reader will suspect a mistake in this assignment. Why not to call the variable intersectionLength?

Besides that, the function intersectionConcatenate() might be useless since #1480. I might be wrong though.

@ivangalkin
Copy link
Contributor

@guwirth sorry for the delay; A couple of (late) comments from my side.

@guwirth
Copy link
Collaborator Author

guwirth commented Nov 22, 2018

@ivangalkin thx for your feedback. There are another 666 open isues waiting to be closed :-) (https://sonarcloud.io/dashboard?id=org.sonarsource.sonarqube-plugins.cxx%3Acxx). Will have a look in one of the next PR.

@guwirth guwirth mentioned this pull request Dec 21, 2018
@guwirth guwirth deleted the quality-flaws-221 branch December 27, 2018 18:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

2 participants