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

Quality: Sonar RSPEC-1940 "Boolean checks should not be inverted" #1074

Open
jlerbsc opened this issue Dec 12, 2023 · 0 comments
Open

Quality: Sonar RSPEC-1940 "Boolean checks should not be inverted" #1074

jlerbsc opened this issue Dec 12, 2023 · 0 comments

Comments

@jlerbsc
Copy link
Contributor

jlerbsc commented Dec 12, 2023

We noticed that you have 8 violations of the Sonar rule RSPEC-1940 "Boolean checks should not be inverted". Although these violations are considered minor, they make the code less readable. Here is an example of the changes our automatic code remediation solution could bring to you. Its use is completely free for all opensource projects. You can use it without moderation.

org\biojava\nbio\structure\secstruc\SecStrucTools.java
@@ -58,5  +58,5 @@
                    if (g.hasAminoAtoms()) {
                            Object p = g.getProperty(Group.SEC_STRUC);
-                               if (!(p == null)) {
+                               if (p != null) {
                                    SecStrucInfo ss = (SecStrucInfo) p;
                                    listSSI.add(ss);

Below is another example

org\biojava\nbio\structure\align\ce\CeCalculatorEnhanced.java
@@ -1456,5  +1456,5 @@
                    //System.out.println("rmsd: " + rmsd);

-                       if(!(nAtom<strLen*0.95) && (!isRmsdLenAssigned)) {
+                       if(nAtom>=strLen*0.95 && (!isRmsdLenAssigned)) {
                            rmsdLen=rmsd;
                            isRmsdLenAssigned=true;

If you are interested you can go to the page https://indepth.fr/ and follow the links to download the indepth-cli application which is the client interface of our application. You also have several videos of less than a minute that explain how to launch your first remediation.

If you have the slightest difficulty, I will stay tuned to help you get to grips with Indepth.

@jlerbsc jlerbsc changed the title Suggestion: Sonar RSPEC-1940 "Boolean checks should not be inverted" Quality: Sonar RSPEC-1940 "Boolean checks should not be inverted" Jan 31, 2024
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

No branches or pull requests

1 participant