@@ -374,39 +374,25 @@ void CppMetricsParser::efferentTypeLevel()
374
374
getFilterPathsQuery<model::CohesionCppRecordView>(),
375
375
[&, this ](const MetricsTasks<model::CohesionCppRecordView>& tasks)
376
376
{
377
- typedef odb::query<cc::model::CppMemberType> MemTypeQuery;
378
- typedef odb::query<cc::model::CppInheritanceCount> InheritanceQuery;
379
- typedef odb::query<cc::model::CppFunctionParamTypeView> ParamQuery;
380
- typedef odb::query<cc::model::CppFunctionLocalTypeView> LocalQuery;
381
- typedef odb::query<cc::model::CppFunction> FuncQuery;
382
-
383
377
util::OdbTransaction{_ctx.db }([&, this ]
384
378
{
379
+ typedef odb::query<cc::model::CppMemberType> MemTypeQuery;
380
+ typedef odb::query<cc::model::CppInheritanceCount> InheritanceQuery;
381
+ typedef odb::query<cc::model::CppFunctionParamTypeView> ParamQuery;
382
+ typedef odb::query<cc::model::CppFunctionLocalTypeView> LocalQuery;
383
+ typedef odb::query<cc::model::CppFunction> FuncQuery;
384
+
385
385
std::set<std::uint64_t > dependentTypes;
386
- for (const model::CohesionCppRecordView& type
387
- : _ctx.db ->query <model::CohesionCppRecordView>())
386
+ for (const model::CohesionCppRecordView& type : tasks)
388
387
{
389
- // Skip types that were included from external libraries.
390
-
391
- // const auto typeFile = _ctx.db->query_one<model::File>(
392
- // odb::query<model::File>::id == type.location.file->id);
393
- // if (!cc::util::isRootedUnderAnyOf(_inputPaths, type.file.path))
394
- // continue;
395
- /* type.location.file.load();
396
- const auto typeFile = _ctx.db->query_one<model::File>(
397
- odb::query<model::File>::id == type.location.file->id);
398
- if (!typeFile || !cc::util::isRootedUnderAnyOf(_inputPaths, typeFile->path))
399
- continue;*/
400
- // if (!cc::util::isRootedUnderAnyOf(_inputPaths, type.filePath))
401
- // continue;
402
-
403
388
dependentTypes.clear ();
404
389
405
390
// Count parent types
406
391
auto inheritanceView = _ctx.db ->query <model::CppInheritanceCount>(
407
392
InheritanceQuery::derived == type.entityHash );
408
393
409
- // Count unique type attributes
394
+ // Count unique attribute types
395
+ // and unique types in function parameters and local variables
410
396
for (const model::CppMemberType& mem: _ctx.db ->query <model::CppMemberType>(
411
397
MemTypeQuery::typeHash == type.entityHash ))
412
398
{
0 commit comments