OCLint is a static code analysis tool for improving quality and reducing defects by inspecting C, C++ and Objective-C code and looking for potential problems like:
- Possible bugs - empty if/else/try/catch/finally statements
- Unused code - unused local variables and parameters
- Complicated code - high cyclomatic complexity, NPath complexity and high NCSS
- Redundant code - redundant if statement and useless parentheses
- Code smells - long method and long parameter list
- Bad practices - inverted logic and parameter reassignment
- ...
Installation:
- Step 1: Download "oclint-0.x.x-x86_64-darwin-15.0.0.tar" from the downloads page. Unzip this file and see as below:
- Step 2: Copying OCLint to System PATH. Open Terminal prompt, and input some commands lines as follows:
$ cd /Downloads/oclint-0.10.x
$ cp bin/oclint* /usr/local/bin/
$ cp -rp lib/* /usr/local/lib/
Other option: Directly adding to PATH at here.
oclint
directly from there and expect message similar to below:$ oclint
oclint: Not enough positional command line arguments specified!
Must specify at least 1 positional arguments: See: oclint -help