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

Unused "private" classes should be removed

    XMLWordPrintable

    Details

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

      The name of the unused private class

      Show
      The name of the unused private class
    • Default Severity:
      Major
    • Impact:
      Low
    • Likelihood:
      High
    • Default Quality Profiles:
      Sonar way
    • Targeted languages:
      C++
    • Covered Languages:
      Java, Python
    • Irrelevant for Languages:
      C#, VB.Net
    • Remediation Function:
      Constant/Issue
    • Constant Cost:
      2min
    • Analysis Scope:
      Main Sources, Test Sources

      Description

      private classes that are never used 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.

      Noncompliant Code Example

      public class Foo 
      {
        ...
        private class MyUnusedPrivateClass {...} // Noncompliant
      }
      

        Attachments

          Issue Links

            Activity

              People

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

                Dates

                Created:
                Updated: