int getNcssCount(Decl *decl) { if (decl->hasBody()) { NcssMetric ncssMetric; return ncssMetric.ncss(decl->getBody()) + 1; } return 0; }
virtual void run(const MatchFinder::MatchResult &results) { FunctionDecl *functionDecl = (FunctionDecl *) results.Nodes.getNodeAs<FunctionDecl>("functionDecl"); if (functionDecl) { NcssMetric ncssMetric; EXPECT_EQ(_ncss, ncssMetric.ncss(functionDecl->getBody())); } else { FAIL(); } }