[PATCH] D96281: [clang-tidy] Add options to flag individual core increments and to ignore macros to readability-function-cognitive-complexity check.

Jens Massberg via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Feb 16 05:37:54 PST 2021


massberg marked 4 inline comments as done.
massberg added a comment.

Thanks for the comments!



================
Comment at: clang-tools-extra/clang-tidy/readability/FunctionCognitiveComplexityCheck.h:24-26
+///   * `FlagBasicIncrements`- if set to `true`, additional to flagging
+//      functions exceeding the threshold also every piece of code (loops, if
+//      statements, ...) which contributes to that complexity is flagged.
----------------
alexfh wrote:
> Thanks! Now the description contains enough information, but it was hard for me to understand it. I'd suggest to reword this a bit, for example: "if set to `true`, then for each function exceeding the complexity threshold the check will issue additional diagnostics on every piece of code (loop, `if` statement, etc.) which contributes to that complexity."
> 
> As mentioned earlier, an example may help understand the purpose of this option even better.
Thanks for the suggested rewording!
I took you suggestion and added a comment to the existing examples below which hopefully explains the option now.


================
Comment at: clang-tools-extra/docs/clang-tidy/checks/readability-function-cognitive-complexity.rst:20
 
+.. option:: FlagBasicIncrements
+
----------------
lebedev.ri wrote:
> `FlagBasicIncrements` is misleading, this should be `DescribeBasicIncrements`.
Thanks, I renamed it as proposed.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D96281/new/

https://reviews.llvm.org/D96281



More information about the cfe-commits mailing list