Details
-
Type:
Code Smell Detection
-
Status: Active
-
Resolution: Unresolved
-
Message:Remove this method "XXXX" to simply inherit it.
-
Default Severity:Minor
-
Impact:Low
-
Likelihood:Low
-
Default Quality Profiles:Sonar way
-
Targeted languages:Swift
-
Covered Languages:C#, C, C++, Flex, Java, PHP
-
Remediation Function:Constant/Issue
-
Constant Cost:2min
-
Analysis Scope:Main Sources, Test Sources
-
Implementation details:
-
FindBugs:FI_USELESS, USM_USELESS_SUBCLASS_METHOD
-
PMD:FinalizeOnlyCallsSuperFinalize, UselessOverridingMethod
-
ReSharper:RedundantOverridenMember
-
Quick-fixes:
Description
Overriding a method just to call the same method from the super class without performing any other actions is useless and misleading. The only time this is justified is in final overriding methods, where the effect is to lock in the parent class behavior. This rule ignores such overrides of equals, hashCode and toString.
Attachments
Issue Links
- is implemented by
-
CPP-1546 C++ Rule: Overriding methods should do more than simply call the same method in the super class
-
- Closed
-
-
SONARPHP-347 Rule: Overriding methods should do more than simply call the same method in the super class
-
- Closed
-
-
SONARFLEX-57 S1185: Add exception for final methods
-
- Open
-
- is related to
-
SONARJAVA-1347 FP on S1185: Changing method visibility should not raise issue
-
- Closed
-
-
CPP-2418 S1185: Fix false-positives with "final"
-
- Closed
-
-
SONARJAVA-3612 FP in S1185 when class is annotated "@Transactional"
-
- Closed
-
1.
|
Java | RSPEC-1991 |
|
Active | Unassigned | |
2.
|
Flex | RSPEC-1992 |
|
Active | Unassigned | |
3.
|
PHP | RSPEC-1993 |
|
Active | Unassigned | |
4.
|
C#: Overriding members should do more than simply call the same member in the base class | RSPEC-3454 |
|
Active | Unassigned | |
5.
|
C-Family | RSPEC-3709 |
|
Active | Unassigned |