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

FP on rule S5717 when the parameter value is replaced

    Details

    • Type: False-Positive
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: 2.8
    • Fix Version/s: None
    • Component/s: Rules
    • Labels:
      None

      Description

      Rule RSPEC-5717 should not raise an issue when the parameter value is replaced before being modified.

      def replace_value_before(param=[]):  # No issue because param is set before being used
          param = [param]
          param.append(42)  # Secondary location
      
      
      def replace_value_after(param=[]):  # Noncompliant
          param.append(42)
          param = [param]
      

      Note: this problem does not raise many False Positives.

        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: