pmccabe - McCabe-style function complexity and line counting for C and C++

Distribution: Ubuntu 16.04 LTS (Xenial Xerus)
Repository: Ubuntu Universe amd64
Package name: pmccabe
Package version: 2.6
Package release:
Package architecture: amd64
Package type: deb
Installed size: 120 B
Download size: 24.38 KB
Official Mirror:
Pmccabe calculates McCabe-style cyclomatic complexity for C and C++ source code. Per-function complexity may be used for spotting likely trouble spots and for estimating testing effort. Pmccabe also includes a non-commented line counter compatible with anac, 'decomment' which only removes comments from source code; 'codechanges', a program to calculate the amount of change which has occurred between two source trees or files; and 'vifn', to invoke 'vi' given a function name rather than a file name. Pmccabe attempts to calculate the apparent complexity rather than the complexity following the C++ and/or cpp preprocessors. This causes Pmccabe to become confused with cpp constructs which cause unmatched curly braces - most of which can profitably be rewritten so they won't confuse prettyprinters anyway. Pmccabe prints C-compiler-style error messages when the parser gets confused so they may be browsed with standard tools. Two types of cyclomatic complexity are generated - one type counts each switch() statement as regardless of the number of cases included and the other more traditional measure counts each case within the switch(). Pmccabe also calculates the starting line for each function, the number of lines consumed by the function, and the number of C statements within the function.




    Binary package: pmccabe_2.6_amd64.deb
    Source package: pmccabe

    Install Howto

    1. Update the package index:
      # sudo apt-get update
    2. Install pmccabe deb package:
      # sudo apt-get install pmccabe


    • /usr/bin/codechanges
    • /usr/bin/decomment
    • /usr/bin/pmccabe
    • /usr/bin/vifn
    • /usr/share/doc/pmccabe/TODO
    • /usr/share/doc/pmccabe/changelog.Debian.gz
    • /usr/share/doc/pmccabe/changelog.gz
    • /usr/share/doc/pmccabe/copyright
    • /usr/share/man/man1/codechanges.1.gz
    • /usr/share/man/man1/decomment.1.gz
    • /usr/share/man/man1/pmccabe.1.gz
    • /usr/share/man/man1/vifn.1.gz


    2010-08-06 - Paul Bame <> pmccabe (2.6) unstable; urgency=low * From Ubuntu: * Fixed 364338 pdiff script change has bug * Fixed 499589 infinite loop with namespaced struct variable declaration * Thanks to matt_hargett for bugs and patches * Fixed a problem parsing DOS-format CRLF files * Updated deb stds version and fixed some lintian warnings

    2008-07-30 - Paul Bame <> pmccabe (2.5) unstable; urgency=low * updated codechanges and pdiff to be bashism safe * updated test files * bump Build-Depends debhelper 3->5

    2008-09-09 - Chris Lamb <> pmccabe (2.4+nmu2) unstable; urgency=medium * Non-maintainer upload. * Fix bashism in codechanges /bin/sh script (Closes: #486054)

    2008-04-12 - Chris Lamb <> pmccabe (2.4+nmu1) unstable; urgency=medium * Non-maintainer upload. * Fix bashism in 'codechanges' script (Closes: #465351) * Bump Standards-Version to 3.7.3.

    2007-08-13 - Paul Bame <> pmccabe (2.4) unstable; urgency=low * add support for C++ namespaces

    2003-11-26 - Paul Bame <> pmccabe (2.3-1) unstable; urgency=low * you can use "class" as an identifier in C code now. Thanks to xianjie zhang for an excellent bug report.

    2003-03-12 - Paul Bame <> pmccabe (2.2-3) unstable; urgency=low * tweek for running under buildd and whenever pmccabe not installed and . not in $PATH

    2003-02-23 - Paul Bame <> pmccabe (2.2-2) unstable; urgency=low * Tweek debian/copyright to follow policy

    2002-12-17 - Paul Bame <> pmccabe (2.2-1) unstable; urgency=low * Initial public release. * Closes: #177749