Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support OCLint static checker; do some source cleanup #826

Merged
merged 11 commits into from
Aug 7, 2017

Conversation

cgull
Copy link
Member

@cgull cgull commented Nov 12, 2016

OCLint is a Clang/LLVM based static analyzer. It is usefully different from other static analyzers and has found worthwhile things.

  • The biggest issue it shows is the excess length and complexity of many methods. It discovered 600,000,000 different execution paths through Terminal::Framebuffer::new_frame(), and rightly carps regularly about function length, cyclomatic complexity, and number of paths. Nothing done to fix this...
  • It also identified many smaller simplifications that could be done to the code base, some of which are quite worthwhile. I think the best thing it identified was large conditionals in contexts that could be escaped, such as
if (foo) {
  // large block
}
return;

into

if (!foo) {
  return;
}
// large block

and there's some other good simplifications.

This has received a week of heavy use on a trip and seems to be in good shape.

@cgull cgull merged commit 6ebc795 into mobile-shell:master Aug 7, 2017
@cgull cgull deleted the oclint branch August 7, 2017 04:20
@eminence eminence added this to the 1.4.0 milestone Aug 12, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants