-
Notifications
You must be signed in to change notification settings - Fork 102
Efferent Coupling at Module Level for C++ #674
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
Comments
What do we consider a module in this case? An entire directory? So, for example, in CodeCompass, the plugins, parser and model directories are 3 different modules? Another option is to consider the C++20 feature |
A module is an abstract concept here. In case of CodeCompass I see the following options:
I will further discuss this question with @zporky today. |
@intjftw Update: last week we discussed with @zporky on the weekly meeting, that each directory should be considered as a module. Later maybe it would be wise to require some input (a whitelist) about which directories are interesting, so we do not calculate these metrics for directories, where it does not make sense, but for now, we roll with this approach. |
Is this still the case? In PR #747 a new approach was suggested to specify a flag (such as
I have a few questions below about this definition to make sure the right calculation is implemented:
Does the outside directory has to be specified as a module (e.g. listed in the file specified by Let's say
What is considered exactly a type in this case? How about functions? My initial idea was to check all usages in a module (directory) and if their definition is defined outside of this module we simply increase efferent coupling. This would be the fastest one to calculate, however I'm not sure if this would be the intended behavior. |
Hi @wbqpk3,
When the
First of all, I think there was a wording error in this issue's description, so I updated the definition of efferent coupling for modules to be more coherent with the other coupling metrics: The Efferent Coupling for a particular module is the number of types outside this module on which types inside this module directly depends.
I would say yes, they should be accounted as well. We could also discuss this one with @zporky.
No, focus on types.
If they are not inside a class, I would say omit them.
I don't think that would be the intended behaviour, but please check the updated definition of efferent coupling for modules, maybe it makes it more clear. |
Thank you for clarifying, this makes sense.
This updated definition is now a bit more clear to me. If I understand this correctly, we need to go through all user-defined types (e.g. classes) in a module and if those classes use types defined outside of this module we count them. Let's say Edit: |
@wbqpk3 Okay, let's try it with a new table for type dependency relations. |
Coupling is metric which can be computed for structural units at different levels (e.g. classes, namespaces, modules).
It measures how many other entities an entity depends on; and how many dependants it has.
The Efferent Coupling for a particular module is the number of types outside this module on which types inside this module directly depends.
High efferent coupling indicates that the concerned module is dependant.
The text was updated successfully, but these errors were encountered: