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

Unused function parameters should be removed

    Details

    • Type: Code Smell Detection
    • Status: Active
    • Resolution: Unresolved
    • Labels:
    • Message:
      Remove the unused function parameter(s) "{}".
    • Default Severity:
      Major
    • Impact:
      Low
    • Likelihood:
      High
    • Default Quality Profiles:
      Sonar way
    • Legacy Key:
      UnusedFunctionArgument
    • Targeted languages:
      PL/I, Python, RPG, Rust, TypeScript, VB6
    • Covered Languages:
      C#, C, C++, Flex, Go, Java, JavaScript, Kotlin, Objective-C, PHP, PL/SQL, Ruby, Scala, Swift, T-SQL, VB.Net
    • Irrelevant for Languages:
      ABAP, Cobol, HTML, XML
    • Remediation Function:
      Constant/Issue
    • Constant Cost:
      5min
    • Analysis Level:
      Semantic Analysis
    • Analysis Scope:
      Main Sources, Test Sources
    • Common Rule:
      Yes
    • CERT:
      MSC12-C.
    • CPPCheck:
      unusedFunction, unusedPrivateFunction
    • FxCop:
      ReviewUnusedParameters, CA1801
    • PC-Lint:
      715, 1715
    • PMD:
      UnusedFormalParameter
    • ReSharper:
      UnusedParameter.Local
    • SwiftLint:
      unused_closure_parameter

      Description

      Unused parameters are misleading. Whatever the values passed to such parameters, the behavior will be the same.

      See

      • CERT, MSC12-C. - Detect and remove code that has no effect or is never executed

        Attachments

          Issue Links

            Activity

              People

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

                Dates

                • Created:
                  Updated: