MCPcopy Create free account
hub / github.com/cppcheck-opensource/cppcheck / getUnmatchedLocalSuppressions

Method getUnmatchedLocalSuppressions

lib/suppressions.cpp:559–582  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

557}
558
559std::list<SuppressionList::Suppression> SuppressionList::getUnmatchedLocalSuppressions(const FileWithDetails &file) const
560{
561 std::lock_guard<std::mutex> lg(mSuppressionsSync);
562
563 std::list<Suppression> result;
564 for (const Suppression &s : mSuppressions) {
565 if (s.isInline)
566 continue;
567 if (s.matched)
568 continue;
569 if ((s.lineNumber != Suppression::NO_LINE) && !s.checked)
570 continue;
571 if (s.type == SuppressionList::Type::macro)
572 continue;
573 if (s.hash > 0)
574 continue;
575 if (s.errorId == ID_CHECKERSREPORT)
576 continue;
577 if (!s.isLocal() || !PathMatch::match(s.fileName, file.spath()))
578 continue;
579 result.push_back(s);
580 }
581 return result;
582}
583
584std::list<SuppressionList::Suppression> SuppressionList::getUnmatchedGlobalSuppressions() const
585{

Calls 2

matchFunction · 0.70
push_backMethod · 0.45

Tested by 2