An override only calls the base method with the same arguments
What it finds
An override whose whole body is base.M(a, b) behaves exactly like not overriding at all, and adds a member that readers have to check. Overrides with attributes, or that change the accessibility or seal the method, are left alone.
From the rule's source, base_only_override.rs.
class Base{ public virtual int Size(int n) => n;} class Derived : Base{ public override int Size(int n) => base.Size(n);tx0 reports: Size only calls the base method} class Other : Base{ public override int Size(int n) => base.Size(n + 1);} Turn it on, off or suppress it
The rule runs from the all tier up. To turn it on in a lower tier, give it a level in tx0.toml:
[rules]
"tx0/csharp:base-only-override" = "warning"To keep one finding, suppress it with a reason. tx0 suppress ID --reason "..." writes the comment on the line before the code:
// tx0: ignore[tx0/csharp:base-only-override] reason="..."tx0 explain tx0/csharp:base-only-override shows the same in the terminal. Found a false positive? Report it.