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

Function skipUnreachableBranch

lib/astutils.cpp:3920–3934  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3918}
3919
3920const Token *skipUnreachableBranch(const Token *tok)
3921{
3922 if (!Token::simpleMatch(tok, "{"))
3923 return tok;
3924
3925 if (tok->scope()->type == ScopeType::eIf) {
3926 return skipUnreachableIfBranch(tok);
3927 }
3928
3929 if (tok->scope()->type == ScopeType::eElse) {
3930 return skipUnreachableElseBranch(tok);
3931 }
3932
3933 return tok;
3934}

Callers 4

functionThrowsRecursiveFunction · 0.85
invalidFunctionUsageMethod · 0.85

Calls 4

skipUnreachableIfBranchFunction · 0.85
scopeMethod · 0.80
simpleMatchFunction · 0.70

Tested by

no test coverage detected