Skip to content
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

Efferent coupling of types #711

Merged
merged 12 commits into from
Aug 30, 2024

Conversation

intjftw
Copy link
Collaborator

@intjftw intjftw commented Feb 18, 2024

This PR solves #673. I'd like to include multiple related tasks, hence the WIP label.

  • Efferent coupling at type level.
  • Refactoring of the C++ metrics plugin: organize metrics calculating functions into separate source files.
    Should be separate PR.
  • Test cases for efferent coupling.

@intjftw intjftw added Kind: Enhancement 🌟 Status: WIP 👷 Issue or PR under development - feel free to review, though! Plugin: C++ Issues related to the parsing and presentation of C++ projects. Plugin: Metrics Issues related to the code metrics plugin. labels Feb 18, 2024
@intjftw intjftw requested a review from mcserep February 18, 2024 09:06
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.

Currently this metric calculates the number of aggregated types for each type. Shouldn't inheritance or e.g. function parameter types be considered as well? (Question, should be discussed.)

@@ -1,4 +1,5 @@
#include <cppmetricsparser/cppmetricsparser.h>
#include "efferent.h"
Copy link
Collaborator

Choose a reason for hiding this comment

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

Incorrect inclusion order. Please refer to the coding conventions.

@@ -8,6 +8,7 @@ include_directories(
${PLUGIN_DIR}/model/include)

add_library(cxxmetricsparser SHARED
src/efferent.cpp
Copy link
Collaborator

Choose a reason for hiding this comment

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

efferent.h should also be added here, so CMake can recognize that in case the header file changes, recompilation of the target is required.

@intjftw intjftw removed the Status: WIP 👷 Issue or PR under development - feel free to review, though! label Jul 15, 2024
@intjftw intjftw requested a review from mcserep July 15, 2024 08:37
@intjftw
Copy link
Collaborator Author

intjftw commented Jul 15, 2024

I complemented the calculation with inherited types, member function parameter types and member function local variable types, aside from the already calculated member field types.
I also found and fixed a bug in the C++ metrics service: the first found metric was not returned for any AST node in getCppAstNodeMetricsDetailedForPath.
Tests are TBA.

@mcserep mcserep merged commit ec42ea0 into Ericsson:master Aug 30, 2024
14 checks passed
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.

2 participants