Skip to content

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

@jlerbsc

Description

@jlerbsc

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions