Uploaded image for project: 'SonarSlang'
  1. SonarSlang
  2. SONARSLANG-180

S1125: FN on primitive boolean variables

    XMLWordPrintable

    Details

    • Type: False Negative
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: 1.1
    • Fix Version/s: 1.9
    • Component/s: Kotlin
    • Labels:
      None

      Description

      Currently to avoid a high rate of FP on rule RSPEC-1125 in slang, BooleanLiteralCheck do not raise any issue on boolean comparisons == and != with true and false.
      This is because in many cases, such comparison is valid as the variable is nullable.

      To reduces FN rate, the rule needs to be updated to check == and != comparisons when a primitive is involved.
      However, semantic information (nullable vs. primitive) on the variables is first required.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              margarita.nedzelska Margarita Nedzelska
              Reporter:
              christophe.zurn Christophe Zurn
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Dates

                Created:
                Updated: