-
Type:
Code Smell Detection
-
Status: Active
-
Resolution: Unresolved
-
Labels:
-
Message:Remove the unused declaration of type "xxx".
-
Default Severity:Major
-
Impact:Low
-
Likelihood:High
-
Default Quality Profiles:Sonar way, MISRA C++ 2008 recommended
-
Covered Languages:C, C++, Objective-C
-
Remediation Function:Constant/Issue
-
Constant Cost:10min
-
MISRA C++ 2008:0-1-5
If a type is declared but not used, then it is unclear to a reviewer if the type is redundant or it has been left unused by mistake.
Noncompliant Code Example
void unusedtype() { typedef int local_Type; // Noncompliant, unused }
See
- MISRA C++:2008, 0-1-5 - A project shall not contain unused type declarations.
- is implemented by
-
CPP-1499 Rule: Unused type declarations should be removed
-
- Closed
-
-
CPP-2119 S897: Fix false-negatives
-
- Closed
-
- is related to
-
RSPEC-1763 All code should be reachable
- Active
-
RSPEC-1029 Class templates, function templates, class template member functions and class template static members should be instantiated at least once
- Active
- relates to
-
RSPEC-901 Dead code should be removed
- Closed