[all-commits] [llvm/llvm-project] bff7fa: [clang-tidy] Add options to describe individual co...

Kirill Bobyrev via All-commits all-commits at lists.llvm.org
Thu Mar 4 12:03:16 PST 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: bff7faea2034abed4535645d7c771e67c1f2bb23
      https://github.com/llvm/llvm-project/commit/bff7faea2034abed4535645d7c771e67c1f2bb23
  Author: Jens Massberg <massberg at google.com>
  Date:   2021-03-04 (Thu, 04 Mar 2021)

  Changed paths:
    M clang-tools-extra/clang-tidy/readability/FunctionCognitiveComplexityCheck.cpp
    M clang-tools-extra/clang-tidy/readability/FunctionCognitiveComplexityCheck.h
    M clang-tools-extra/docs/clang-tidy/checks/readability-function-cognitive-complexity.rst
    A clang-tools-extra/test/clang-tidy/checkers/readability-function-cognitive-complexity-flags.cpp

  Log Message:
  -----------
  [clang-tidy] Add options to describe individual core increments to readability-function-cognitive-complexity check.

Often you are only interested in the overall cognitive complexity of a
function and not every individual increment. Thus the flag
'DescribeBasicIncrements' is added. If it is set to 'true', each increment
is flagged. Otherwise, only the complexity of function with complexity
of at least the threshold are flagged.

By default 'DescribeBasisIncrements' is set to 'true', which is the original behavior of the check.

Added a new test for different flag combinations.

(The option to ignore macros which was original part of this patch will be added in another path)

Reviewed By: lebedev.ri

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




More information about the All-commits mailing list