QualityAssistant icon indicating copy to clipboard operation
QualityAssistant copied to clipboard

Abstract method not overriden rule

Open peteruhnak opened this issue 9 years ago • 2 comments

(I am not sure if suggestions for new rules should go here or to fogzbugz; I can move it if needed…)

A new rule that would warn me if I didn't override an abstract method.

An abstract method contains self subclassResponsibility.

The "autofix" option could use RBRealizeClassRefactoring to automatically create stubs for the abstract methods. (This is what is used by right click on class → Refactoring → class refactoring → realize)

peteruhnak avatar May 26 '16 21:05 peteruhnak

Hi. There is already RBSubclassResponsibilityNotDefinedRule. But I think that the validation should be shifted to the class that is missing concrete implementations. There is already an autofix, but using refactoring may be more sense. I'll give it a try, thanks :)

Uko avatar May 27 '16 08:05 Uko

Having it in the subclass sounds more sensible. It's not the parent's fault that the children don't obey. :)

peteruhnak avatar May 27 '16 21:05 peteruhnak