Tools to compute quality metrics

gprof allows you to learn where your program spent its time and which functions called which other functions while it was executing. This information can show you which pieces of your program are slower than you expected, and might be candidates for rewriting to make your program execute faster. It can also tell you which functions are being called more or less often than you expected. This may help you spot bugs that had otherwise been unnoticed. link

SourceMeter is a free command line tool that calculates more than 60 metrics (including afferent and efferent coupling) from Java source code.  It has a SonarQube plug-in as well so the results can be explored in it ( the online demo: link)

SonarQube is an open platform to manage code quality. link

CCCC is a tool which analyzes C++ and Java files and generates a report on various metrics of the code. Metrics supported include lines of code, McCabe's  complexity and metrics proposed by Chidamber&Kemerer and Henry&Kafura. link

Jdepend traverses Java class file directories and generates design quality metrics for each Java package. JDepend allows you to automatically measure the quality of a design in terms of its extensibility, re-usability, and maintainability to manage package dependencies effectively. link