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

Fix Critical Sonar Issues #1833

Merged
merged 5 commits into from Oct 13, 2021
Merged

Conversation

Copy link
Contributor

@ohbus ohbus left a comment

Choose a reason for hiding this comment

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

Please check CI reports for failing issues.

This looks like a duplicate of #1831 and #1832

@sims-keshri
Copy link
Contributor Author

sims-keshri commented Oct 5, 2021

Sorry for the duplication. I raised a different PR for every sonar fix that I did. All the three PRs have a different fix.
This one resolves the following issue:
Define a constant instead of duplicating this literal 'Error connecting to MongoDB' 4 times.

@sims-keshri sims-keshri closed this Oct 5, 2021
@sims-keshri sims-keshri reopened this Oct 5, 2021
@sims-keshri
Copy link
Contributor Author

sims-keshri commented Oct 5, 2021

@ohbus Fixed the checkstyle violation.

@sims-keshri
Copy link
Contributor Author

hello @ohbus please review the PRs as I would like to make more contributions once these get approved. Thanks

@ohbus ohbus mentioned this pull request Oct 8, 2021
Copy link
Contributor

@ohbus ohbus left a comment

Choose a reason for hiding this comment

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

Thank you so much for our efforts and your interest in our project.

Please provide the links to the sonar issues to get this PR approved.

You may bring the change from #1832 to here as well.

Copy link
Contributor

@ohbus ohbus left a comment

Choose a reason for hiding this comment

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

@sims-keshri As you have changed the files, there seems to be a problem of not meeting code coverage.

Please implement test cases with a minimum of 80% coverage, whoever these minor changes should make you cover with a cent percent.

Looking forward to your contribution.

Thanks.

@sims-keshri
Copy link
Contributor Author

sims-keshri commented Oct 9, 2021

Hello @ohbus The coverage issue is not entirely due to the lines added by me. There are no tests for the file DbManager.java. Please see the coverage report here: https://sonarcloud.io/component_measures?id=iluwatar_java-design-patterns&metric=new_coverage&pullRequest=1833&selected=iluwatar_java-design-patterns%3Acaching%2Fsrc%2Fmain%2Fjava%2Fcom%2Filuwatar%2Fcaching%2FDbManager.java&view=list

However after adding the changes from #1832 and #1831 the coverage is now 80%.
Please approve and merge it. Thanks

@sonarcloud
Copy link

sonarcloud bot commented Oct 9, 2021

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

80.0% 80.0% Coverage
0.0% 0.0% Duplication

@sims-keshri
Copy link
Contributor Author

Hello @ohbus can you please review this?

@ohbus ohbus changed the title Sonr critical fix 3 Fix Critical Sonar Issues Oct 13, 2021
Copy link
Contributor

@ohbus ohbus left a comment

Choose a reason for hiding this comment

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

LGTM 🎉

Thank you so much for improving the code quality of our repository.

@ohbus ohbus merged commit 5a644f1 into iluwatar:master Oct 13, 2021
@ohbus ohbus added this to the 1.25.0 milestone Oct 13, 2021
@ohbus ohbus linked an issue Oct 13, 2021 that may be closed by this pull request
@ohbus
Copy link
Contributor

ohbus commented Oct 13, 2021

@all-contributors please add @sims-keshri for code

@allcontributors
Copy link
Contributor

@ohbus

I've put up a pull request to add @sims-keshri! 🎉

@sims-keshri
Copy link
Contributor Author

Thank you so much @ohbus. I would like to contribute more to this repository. Will hopefully add another PR soon to fix other sonar issues.
Thanks :)

@ohbus
Copy link
Contributor

ohbus commented Oct 17, 2021

Great @sims-keshri We are looking forward to your wonderful contributions. 🎉

RobbiNespu pushed a commit to RobbiNespu/java-design-patterns that referenced this pull request Mar 1, 2022
* Resolve Sonar Code Smell: Define a constant instead of duplicating this literal 'Space rocket <' 4 times.

* Resolve Sonar Critical Code Smell: Define a constant instead of duplicating this literal 'Error connecting to MongoDB' 4 times.

* Fix checkstyle violation.

* Resolve Sonar Critical Code Smell: Define a constant instead of duplicating this literal 'LITERAL 0' 4 times.

Co-authored-by: Subhrodip Mohanta <hello@subho.xyz>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

SonarCloud reports issues
2 participants