[PATCH] D36836: [clang-tidy] Implement readability-function-cognitive-complexity check

Roman Lebedev via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sat Sep 16 15:24:56 PDT 2017


lebedev.ri updated this revision to Diff 115547.
lebedev.ri marked 13 inline comments as done.
lebedev.ri added a comment.

Address even more @JonasToth's review notes.

- Fixed docs
- Validated the implementation (the testcase) against the "reference" implementation
- Fixed discrepancies in the implementation, except the cases which are not implemented in the "reference" implementation - nested methods and such

  I will double-check, but i believe all the current tests are identical (produce the same metric) right now.
- Added a bit more tests
- Code cleanup

FIXME: so should `const std::array<const StringRef, 4> CognitiveComplexity::Msgs` be `static` and initialized out-of-line, or not `static`, but initialized in-line?


Repository:
  rL LLVM

https://reviews.llvm.org/D36836

Files:
  clang-tidy/readability/CMakeLists.txt
  clang-tidy/readability/FunctionCognitiveComplexityCheck.cpp
  clang-tidy/readability/FunctionCognitiveComplexityCheck.h
  clang-tidy/readability/ReadabilityTidyModule.cpp
  docs/ReleaseNotes.rst
  docs/clang-tidy/checks/list.rst
  docs/clang-tidy/checks/readability-function-cognitive-complexity.rst
  test/clang-tidy/readability-function-cognitive-complexity.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D36836.115547.patch
Type: text/x-patch
Size: 68180 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20170916/a72e0221/attachment-0001.bin>


More information about the cfe-commits mailing list