Implement relational cohesion metric#795
Merged
mcserep merged 5 commits intoEricsson:masterfrom May 27, 2025
Merged
Conversation
Contributor
There was a problem hiding this comment.
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. |
1 task
mcserep
requested changes
May 27, 2025
Collaborator
mcserep
left a comment
There was a problem hiding this comment.
CppMetricsServiceHandler::getCppModuleMetricsTypeNames() should be extended with the new module metrics.
f0ffbc7 to
f6b46a7
Compare
Collaborator
Fixed in f6b46a7. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #680