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

Alexander Kornienko via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sat Feb 13 17:12:07 PST 2021


alexfh added inline 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.
----------------
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.


================
Comment at: clang-tools-extra/clang-tidy/readability/FunctionCognitiveComplexityCheck.h:27
+//      statements, ...) which contributes to that complexity is flagged.
+//      Default is `true`
+///   * `IgnoreMacros` - if set to `true`, the check will ignore code inside
----------------
Trailing period is missing.


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