virtual void run(const MatchFinder::MatchResult &results)
 {
     FunctionDecl *functionDecl = (FunctionDecl *)
         results.Nodes.getNodeAs<FunctionDecl>("functionDecl");
     if (functionDecl)
     {
         CyclomaticComplexityMetric ccnMetric;
         EXPECT_EQ(_ccn, ccnMetric.calculate(functionDecl));
     }
     else
     {
         FAIL();
     }
 }
Пример #2
0
extern "C" int getCyclomaticComplexity(clang::Decl *decl)
{
    CyclomaticComplexityMetric ccnMetric;
    return ccnMetric.calculate(decl);
}