[PATCH] [clang-tidy] Add a checker for long functions.
Benjamin Kramer
benny.kra at gmail.com
Wed Aug 20 08:52:53 PDT 2014
Hi alexfh, djasper,
As this is very dependent on the code base it has some ways of configuration.
It's possible to pick between 3 modes of operation:
- Line counting: number of lines including whitespace and comments
- Statement counting: number of statements within compoundStmts.
- Cyclomatic complexity: calculated from the CFG.
In addition a threshold can be picked, warnings are only emitted when it is met.
Sadly this is not configurable at runtime yet as there is some plumbing missing.
http://reviews.llvm.org/D4986
Files:
clang-tidy/misc/CMakeLists.txt
clang-tidy/misc/FunctionLength.cpp
clang-tidy/misc/FunctionLength.h
clang-tidy/misc/MiscTidyModule.cpp
unittests/clang-tidy/CMakeLists.txt
unittests/clang-tidy/FunctionLengthCheckTest.cpp
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D4986.12703.patch
Type: text/x-patch
Size: 11592 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20140820/bc321f1d/attachment.bin>
More information about the cfe-commits
mailing list