Add package/component size architecture metrics
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)ornum(noi)for each component - project size (PS):
num(all_loc)ornum(all_loi) - relative component size (RCS):
num(loc) / num(all_loc)ornum(loi) / num(all_loi)for each component
This could be a useful feature!
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 🙈
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 🤷 )
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.