[clang-tidy] readability-function-size: add NestingThreshold param.

Summary:
Finds compound statements which create next nesting level after `NestingThreshold` and emits a warning.
Do note that it warns about each compound statement that breaches the threshold, but not any of it's sub-statements, to have readable warnings.

I was able to find only one coding style referencing nesting:
  - https://www.kernel.org/doc/html/v4.10/process/coding-style.html#indentation
     > In short, 8-char indents make things easier to read, and have the added benefit of warning you when you’re nesting your functions too deep.

This seems too basic, i'm not sure what else to test. Are more tests needed?

Reviewers: alexfh, aaron.ballman, sbenza

Reviewed By: alexfh, aaron.ballman

Subscribers: xazax.hun

Tags: #clang-tools-extra

Differential Revision: https://reviews.llvm.org/D32942

llvm-svn: 305082
diff --git a/clang-tools-extra/clang-tidy/readability/FunctionSizeCheck.h b/clang-tools-extra/clang-tidy/readability/FunctionSizeCheck.h
index 905a0d7..3986b95 100644
--- a/clang-tools-extra/clang-tidy/readability/FunctionSizeCheck.h
+++ b/clang-tools-extra/clang-tidy/readability/FunctionSizeCheck.h
@@ -27,8 +27,12 @@
 ///     macro-heavy code. The default is `800`.
 ///   * `BranchThreshold` - flag functions exceeding this number of control
 ///     statements. The default is `-1` (ignore the number of branches).
-///   * `ParameterThreshold` - flag functions having a high number of parameters.
-///     The default is `6`.
+///   * `ParameterThreshold` - flag functions having a high number of
+///     parameters. The default is `-1` (ignore the number of parameters).
+///   * `NestingThreshold` - flag compound statements which create next nesting
+///     level after `NestingThreshold`. This may differ significantly from the
+///     expected value for macro-heavy code. The default is `-1` (ignore the
+///     nesting level).
 class FunctionSizeCheck : public ClangTidyCheck {
 public:
   FunctionSizeCheck(StringRef Name, ClangTidyContext *Context);
@@ -42,6 +46,7 @@
   const unsigned StatementThreshold;
   const unsigned BranchThreshold;
   const unsigned ParameterThreshold;
+  const unsigned NestingThreshold;
 };
 
 } // namespace readability