MCPcopy Create free account
hub / github.com/KDE/kdevelop / countUses

Function countUses

kdevplatform/language/duchain/navigation/useswidget.cpp:369–384  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

367}
368
369uint countUses(int usedDeclarationIndex, DUContext* context)
370{
371 uint ret = 0;
372
373 for (int useIndex = 0; useIndex < context->usesCount(); ++useIndex)
374 if (context->uses()[useIndex].m_declarationIndex == usedDeclarationIndex)
375 ++ret;
376
377 const auto childContexts = context->childContexts();
378 for (DUContext* child : childContexts) {
379 if (!isNewGroup(context, child))
380 ret += countUses(usedDeclarationIndex, child);
381 }
382
383 return ret;
384}
385
386QList<OneUseWidget*> createUseWidgets(const CodeRepresentation& code, int usedDeclarationIndex, IndexedDeclaration decl,
387 DUContext* context)

Callers

nothing calls this directly

Calls 4

isNewGroupFunction · 0.85
childContextsMethod · 0.80
usesCountMethod · 0.45
usesMethod · 0.45

Tested by

no test coverage detected