Uploaded image for project: 'Rules Repository'
  1. Rules Repository
  2. RSPEC-5603

Unused scope-limited definitions should be removed

    XMLWordPrintable

    Details

    • Type: Code Smell Detection
    • Status: Active
    • Resolution: Unresolved
    • Labels:
    • Message:
      Remove this unused private "XXXX" class/function.
    • Highlighting:
      Hide

      The class or function's name.

      Show
      The class or function's name.
    • Default Severity:
      Major
    • Impact:
      Low
    • Likelihood:
      High
    • Default Quality Profiles:
      Sonar way
    • Targeted languages:
      JavaScript, TypeScript
    • Covered Languages:
      Python
    • Remediation Function:
      Constant/Issue
    • Constant Cost:
      5min
    • Analysis Scope:
      Main Sources, Test Sources

      Description

      When a class or function is defined in a parent function or method, it is only visible in this parent function or method's scope. If the defined class or function is not used within this scope it is dead code, i.e. unnecessary, inoperative code that should be removed. Cleaning out dead code decreases the size of the maintained codebase, making it easier to understand the program and preventing bugs from being introduced.

        Attachments

          Issue Links

          1.
          Python RSPEC-5606 Language-Specification Active Unassigned

            Activity

              People

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

                Dates

                Created:
                Updated: