Please use GitHub pull requests for new patches. Avoid migrating existing patches. Phabricator shutdown timeline
Changeset View
Changeset View
Standalone View
Standalone View
clang-tidy/readability/FunctionSizeCheck.h
Show All 27 Lines | |||||
/// * `BranchThreshold` - flag functions exceeding this number of control | /// * `BranchThreshold` - flag functions exceeding this number of control | ||||
/// statements. The default is `-1` (ignore the number of branches). | /// statements. The default is `-1` (ignore the number of branches). | ||||
/// * `ParameterThreshold` - flag functions having a high number of | /// * `ParameterThreshold` - flag functions having a high number of | ||||
/// parameters. The default is `-1` (ignore the number of parameters). | /// parameters. The default is `-1` (ignore the number of parameters). | ||||
/// * `NestingThreshold` - flag compound statements which create next nesting | /// * `NestingThreshold` - flag compound statements which create next nesting | ||||
/// level after `NestingThreshold`. This may differ significantly from the | /// level after `NestingThreshold`. This may differ significantly from the | ||||
/// expected value for macro-heavy code. The default is `-1` (ignore the | /// expected value for macro-heavy code. The default is `-1` (ignore the | ||||
/// nesting level). | /// nesting level). | ||||
/// * `VariableThreshold` - flag functions having a high number of variable | |||||
/// declarations. The default is `-1` (ignore the number of variables). | |||||
class FunctionSizeCheck : public ClangTidyCheck { | class FunctionSizeCheck : public ClangTidyCheck { | ||||
public: | public: | ||||
FunctionSizeCheck(StringRef Name, ClangTidyContext *Context); | FunctionSizeCheck(StringRef Name, ClangTidyContext *Context); | ||||
void storeOptions(ClangTidyOptions::OptionMap &Opts) override; | void storeOptions(ClangTidyOptions::OptionMap &Opts) override; | ||||
void registerMatchers(ast_matchers::MatchFinder *Finder) override; | void registerMatchers(ast_matchers::MatchFinder *Finder) override; | ||||
void check(const ast_matchers::MatchFinder::MatchResult &Result) override; | void check(const ast_matchers::MatchFinder::MatchResult &Result) override; | ||||
private: | private: | ||||
const unsigned LineThreshold; | const unsigned LineThreshold; | ||||
const unsigned StatementThreshold; | const unsigned StatementThreshold; | ||||
const unsigned BranchThreshold; | const unsigned BranchThreshold; | ||||
const unsigned ParameterThreshold; | const unsigned ParameterThreshold; | ||||
const unsigned NestingThreshold; | const unsigned NestingThreshold; | ||||
const unsigned VariableThreshold; | |||||
}; | }; | ||||
} // namespace readability | } // namespace readability | ||||
} // namespace tidy | } // namespace tidy | ||||
} // namespace clang | } // namespace clang | ||||
#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_READABILITY_FUNCTIONSIZECHECK_H | #endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_READABILITY_FUNCTIONSIZECHECK_H |