sonar-openedge icon indicating copy to clipboard operation
sonar-openedge copied to clipboard

[Request] Internal methods should be fully qualified

Open movedoa opened this issue 7 years ago • 4 comments

It would be nice to have a rule that checks if a call of an internal method is made with "THIS-OBJECT" or the class name for static methods

Wrong: FooMethod()

Right: THIS-OBJECT:FooMethod() or FooClass:FooMethod()

movedoa avatar Jun 27 '17 09:06 movedoa

Why do you want to have THIS-OBJECT in front of the method call ? Doesn't it just add unnecessary keywords to the code ? But BTW, there could be two different rules, one enforcing usage of this-object, and the other one rejecting usage of this-object ; depending on coding style, the former or the latter could be activated.

gquerret avatar Jun 27 '17 19:06 gquerret

I think it is cleaner and more readable. You instantly see that is is an internal method call.

movedoa avatar Jun 28 '17 07:06 movedoa

yeah but only if you also enforce "in this-procedure' when you run an internal procedure ;-)

run internalprocedure in this-procedure.

ok just kidding, couldn't resist to reply while waiting for a loooong ant job

jurjendijkstra avatar Jun 28 '17 09:06 jurjendijkstra

I try to refactor everything to OO so this is not really a concern of mine ;-)

movedoa avatar Jun 28 '17 09:06 movedoa