]> granicus.if.org Git - clang/commit
[analyzer] Increase minimum complexity filter of the CloneChecker.
authorRaphael Isemann <teemperor@gmail.com>
Mon, 4 Sep 2017 05:56:36 +0000 (05:56 +0000)
committerRaphael Isemann <teemperor@gmail.com>
Mon, 4 Sep 2017 05:56:36 +0000 (05:56 +0000)
commit89ef7d95701cbc8396ba00f52c65c55a87799f66
treeab6dfdbfc19c90b493c598d35c98d693020562fd
parent5f4efc24c888d4c43af20c2c5a8e028720b8644d
[analyzer] Increase minimum complexity filter of the CloneChecker.

Summary:
So far we used a value of 10 which was useful for testing but produces many false-positives in real programs. The usual suspicious clones we find seem to be at around a complexity value of 70 and for normal clone-reporting everything above 50 seems to be a valid normal clone for users, so let's just go with 50 for now and set this as the new default value.

This patch also explicitly sets the complexity value for the regression tests as they serve more of a regression testing/debugging purpose and shouldn't really be reported by default in real programs. I'll add more tests that reflect actual found bugs that then need to pass with the default setting in the future.

Reviewers: NoQ

Subscribers: cfe-commits, javed.absar, xazax.hun, v.g.vassilev

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@312468 91177308-0d34-0410-b5e6-96231b3b80d8
24 files changed:
lib/StaticAnalyzer/Checkers/CloneChecker.cpp
test/Analysis/copypaste/asm.cpp
test/Analysis/copypaste/attributes.cpp
test/Analysis/copypaste/autogenerated_automoc.cpp
test/Analysis/copypaste/blocks.cpp
test/Analysis/copypaste/call.cpp
test/Analysis/copypaste/catch.cpp
test/Analysis/copypaste/delete.cpp
test/Analysis/copypaste/dependent-exist.cpp
test/Analysis/copypaste/expr-types.cpp
test/Analysis/copypaste/fold.cpp
test/Analysis/copypaste/function-try-block.cpp
test/Analysis/copypaste/functions.cpp
test/Analysis/copypaste/generic.c
test/Analysis/copypaste/labels.cpp
test/Analysis/copypaste/lambda.cpp
test/Analysis/copypaste/macros.cpp
test/Analysis/copypaste/not-autogenerated.cpp
test/Analysis/copypaste/objc-methods.m
test/Analysis/copypaste/plist-diagnostics-notes-as-events.cpp
test/Analysis/copypaste/plist-diagnostics.cpp
test/Analysis/copypaste/sub-sequences.cpp
test/Analysis/copypaste/suspicious-clones.cpp
test/Analysis/copypaste/text-diagnostics.cpp