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

Add package/component size architecture metrics #1134

Open
tfij opened this issue Jul 6, 2023 · 4 comments
Open

Add package/component size architecture metrics #1134

tfij opened this issue Jul 6, 2023 · 4 comments

Comments

@tfij
Copy link
Contributor

tfij commented Jul 6, 2023

Regarding https://www.archunit.org/userguide/html/000_Index.html#_software_architecture_metrics it will be great to have package/component size metric.
Size can be calculated based on lines of code (loc) or a number of instructions(noi), e.g.

  • component size (CS): num(loc) or num(noi) for each component
  • project size (PS): num(all_loc) or num(all_loi)
  • relative component size (RCS): num(loc) / num(all_loc) or num(loi) / num(all_loi) for each component
@bgalek
Copy link
Contributor

bgalek commented Sep 15, 2023

This could be a useful feature!

@codecholeric
Copy link
Collaborator

Yes, I'd be open to add this 🙂 If somebody wants to jump in and create a PR I'm open to support. Otherwise, I put it in my queue 🙈

@codecholeric
Copy link
Collaborator

Even though the concept of "loc" doesn't exist yet, so there needs to be some pre-analysis how to map this, or if we can actually track the loc somehow... Or noi... Because ArchUnit doesn't import every bit (but maybe good enough what's there 🤷 )

@tfij
Copy link
Contributor Author

tfij commented Mar 25, 2024

So far I've implemented it as a separate lib - https://github.com/tfij/module-size-calculator
My blog post related to this lib - https://chi.pl/2024/03/07/Modularization-and-Architecture-Testing.html

I'm unsure if we can use the same approach in the archunit.

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

No branches or pull requests

3 participants