@@ -395,6 +395,8 @@ void CppMetricsParser::efferentTypeLevel()
395395 // Count parent types
396396 auto inheritanceView = _ctx.db ->query <model::CppInheritance>(
397397 InheritanceQuery::derived == type.entityHash );
398+ auto inheritanceCount = _ctx.db ->query_value <model::CppInheritanceCount>(
399+ InheritanceQuery::derived == type.entityHash );
398400
399401 // Count unique attribute types
400402 // and unique types in function parameters and local variables
@@ -426,7 +428,7 @@ void CppMetricsParser::efferentTypeLevel()
426428 model::CppAstNodeMetrics metric;
427429 metric.astNodeId = type.astNodeId ;
428430 metric.type = model::CppAstNodeMetrics::Type::EFFERENT_TYPE;
429- metric.value = inheritanceView. size () + dependentTypes.size ();
431+ metric.value = inheritanceCount. count + dependentTypes.size ();
430432 _ctx.db ->persist (metric);
431433
432434 auto typeRelationInserter = [this ](const std::uint64_t & entityHash, const std::uint64_t & dependencyHash)
@@ -555,19 +557,19 @@ void CppMetricsParser::efferentModuleLevel()
555557 {
556558 util::OdbTransaction{_ctx.db }([&, this ]
557559 {
558- typedef odb::query<cc:: model::CppDistinctTypeDependencyMetricsPathView > TypeDependencyQuery;
559- typedef odb::result<cc:: model::CppDistinctTypeDependencyMetricsPathView> TypeDependencyResult;
560+ typedef odb::query<model::CppTypeDependencyMetricsPathViewDistinctCount > TypeDependencyQuery;
561+ typedef model::CppTypeDependencyMetricsPathViewDistinctCount TypeDependencyResult;
560562
561563 for (const model::File& file : tasks)
562564 {
563- TypeDependencyResult types = _ctx.db ->query <model::CppDistinctTypeDependencyMetricsPathView >(
565+ TypeDependencyResult types = _ctx.db ->query_value <model::CppTypeDependencyMetricsPathViewDistinctCount >(
564566 TypeDependencyQuery::EntityFile::path.like (file.path + ' %' ) &&
565567 !TypeDependencyQuery::DependencyFile::path.like (file.path + ' %' ));
566568
567569 model::CppFileMetrics metric;
568570 metric.file = file.id ;
569571 metric.type = model::CppFileMetrics::Type::EFFERENT_MODULE;
570- metric.value = types.size () ;
572+ metric.value = types.count ;
571573 _ctx.db ->persist (metric);
572574 }
573575 });
0 commit comments