Skip to content

Implement afferent coupling at module level #794

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

Merged
merged 2 commits into from
May 27, 2025

Conversation

barnabasdomozi
Copy link
Collaborator

Closes #672

@barnabasdomozi barnabasdomozi force-pushed the afferent_coupling_modules branch from d385eeb to ff35a5e Compare May 7, 2025 21:22
@barnabasdomozi barnabasdomozi force-pushed the afferent_coupling_modules branch from ff35a5e to 606d9b9 Compare May 7, 2025 21:55
@mcserep mcserep added Kind: Enhancement 🌟 Kind: Important 🥇 Plugin: C++ Issues related to the parsing and presentation of C++ projects. Plugin: Metrics Issues related to the code metrics plugin. labels May 27, 2025
@mcserep mcserep requested review from mcserep and Copilot May 27, 2025 03:11
@mcserep mcserep added this to the Upcoming Release milestone May 27, 2025
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

Adds computation and testing for afferent coupling metrics at the module level.

  • Introduces afferentModuleLevel() in the parser and hooks it into parse()
  • Defines a new DB view/struct for distinct entity counts and updates the CppFileMetrics::Type enum
  • Adds end-to-end tests and test fixtures for afferent module coupling, including new test sources

Reviewed Changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
plugins/cpp_metrics/test/src/cppmetricsparsertest.cpp Add ParameterizedAfferentModuleCouplingTest suite and update efferent test comments
plugins/cpp_metrics/test/sources/parser/modulemetrics.cpp Include new module_d/d1.h in module metrics input
plugins/cpp_metrics/test/sources/parser/module_d/d1.h New test class D1 with dependencies on C1 and C2
plugins/cpp_metrics/parser/src/cppmetricsparser.cpp Implement afferentModuleLevel(), register it in parse()
plugins/cpp_metrics/parser/include/cppmetricsparser/cppmetricsparser.h Declare afferentModuleLevel() and its partition multiplier
plugins/cpp_metrics/model/include/model/cpptypedependencymetrics.h Rename efferent count struct and add afferent count view/struct
plugins/cpp_metrics/model/include/model/cppfilemetrics.h Add AFFERENT_MODULE to CppFileMetrics::Type
Comments suppressed due to low confidence (1)

plugins/cpp_metrics/test/src/cppmetricsparsertest.cpp:386

  • [nitpick] The test suite prefix ParameterizedAfferentModuleCouplingTestSuite is inconsistent with the efferent suite naming. Consider using ParameterizedAfferentModuleCouplingTest for consistency.
INSTANTIATE_TEST_SUITE_P(ParameterizedAfferentModuleCouplingTestSuite,

Co-authored-by: Copilot <[email protected]>
@mcserep mcserep merged commit dc03735 into Ericsson:master May 27, 2025
5 of 6 checks passed
@barnabasdomozi
Copy link
Collaborator Author

@mcserep
The comment changed in c142f61 is not a typo,
afferentModuleLevel depends on efferentTypeLevel.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Kind: Enhancement 🌟 Kind: Important 🥇 Plugin: C++ Issues related to the parsing and presentation of C++ projects. Plugin: Metrics Issues related to the code metrics plugin.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Afferent Coupling at Module Level for C++
2 participants