moosetechnology / Famix

An abstract representation of source code. Famix is generic and can describe applications in multiple programming languages.
MIT License
13 stars 23 forks source link

better manage deadCode #549

Open anneetien opened 1 year ago

anneetien commented 1 year ago

The way deadCode is computed (taking into account the superClasses and implementing interfaces) is not well done. We have to imprive it. We have to deal also with methods with parameterized parameters. After we will have to deal also with dead branch.

jecisc commented 7 months ago

I cannot find #deadCode in Moose 11. But we have #isDead that is implemented using the MM and MooseQuery. It checks if it has an incoming dependency and returns true only if there is none.

Is it still valid?

NicolasAnquetil commented 7 months ago

your are asking if the issue or the method #isDead is still valid ?

May be we can rename #isDead to #hasNoIncoming or #hasNoClient ... ?

And for a real dead code detection, we need a more complex implementation. This calls for "complex" queries or algorithms that would be reusable but that would need fine tuning for specific meta-models or even specific applications (for example how to detect that a service in a client/server application is or not dead?)

see https://github.com/moosetechnology/Moose/issues/2523