Skip to content

Implement efferent coupling at module level #790

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 5 commits into from
May 5, 2025

Conversation

wbqpk3
Copy link
Collaborator

@wbqpk3 wbqpk3 commented Apr 17, 2025

Closes: #674

  • Fixed a bug in Efferent Coupling Type level calculation: by default, ODB uses left join, which resulted in incorrect results
  • Added CppTypeDependencyMetrics table listing dependencies between individual types
  • Extended Efferent Coupling Type level calculation to insert these dependency relations
  • Implemented Efferent Coupling Module level calculation using this new table
  • Added test cases

@mcserep mcserep self-requested a review May 5, 2025 08:27
@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 5, 2025
@mcserep mcserep added this to the Upcoming Release milestone May 5, 2025
@mcserep mcserep added this to Roadmap and Lab May 5, 2025
@github-project-automation github-project-automation bot moved this to In progress in Roadmap May 5, 2025
@github-project-automation github-project-automation bot moved this to In progress in Lab May 5, 2025
@mcserep mcserep requested a review from Copilot May 5, 2025 08:29
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

This PR fixes a bug in the efferent coupling type level calculation while introducing new metrics for type dependencies and module-level efferent coupling. Key changes include:

  • Fixing the bug caused by the use of a left join in efferent coupling type level calculation.
  • Adding the CppTypeDependencyMetrics table and updating the efferent type level calculation to record dependency relations.
  • Implementing efferent coupling module level calculations and associated test cases.

Reviewed Changes

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

Show a summary per file
File Description
util/include/util/dbutil.h Refactored getFilterPathsQuery to use an if constexpr lambda for determining the query column.
plugins/cpp_metrics/test/src/cppmetricsparsertest.cpp Updated test parameter typedefs and instantiations for consistency.
plugins/cpp_metrics/parser/src/cppmetricsparser.cpp Updated inheritance query logic and added module level metric calculations.
plugins/cpp_metrics/parser/include/cppmetricsparser/cppmetricsparser.h Added declarations for new module coupling methods and constants.
Various files in plugins/cpp_metrics/test/sources/parser/* and plugins/cpp_metrics/model/include/model/* Added new module metric sources and updated model definitions to support efferent module metrics.
plugins/cpp/model/include/model/cppfunction.h Updated db view syntax for parameter and local variable views using the new inner alias.
Files not reviewed (3)
  • plugins/cpp_metrics/model/CMakeLists.txt: Language not supported
  • plugins/cpp_metrics/test/sources/parser/CMakeLists.txt: Language not supported
  • util/CMakeLists.txt: Language not supported

Copy link
Collaborator

@mcserep mcserep left a comment

Choose a reason for hiding this comment

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

LGTM 🚀

@mcserep mcserep merged commit 20a9bd2 into Ericsson:master May 5, 2025
10 checks passed
@github-project-automation github-project-automation bot moved this from In progress to Done in Roadmap May 5, 2025
@github-project-automation github-project-automation bot moved this from In progress to Done in Lab May 5, 2025
@mcserep mcserep removed this from Roadmap May 5, 2025
@mcserep mcserep removed this from Lab May 5, 2025
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.

Efferent Coupling at Module Level for C++
2 participants