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

Change coupling metric #360

Open
4 tasks
ChristianHuehn opened this issue May 17, 2024 · 2 comments
Open
4 tasks

Change coupling metric #360

ChristianHuehn opened this issue May 17, 2024 · 2 comments
Labels
enhancement New feature or request priority:medium Set by the PO only tech

Comments

@ChristianHuehn
Copy link
Collaborator

ChristianHuehn commented May 17, 2024

File coupling metric is currently not further described on how and what it will count. This should be fixed according to this list:

  • Coupling should be renamed and made clear that it is currently only a class coupling metric per file
  • If a class uses any amount of methods from another class it's count as 1
  • Fluent Interface or also called Method Chaining, should also be counted if possible. As the following example explains this pretty good:
a.buildB().buildC().buildD().doStuff();

// kinda equivalent to
const a: A = new A();
const b: B = a.buildB();
const c: C = b.buildC();
const d: D = c.buildD();
d.doStuff();

This means that you need knowledge over the implementation of the other classes and therefor coupling them together.

  • We count statics too

Background information

It can be helpful to also check the visual studio implementation of it: https://learn.microsoft.com/en-us/visualstudio/code-quality/code-metrics-class-coupling?view=vs-2022

@ChristianHuehn ChristianHuehn added enhancement New feature or request priority:medium Set by the PO only tech labels May 17, 2024
@BridgeAR
Copy link
Member

We should ideally have different type of coupling metrics, not only a single one.

@ChristianHuehn
Copy link
Collaborator Author

Exactly, that is our plan 👍 . But first we want a basic version, that works and is tested. Before we move on adding new coupling metrics.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request priority:medium Set by the PO only tech
Projects
None yet
Development

No branches or pull requests

2 participants