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

SonarCloud reports issues #1012

Closed
iluwatar opened this issue Oct 15, 2019 · 43 comments · Fixed by #1833, #2175 or #2176
Closed

SonarCloud reports issues #1012

iluwatar opened this issue Oct 15, 2019 · 43 comments · Fixed by #1833, #2175 or #2176

Comments

@iluwatar
Copy link
Owner

iluwatar commented Oct 15, 2019

The project is using SonarCloud static code analysis. The latest results are showing that it has found several blockers and critical severity code smells (major, minor, and info level we ignore). In this task, those are fixed or marked as false positives. To mark false positives, SuppressWarnings annotation should be used in code as explained in the linked documentation.

Links:
Blocker and critical severity code smells in SonarCloud
Sonar false positives


Note: When Submitting a PR please provide a hyperlinked list of all the issues that you are issuing a fix for. See this example

@ykayacan
Copy link

Can I take this issue?

@iluwatar
Copy link
Owner Author

Sure @ykayacan

ykayacan added a commit to ykayacan/java-design-patterns that referenced this issue Oct 18, 2019
@iluwatar iluwatar changed the title SonarCloud reports code smells SonarCloud reports issues Jun 14, 2020
@iluwatar
Copy link
Owner Author

This issue is free for taking again.

@ImLynxie
Copy link
Contributor

I would like to take this issue.

@ImLynxie
Copy link
Contributor

Through out checking the files causing issues on SonarCloud, I've encountered test cases that are not properly named to the functionality that they are to be tested against.

Example`

In-correct naming convention of a test method.

@Test void test() throws Exception { App.main(new String[]{}); }

Correct naming convention of a test method.

@Test public void shouldExecuteAppWithoutException() { assertDoesNotThrow(() -> App.main(null)); }

A test method should describe what its testing directly in the naming, I will rename the test cases that I find throughout the refactoring process to match proper convention rules, if the test case is understandable as to what it's testing, but I would encourage that these test cases be looked at and properly named for other contributors making changes to certain files that the test cases test against, otherwise it causes a lot of confusion as to whether said contributor is testing the right thing.

@iluwatar
Copy link
Owner Author

Ok @ToxicDreamz, assigned to you. I agree with your comment regarding test naming.

@ImLynxie
Copy link
Contributor

I've already finished with the issue.

Request to run another SonarCloud report after merging, to see what else remains, and whether or not they can be modified so issues do not come up again.

@iluwatar
Copy link
Owner Author

@iluwatar iluwatar pinned this issue Aug 23, 2020
@anuragagarwal561994
Copy link
Contributor

@iluwatar happy to be back again :)
Can I help with this issue?

@iluwatar
Copy link
Owner Author

Ok, go ahead @ShivanshCharak

@ShivanshCharak
Copy link
Contributor

Raised a pr for the following Critical code smell
#1960

please also review
a minor code smell
#1959 (comment)

RobbiNespu pushed a commit to RobbiNespu/java-design-patterns that referenced this issue Mar 1, 2022
… several AppTest classes (iluwatar#1784)

Co-authored-by: Subhrodip Mohanta <hello@subho.xyz>
@S7sRuss
Copy link

S7sRuss commented Sep 28, 2022

Can I help?

@iluwatar
Copy link
Owner Author

Ok @S7sRuss, thanks for the help

kongleong86 added a commit to kongleong86/java-design-patterns that referenced this issue Oct 19, 2022
kongleong86 added a commit to kongleong86/java-design-patterns that referenced this issue Oct 19, 2022
iluwatar pushed a commit that referenced this issue Oct 26, 2022
…#2125)

* refactoring #1012: Remove deprecated method to ease Hibernate upgrade later on

* refactoring #1012: Fix checkstyle violation
robertvolkmann pushed a commit to robertvolkmann/java-design-patterns that referenced this issue Nov 6, 2022
… upgrade (iluwatar#2125)

* refactoring iluwatar#1012: Remove deprecated method to ease Hibernate upgrade later on

* refactoring iluwatar#1012: Fix checkstyle violation
robertvolkmann added a commit to robertvolkmann/java-design-patterns that referenced this issue Nov 6, 2022
kongleong86 added a commit to kongleong86/java-design-patterns that referenced this issue Oct 21, 2023
kongleong86 added a commit to kongleong86/java-design-patterns that referenced this issue Oct 21, 2023
kongleong86 added a commit to kongleong86/java-design-patterns that referenced this issue Oct 21, 2023
kongleong86 added a commit to kongleong86/java-design-patterns that referenced this issue Oct 21, 2023
kongleong86 added a commit to kongleong86/java-design-patterns that referenced this issue Oct 28, 2023
iluwatar pushed a commit that referenced this issue Dec 2, 2023
… concatenation. (#2715)

* refactoring #1012: Format specifiers should be used instead of string concatenation.

* refactoring #1012: Format specifiers should be used instead of string concatenation.

* refactoring #1012: Remove isInfoEnabled check
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment