[cfe-dev] [RFC] Cyclomatic complexity checker

Andrey Bokhanko via cfe-dev cfe-dev at lists.llvm.org
Tue Jun 21 09:53:43 PDT 2016


Stanislav,

I believe this functionality is already in clang-tidy (look at
clang-tools-extra/test/clang-tidy/readability-function-size.cpp test;
"readability-function-size.BranchThreshold" option essentially computes
cyclomatic complexity, though it does so in a non-traditional way -- which
actually might produce more useful results for C++ developers).

Yours,
Andrey
=====
Software Engineer
Intel Compiler Team


On Tue, Jun 21, 2016 at 10:45 AM, Stanislav Pankevich via cfe-dev <
cfe-dev at lists.llvm.org> wrote:

> Hello everyone,
>
> I skimmed through available checkers in Clang Static Analyzer [1] and
> didn’t find a checker for cyclomatic complexity.
>
> My assumption is that checker is not implemented because it doesn’t help
> to find bugs directly [2]. However I believe that this checker would help
> to reduce a number of bugs indirectly by decreasing a complexity of a
> source code.
>
> Is there a way to see this checker in the upstream? If not what would be
> the best way to have it?
>
> [1] http://clang-analyzer.llvm.org/available_checks.html
> [2] By definition, "The Clang Static Analyzer is a source code analysis
> tool that finds bugs in C, C++, and Objective-C programs.” (from
> http://clang-analyzer.llvm.org/index.html)
>
> Thanks.
>
> Stanislav
>
>
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20160621/1ab186af/attachment.html>


More information about the cfe-dev mailing list