How To Install pmccabe on Kali Linux
Introduction
In this tutorial we learn how to install pmccabe on Kali Linux.
What is pmccabe
pmccabe is:
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.
There are three methods to install pmccabe on Kali Linux. We can use apt-get, apt and aptitude. In the following sections we will describe each method. You can choose one of them.
Install pmccabe Using apt-get
Update apt database with apt-get using the following command.
sudo apt-get updateAfter updating apt database, We can install pmccabe using apt-get by running the following command:
sudo apt-get -y install pmccabeInstall pmccabe Using apt
Update apt database with apt using the following command.
sudo apt updateAfter updating apt database, We can install pmccabe using apt by running the following command:
sudo apt -y install pmccabeInstall pmccabe Using aptitude
If you want to follow this method, you might need to install aptitude on Kali Linux first since aptitude is usually not installed by default on Kali Linux. Update apt database with aptitude using the following command.
sudo aptitude updateAfter updating apt database, We can install pmccabe using aptitude by running the following command:
sudo aptitude -y install pmccabeHow To Uninstall pmccabe on Kali Linux
To uninstall only the pmccabe package we can use the following command:
sudo apt-get remove pmccabeUninstall pmccabe And Its Dependencies
To uninstall pmccabe and its dependencies that are no longer needed by Kali Linux, we can use the command below:
sudo apt-get -y autoremove pmccabeRemove pmccabe Configurations and Data
To remove pmccabe configuration and data from Kali Linux we can use the following command:
sudo apt-get -y purge pmccabeRemove pmccabe configuration, data, and all of its dependencies
We can use the following command to remove pmccabe configurations, data and all of its dependencies, we can use the following command:
sudo apt-get -y autoremove --purge pmccabeDependencies
pmccabe have the following dependencies:
References
Summary
In this tutorial we learn how to install pmccabe package on Kali Linux using different package management tools: apt, apt-get and aptitude.