Skip to content
New issue

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

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

Already on GitHub? # to your account

Efferent Coupling at Module Level for C++ #674

Open
mcserep opened this issue Nov 8, 2023 · 3 comments
Open

Efferent Coupling at Module Level for C++ #674

mcserep opened this issue Nov 8, 2023 · 3 comments
Assignees
Labels
Kind: Enhancement 🌟 Kind: Important 🥇 Level: Intermediate (3) Plugin: C++ Issues related to the parsing and presentation of C++ projects. Plugin: Metrics Issues related to the code metrics plugin.

Comments

@mcserep
Copy link
Collaborator

mcserep commented Nov 8, 2023

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 inside this module that depends on types outside this module.

High efferent coupling indicates that the concerned module is dependant.

@mcserep mcserep added Kind: Enhancement 🌟 Plugin: C++ Issues related to the parsing and presentation of C++ projects. Plugin: Metrics Issues related to the code metrics plugin. Level: Intermediate (3) Kind: Important 🥇 labels Nov 8, 2023
@intjftw
Copy link
Collaborator

intjftw commented Nov 14, 2023

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 module but I guess it's not that widespread.

@mcserep
Copy link
Collaborator Author

mcserep commented Nov 15, 2023

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 module but I guess it's not that widespread.

A module is an abstract concept here. In case of CodeCompass parser is a module, but plugins is not a module, instead plugins/cpp is a module, as that is a cohesive logical unit of the program. But plugins/cpp/parser could also be considered a submodule in my view.

I see the following options:

  1. A module is a C++20 module. Since we would like this feature to work pre C++20 codebases, we should not do this.
  2. A module is defined by the user in some format. This would require significant work on specifying and implementing how it is defined, thus I suggest not to go on this way.
  3. A module is a directory. Any directory, so in this case plugins, plugins/cpp, plugincs/cpp/parser and plugincs/cpp/parser/src could all be interpreted as modules. In this case we evaluate the module level metric for all directories, but it won't make sense for all directories. It will depend on the user to query the metric for the directories, where it is useful. I see this as a possible option.
  4. A module is a namespace and we expect that the namespace hierarchy of the project analyzed is properly maintained. This is an alternative solution.

I will further discuss this question with @zporky today.

@mcserep
Copy link
Collaborator Author

mcserep commented Nov 29, 2023

@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.

@intjftw intjftw self-assigned this Feb 21, 2024
@mcserep mcserep added this to the Upcoming Release milestone Apr 29, 2024
@github-project-automation github-project-automation bot moved this to To do in Roadmap Aug 27, 2024
@github-project-automation github-project-automation bot moved this to To do in Lab Aug 27, 2024
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
Kind: Enhancement 🌟 Kind: Important 🥇 Level: Intermediate (3) Plugin: C++ Issues related to the parsing and presentation of C++ projects. Plugin: Metrics Issues related to the code metrics plugin.
Projects
Status: To do
Status: To do
Development

No branches or pull requests

2 participants