Not Used Elements
109
Views
5
Comments
New
References

Quite often I go through some modules to clean it from elements that are not used anymore.

It would be great if there was a way to know all the components that are not used inside a module and maybe delete them similar to the remove unused dependencies instead of going through every element and clicking find usages in all modules and then deleting it manually if not used

There is already functionality that helps with this use case: unused elements are flagged as warnings in TrueChange, and each of them can be deleted centrally via the context menu.

That said, adding the ability to select and delete multiple unused elements at once would be an improvement and reduce manual effort for module cleanup while still keeping the developer in control.

A single action that blindly deletes all unused elements, however, feels risky. Even when elements are currently unused, they may still be relevant for ongoing refactoring or upcoming changes, so an explicit selection step helps avoid accidental loss of work.

@Sebastian Krempel
This only works with private elements but if the element is public the warning will not show
I do agree with you about an action that blindly deletes everything being risky.

However if there was a popup or something that shows up with a checkbox beside each element then you can select what to keep and what to delete

@Khaled Abuhelal There is already an option to remove all unused elements in Service Studio and ODC Studio for many years.


@Daniël Kuhlmann this option only removes unused dependencies, isn't it? I do not know of an option to remove elements of the currently opened module that are not used. Did I miss something?

@Khaled Abuhelal you're right, the warnings do not show up for public elements. I also use the "Find usage in all modules" option (Ctrl+F12) when tidying up code. Having a list of unused private and public elements with checkboxes to bulk remove them would be great.