Code analysis and reviews are very important for keeping the source nice and tidy. Static code analysis is a method for testing a software product without running it. Various tools are available for optimization of the code analysis.
Code Query Language
The purpose of CQL is to perform queries over the source code and to retrieve statistics. The syntax is similar to SQL (Structured Query Language) and it is not a coincidence CQL regards the source as a database. Over 200 keywords are available to execute different queries and retrieve data. Using CppDepend and CQL developers can analyses their C/C++ code and prepare useful graphs.
WARN IF Count > 0 IN SELECT METHODS WHERE NbLinesOfCode > 200 ORDER BY NbLinesOfCode DESC
This query retrieves all long methods that should be split.
Code Query Language 1.8 Specification