Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[feature request] filter orphans #1061

Open
MatthijsE opened this issue Jul 15, 2024 · 2 comments
Open

[feature request] filter orphans #1061

MatthijsE opened this issue Jul 15, 2024 · 2 comments

Comments

@MatthijsE
Copy link

Hi,

First: Thank you for your time giving us this great tool.

I would like to suggest the following feature: A filter option to filter orphan elements. I consider a element an orphan when it is not used in a view. These are already visible in the model by it's italic font, but filtering would make maintaining the model a lot easier. If it is not to much of a trouble, I would like to request also a filter option for elements that have no relations to other elements.

Thank you for taking this into consideration.

Matthijs

@Phillipus
Copy link
Member

filtering would make maintaining the model a lot easier.

If the aim is to maintain the model by removing "orphan" elements or elements that have no relations to other elements then the following jArchi script is even easier than filtering and manually deleting them.

// jArchi script to delete orphan elements (not in a view) or elements that have no incoming or outgoing relations
$("element").forEach(element => {
    if($(element).viewRefs().isEmpty() || $(element).rels().isEmpty()) {
        element.delete();
        console.log("Deleted: " + element);
    }
});

@lvmm
Copy link

lvmm commented Jul 20, 2024

All elements unused in a view are listed in Validator warnings
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants