C#-NoHidingOfBaseClassMethods¶
Do not hide a base method by a method in a derived type
Required inputs: CSharpAST
T derives (directly or indirectly)
from type TP, and an instance method m) is declared in T with the same
name and number of parameters as an instance method in TP. The types of the parameter
match except for one or more parameters, where the type of T.m is more common than the type of TP.m.
If the option
report_only_more_specific_hidings is set to false, also
hidings are reported where all parameter types coincide.
If the option report_if_parameters_have_generic_parameter_type is set to
true, and the parameter types of at least one pair of corresponding parameters are both
generic parameters, the method is reported even if all other parameter types coincide.Possible Messages
Key |
Text |
Severity |
Disabled |
|---|---|---|---|
method_hides_identical_method |
Method hides a base method with identical signature. |
None |
False |
method_hides_more_specific_method |
Method hides a base method with a more specific signature. |
None |
False |
Options¶
This rule shares the following common options: excludes, includes, justification_checker, post_processing, provider, severity
The following places define options that affect this rule: Stylechecks, Analysis-GlobalOptions
report_if_parameters_have_generic_parameter_type¶
report_if_parameters_have_generic_parameter_type : bool = True
report_only_more_specific_hidings¶
report_only_more_specific_hidings : bool = True