-
Notifications
You must be signed in to change notification settings - Fork 102
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
Added calculation for afferent coupling of types #757
base: master
Are you sure you want to change the base?
Conversation
@kmkristof Since the development of this new metric was started after Implementation of C++ metrics parallelization (see #734) was merged, I suggest to implement this metric with multithread computation on the first attempt, based on the already implemented pattern. We can consider this task as Level: Intermediate (3) with this added complexity. |
for (const model::CppMemberType& member : _ctx.db->query<model::CppMemberType>( | ||
odb::query<cc::model::CppMemberType>::typeHash == type.entityHash && | ||
odb::query<cc::model::CppMemberType>::kind == model::CppMemberType::Kind::Field)) | ||
{ | ||
typesFound.insert(member.memberTypeHash); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My current solution is not complete. This coupling is not only defined by member fields but also by function parameters, inheritance relations etc. Please complement this calculation accordingly.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Testing with TinyXML2, the records in the db contain 0 for the AST node ID for afferent coupling. Another issue is that all afferent coupling records are persisted multiple times (or at least I think I'm discovering a pattern in the data, but the same series of stored metrics seem to be duplicated several times). Also, the afferent metrics are not present in the service component.
Closes #671
I added a calculation for the type level afferent coupling metric based on @intjftw's solution in #711.
TODO: