no-unneeded-base-prefix
What it does
Section titled “What it does”Reports base.M() or base[i] where the type does not override the member, so this binds to the same one. The fix writes this.
Why it matters
Section titled “Why it matters”base. says that the call goes to the parent on purpose, and a reader looks for the override that makes this necessary. When there is none, this.M() is the same call, and the base is a misleading hint.
Example
Section titled “Example”... public (int, int) Pair() => (1, 2);... base.Run();...... public (int, int) Pair() => (1, 2);... this.Run();...Configuration
Section titled “Configuration”csharp: lint: rules: no-unneeded-base-prefix: warn # off (default), warn, errorEnabled by the presets: csharp/stylecop.
Suppress one line with sudsy-disable-next-line no-unneeded-base-prefix in a comment of the file’s language.
Upstream equivalents
Section titled “Upstream equivalents”The same check in other tools; Sudsy reports what each upstream rule reports.
| Tool | Rule | Match |
|---|---|---|
| StyleCop | SA1100 |
full |