xref: /llvm-project/clang-tools-extra/docs/clang-tidy/checks/readability/function-size.rst (revision 7a73da4c85a12341752a4573c55ebff46ba20db0)
1.. title:: clang-tidy - readability-function-size
2
3readability-function-size
4=========================
5
6`google-readability-function-size` redirects here as an alias for this check.
7
8Checks for large functions based on various metrics.
9
10Options
11-------
12
13.. option:: LineThreshold
14
15   Flag functions exceeding this number of lines. The default is `none` (ignore
16   the number of lines).
17
18.. option:: StatementThreshold
19
20   Flag functions exceeding this number of statements. This may differ
21   significantly from the number of lines for macro-heavy code. The default is
22   `800`.
23
24.. option:: BranchThreshold
25
26   Flag functions exceeding this number of control statements. The default is
27   `none` (ignore the number of branches).
28
29.. option:: ParameterThreshold
30
31   Flag functions that exceed a specified number of parameters. The default
32   is `none` (ignore the number of parameters).
33
34.. option:: NestingThreshold
35
36    Flag compound statements which create next nesting level after
37    `NestingThreshold`. This may differ significantly from the expected value
38    for macro-heavy code. The default is `none` (ignore the nesting level).
39
40.. option:: VariableThreshold
41
42   Flag functions exceeding this number of variables declared in the body.
43   The default is `none` (ignore the number of variables).
44   Please note that function parameters and variables declared in lambdas,
45   GNU Statement Expressions, and nested class inline functions are not counted.
46