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

Unused methods

Open movedoa opened this issue 3 years ago • 3 comments

Pretty sure i already created a ticket for this some time ago but i can't find it anywhere.

Anyway, i just spent 30 minutes refactoring a method, which, as is turns out, is used nowhere and could be removed. A rule to find unused methods would be great to find dead code.

Not sure if its that easy for procedures/functions but i care mostly about methods so i would be happy with that ;-)

movedoa avatar Sep 28 '21 16:09 movedoa

It's tough, though, with public or package-* access level members. Especially if you develop libraries / frameworks. Might be good to (be able to) limit this to private/protected members.

PeterJudgeZA avatar Sep 28 '21 16:09 PeterJudgeZA

The best would be to have a "Where used" functionality in the IDE ! But that's a good rule idea too. As Peter said, can be done for private methods. Doing that on public methods would require changes to the engine.

gquerret avatar Sep 28 '21 17:09 gquerret

The best would be to have a "Where used" functionality in the IDE ! But that's a good rule idea too. As Peter said, can be done for private methods. Doing that on public methods would require changes to the engine.

....yeah, an ide from the 21 century would be nice 😬

Public methods would still be nice to have (with a setting). Maybe something for the future 😁

movedoa avatar Sep 28 '21 17:09 movedoa