Skip to content

Conversation

@barnabasdomozi
Copy link
Collaborator

Closes #680

@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. labels May 27, 2025
@mcserep mcserep added this to the Upcoming Release milestone May 27, 2025
@mcserep mcserep requested review from Copilot and mcserep May 27, 2025 03:17
Copy link
Contributor

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 implements a relational cohesion metric for C++ modules to enhance code quality analysis and closes issue #680.

  • Adds a new test suite for relational cohesion (ParameterizedRelationalCohesionTest) with corresponding sample modules in rc_module_a, rc_module_b, and rc_module_c.
  • Implements the relational cohesion metric calculation in the metrics parser and updates the relevant data models and views.
  • Updates the parser header and database model files to support the new metric.

Reviewed Changes

Copilot reviewed 15 out of 15 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
plugins/cpp_metrics/test/src/cppmetricsparsertest.cpp Adds tests to verify relational cohesion metric behavior.
plugins/cpp_metrics/test/sources/parser/rc_module_* Introduces sample modules to simulate internal type relationships.
plugins/cpp_metrics/parser/src/cppmetricsparser.cpp Implements relational cohesion metric computation using a new function.
plugins/cpp_metrics/parser/include/cppmetricsparser/cppmetricsparser.h Declares the new relational cohesion method and its partition multiplier.
plugins/cpp_metrics/model/include/model/cpptypedependencymetrics.h Adds a new DB view for counting type dependencies for the metric.
plugins/cpp_metrics/model/include/model/cppfilemetrics.h Updates the file metrics type and value to support double values for the metric.
plugins/cpp_metrics/model/include/model/cppcohesionmetrics.h Adds a new DB view to support cohesion metric counting.

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.

CppMetricsServiceHandler::getCppModuleMetricsTypeNames() should be extended with the new module metrics.

@mcserep mcserep force-pushed the relational_cohesion_modules branch from f0ffbc7 to f6b46a7 Compare May 27, 2025 06:28
@mcserep
Copy link
Collaborator

mcserep commented May 27, 2025

CppMetricsServiceHandler::getCppModuleMetricsTypeNames() should be extended with the new module metrics.

Fixed in f6b46a7.

@mcserep mcserep merged commit 0f86064 into Ericsson:master May 27, 2025
5 checks passed
@barnabasdomozi barnabasdomozi deleted the relational_cohesion_modules branch July 30, 2025 13:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Kind: Enhancement 🌟 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.

Relational Cohesion at Module Level for C++

2 participants