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

Unused "private" methods should be removed

    Details

    • Type: Code Smell Detection
    • Status: Active
    • Resolution: Unresolved
    • Labels:
    • Message:
      Remove this unused private "XXXX" [method|function|constructor|member].
    • Default Severity:
      Major
    • Impact:
      Low
    • Likelihood:
      High
    • Default Quality Profiles:
      Sonar way
    • Legacy Key:
      UnusedPrivateMethod
    • Targeted languages:
      ABAP, VB.Net, VB6
    • Covered Languages:
      C#, C, C++, Flex, Java, Kotlin, PHP, Python, Scala, Swift
    • Irrelevant for Languages:
      Cobol, HTML, JavaScript, Objective-C, PL/I, PL/SQL, RPG, T-SQL, TypeScript, XML
    • Remediation Function:
      Constant/Issue
    • Constant Cost:
      5min
    • Analysis Scope:
      Main Sources, Test Sources
    • Common Rule:
      Yes
    • CPPCheck:
      unusedPrivateFunction
    • FindBugs:
      UPM_UNCALLED_PRIVATE_METHOD
    • FxCop:
      AvoidUncalledPrivateCode, AvoidUnusedPrivateFields, CA1811, CA1823
    • PMD:
      UnusedPrivateMethod
    • ReSharper:
      UnusedMember.Local, UnusedAutoPropertyAccessor.Local, UnusedProperty, NotAccessedField.Local

      Description

      private methods that are never executed are dead code: 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

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                freddy.mallet Freddy Mallet (Inactive)
              • Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated: