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

@Deprecated annotation

Open gquerret opened this issue 7 years ago • 8 comments

Ability to annotate classes, interfaces and methods in OOABL code. Any use of a deprecated object would have to be reported, whether in procedural or OO code.

gquerret avatar Jan 16 '17 13:01 gquerret

Like it!

Any idea how we could extend that for classes where we have no source code available? .NET classes and 3rd party ABL classes? We'd need to be able to provide a different source for the list of deprecated classes, interfaces, methods, properties and events.

Further - any chance to extent this for procedures as well? running depecated .p files? Internal procedures? Internal procedures of persistent/super-procedures?

mikefechner avatar Jan 16 '17 14:01 mikefechner

For external ABL classes without source code, the best would be to have annotations kept in rcode. So the AVM team should be bribed. I don't know enough of .Net, but is this information available somewhere ? Using the same kind of annotation or a different mechanism ?

It will be extended, but I'd like to keep it focused at the beginning. In the future, I'd like to have:

  • deprecated include files
  • deprecated procedures (.p)

gquerret avatar Jan 16 '17 14:01 gquerret

.Net classes can come from compiled dlls so there is no way to add annotations. Like i said in #173, this should work like the "Matching keyword in sourcecode" rule and it should be possible to suppress the issue with an annotation. So we could setup the rule with the full namespace + class name.

movedoa avatar Jan 26 '17 17:01 movedoa

Yes, a mechanism has to be available to mark classes from rcode or external DLL as deprecated (as annotations are not kept in rcode). Question: is there a Deprecated annotation in .Net ? Which could be re-used in ABL ?

gquerret avatar Jan 26 '17 20:01 gquerret

http://stackoverflow.com/questions/1759352/how-do-i-mark-a-method-as-obsolete-deprecated

The class member attribute Obsolete should do.

mikefechner avatar Jan 26 '17 20:01 mikefechner

Could we use the ABLDuck documentation syntax to mark a method as obsolete ?

https://github.com/Riverside-Software/pct/wiki/ABLDuck#deprecated

/**
 * @deprecated
*/

cverbiest avatar Apr 19 '19 11:04 cverbiest

I'd stick with @Deprecated annotation, as documentation is not processed in proparse.

gquerret avatar Apr 23 '19 07:04 gquerret

And yes, it would be better to log a case in PCT in order to support @Deprecated annotations in ABLDuck.

gquerret avatar Apr 23 '19 07:04 gquerret