biojava icon indicating copy to clipboard operation
biojava copied to clipboard

For your information, code remediation via indepth-cli is completely free for open source projects

Open jlerbsc opened this issue 1 year ago • 3 comments

We suggested code changes corresponding to defects listed by SonarQube.

https://github.com/biojava/biojava/pull/1067 https://github.com/biojava/biojava/pull/1065 https://github.com/biojava/biojava/pull/1062 https://github.com/biojava/biojava/pull/1052

Today we offer all Open source projects the opportunity to use our solution for free, to detect and correct issues in your project yourself. Everything you need to do is explained here https://github.com/javaperf-consulting/indepth

We hope this solution can help you improve the quality of your solution.

Please share your suggestions/comments to help us improve indepth-cli.

jlerbsc avatar Nov 14 '23 09:11 jlerbsc

OK

tejdnk-2019-ShortNotes avatar Dec 02 '23 07:12 tejdnk-2019-ShortNotes

For example, in the latest version of the project, there are 14 issues that violate the Sonar rule "Exception handlers should preserve the original exception" (S1166). This is an issue because you lose the original exception which makes it more difficult to troubleshoot.

Below is a snippet of the type of correction that our solution can provide in this case.

org\biojava\nbio\alignment\io\StockholmFileParser.java @@ -501,5 +501,5 @@ // TODO: Best practice is to catch or throw Exception, never both logger.error("IOException: ", e); - throw new IOException("Error parsing Stockholm file"); + throw new IOException("Error parsing Stockholm file", e); } StockholmStructure structure = this.stockholmStructure;

All you have to do is go to the site https://indepth.fr/ then follow the “download” link. On the project's github page you have 3 videos of less than a minute which succinctly explain how to get started with Indepth. Basically the first time you use it there are 4 steps. Downloading the client application; Opening an account and initializing the project; The choice of a type of fix (a Sonar rule); Then execution either in a dry-run mode or by requesting the application of patches.

If you encounter any difficulty, simply open an issue and we will assist you in using the product. Please note that it is also free to use for all open source projects.

jlerbsc avatar Dec 04 '23 13:12 jlerbsc

We also noticed that you had 100 violations of the "logging arguments should not require evaluation" rule. This violation is important because it could cause performance problems related to the concatenation of character strings in the logs. You will find detailed explanations on this page (https://rules.sonarsource.com/java/RSPEC-2629/).

Below is a snippet of the type of correction that our solution can provide in this case.

org\biojava\nbio\structure\xtal\CrystalBuilder.java @@ -281,5 +281,5 @@ int auTrials = (numPolyChainsAu*(numPolyChainsAu-1))/2; int trials = numPolyChainsAunumOperatorsSgnumPolyChainsAu*neighbors; - logger.debug("Chain clash trials within original AU: "+auTrials); + logger.debug("Chain clash trials within original AU: {}", auTrials);

Furthermore, Sonar estimates the average correction time for an issue of this type to be 5 minutes. In your case it would take about 8 hours of hard work to complete it. With Indepth it will only take you a few minutes if we consider the time needed to initialize your project in our solution.

Improving the quality of your Java source code has never been easier, faster and more efficient.

jlerbsc avatar Dec 04 '23 13:12 jlerbsc

Closing because this is not an issue.

josemduarte avatar Mar 05 '24 00:03 josemduarte