Search code examples
c++macosprofilingcyclomatic-complexity

McCabe-style function complexity test for Mac


What tool can I use to test McCabe-style function complexity of my code on Max OS X?

There is pmccabe for Linux, which is on my department's machines and what they want me to use. It analyzes each function in certain project files and spews out data for each, including function complexity as a McCabe-style integer (example output). I'd love something that has the same functionality.


Solution

  • It took a while to find this:

    Use homebrew.

    Copy this line into a Terminal to install homebrew:

    ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)"
    

    Then, run this command:

    $ brew install pmccabe