Extends and implements list entries should not be redundant

Description

An extends or implements list entry is redundant if:

  • It is Object - all classes extend Object implicitly.

  • It is int for an enum

  • It is listed multiple times.

  • It is a superclass of another listed extension.

Such redundant declarations should be removed because they needlessly clutter the code and can be confusing.

Message

"yyy" is a "xxx" so "xxx" can be removed from the extension list. "xxx" is listed multiple times. "Object" should not be explicitly extended.

Highlighting

None

List of parameters

None
0% Done
Loading...

Activity

Show:

Dinesh Bolkensteyn May 11, 2015 at 12:24 PM

LGTM

Note that in C#, classes and interfaces are derived from using the following syntax: class MyDerivedClass : MyBaseClass, MyBaseInterface

So the words extends and implements do not appear in the code.

Ann Campbell May 11, 2015 at 11:30 AM

see what you think now

Dinesh Bolkensteyn May 8, 2015 at 1:37 PM

This rule definitely makes sense for C# - but I don't like "an extension" in the description. I can't understand what it is.

Ann Campbell December 15, 2014 at 3:07 PM

R# RedundantExtendsListEntry

Pinned fields
Click on the next to a field label to start pinning.

Details

Assignee

Reporter

Labels

Default Severity

Minor

Covered Languages

C#
Java

Remediation Function

Constant/Issue

Constant Cost

Analysis Scope

Main Sources
Test Sources

Sentry

Created August 6, 2014 at 6:25 PM
Updated March 22, 2021 at 4:47 PM