Uploaded image for project: 'SonarPython'
  1. SonarPython
  2. SONARPY-612

FN Rule S2159: raise issue on equality between two None values

    Details

    • Type: New Feature
    • Status: Closed
    • Priority: Major
    • Resolution: Won't Fix
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: Rules
    • Labels:
      None

      Description

      We should raise issues when an equality is performed on two operands which can only be of type NoneType, i.e. they are always None.
      Corresponding code example from the RSPEC:

      mynone = None
      
      foo = mynone == None  # Noncompliant. Always True.
      

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                nicolas.harraudeau Nicolas Harraudeau
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: