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

[WIP] resolve SonarCloud violations #221

Closed
wants to merge 1 commit into from

Conversation

muhlba91
Copy link
Contributor

fixes #217;
except violations relating to #219 and #220.

@muhlba91 muhlba91 changed the title WIP: resolve SonarCloud violations [WIP] resolve SonarCloud violations May 14, 2019
private static void loadHtmlDescriptions(NewRepository repository, String htmlDescriptionFolder) {
// code adapted from:
// https://github.com/SonarSource/sslr-squid-bridge/blob/2.7.0.377/
// src/main/java/org/sonar/squidbridge/rules/ExternalDescriptionLoader.java
Copy link
Member

Choose a reason for hiding this comment

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

Can we move these comments to the Javadoc?
Maybe copy the first sentence from sonar's javadoc (if there is one) and append a note saying it was copied from and use {@link ExternalDescriptionLoader#loadHtmlDescriptions(NewRepository, String)} instead of url to github.

Copy link
Contributor Author

@muhlba91 muhlba91 May 14, 2019

Choose a reason for hiding this comment

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

Yes, we can but shouldn't we also move https://github.com/checkstyle/sonar-checkstyle/blob/master/src/main/java/org/sonar/plugins/checkstyle/CheckstyleRulesDefinition.java#L73 to the Javadoc as it follows the same?

However, I don't quite understand what you mean with {@link ExternalDescriptionLoader#loadHtmlDescriptions(NewRepository, String)}?
Because for now, this class still exists, just like loadNames (see link before) still existed until they removed some of their deprecated code. I assume this will happen here as well, meaning ExternalDescriptionLoader won't exist at some point anymore.

Both methods don't have any Javadoc in sslr-squid-bridge.

Copy link
Member

Choose a reason for hiding this comment

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

shouldn't we also move ... to the Javadoc as it follows the same?

Yes I like that.

Because for now, this class still exists, just like loadNames (see link before) still existed until they removed some of their deprecated code. I assume this will happen here as well, meaning ExternalDescriptionLoader won't exist at some point anymore.

Ok, URL has tag in it so it will never go bad unless github goes away.
{@link was just a javadoc tag that would take user to that method if they clicked on it like in an IDE. If class/method does go away, javadoc tool should print an error on the {@link as it won't point to a valid class.

I was mainly just pointing its usage since I feel it is a better way to point to a class/method in a javadoc. If everyone wants to stay with URL, I am fine.

Copy link
Member

Choose a reason for hiding this comment

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

@muhlba91 , it this discussion point resolved ?
If yes, please pin @rnveach to approve PR.

Copy link
Member

Choose a reason for hiding this comment

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

It has not been resolved.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

For this point I was waiting for a decision if we want to put dead Javadoc links in or stick with GitHub URL references?
I'm good with both ways but we should still keep the URL somewhere as well for a full reference to where the code was taken from (incl. sslr-squid-bridge version). Otherwise, you won't really know from where/when the code was taken over and whether it was modified by us already or not.

Copy link
Member

Choose a reason for hiding this comment

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

I see no reason in reference of javadoc in other project, especially to non-existing code (non-existing javadoc).

Please move link from single comment to loadHtmlDescriptions javadoc styles comment. Please do the same in "loadNames". Simply move whole text of comment to javadoc (no extra descriptions are required.)

@romani
Copy link
Member

romani commented May 14, 2019

Please do not try to fix all problems in one commit and one PR. Please split the work to ease review

@rnveach
Copy link
Member

rnveach commented May 26, 2019

Code coverage is failing on travis.

@muhlba91
Copy link
Contributor Author

@romani sorry, these weeks, unfortunately, I'm quite busy. This is why development of this issue has been a bit stalled. I will think about how to split it into more commints and PR, so either per violation or per rule. I'm not entirely sure which one is more useful though? Then I'm going to close this PR but will go to #222 first.

@romani
Copy link
Member

romani commented May 27, 2019

I'm not entirely sure which one is more useful though?

it is up to you, it is my recommendation. Long/Big PRs are prone to stay in long review and usually one questionable code piece keep whole PR. So it is recommendation to do all step by step or in smaller pieces that easy to consume by reviewer and in case of not-simple cases other fixes are not blocked.

@romani
Copy link
Member

romani commented Jun 13, 2019

@muhlba91 , ping.
It is better to resolve issues and merge sooner.

Please move comment to javadoc and lets merge this PR.

@romani romani assigned muhlba91 and unassigned rnveach Jun 13, 2019
@romani
Copy link
Member

romani commented Sep 13, 2019

@muhlba91 , please do final update and lets merge this PR

@romani
Copy link
Member

romani commented Jan 17, 2020

@muhlba91 , can you finish this PR ? or should we close it ?

FYI: I updated checkstyle project to actually use Sonar as CI validator for PRs, it would be awesome to eventually Sonar to control our code and in this plugin.

@muhlba91
Copy link
Contributor Author

i'll close it for now and work on it later.

@muhlba91 muhlba91 closed this Jan 17, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Resolve violations from sonarcloud.io
3 participants