This is an archive of the discontinued LLVM Phabricator instance.

[analyzer] Increase minimum complexity filter of the CloneChecker.
ClosedPublic

Authored by teemperor on Jun 13 2017, 3:23 PM.

Details

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.

Diff Detail

Repository
rL LLVM

Event Timeline

teemperor created this revision.Jun 13 2017, 3:23 PM
NoQ edited edge metadata.Jul 2 2017, 12:13 AM

We should probably add a test that shows that the current default value of MinimumCloneComplexity is large. Like, test that the positive we're trying to avoid with this patch is indeed gone.

NoQ added a comment.Jul 2 2017, 12:29 AM

Hmm, what else remains to be fixed before we should try to deliver CloneChecker to the users (move out of alpha, either on by default or into optin)?

I think we've had this problem with overlapping clones. I just thought that we could also probably fix it by trying to find clones within clones, with smaller complexity, and suppressing the report if our clones are composed of many copies of smaller clones(?)

teemperor updated this revision to Diff 113725.Sep 3 2017, 10:56 PM
  • Rebased and updated patch before merging.
This revision was automatically updated to reflect the committed changes.