CppDepend 6 Just Released!

After 7 years of development, CppDepend reached a certain level of maturity. Yet there are still many new potential features and improvements possible. We found out that the most sensitive part for this version 6 was actually to chose carefully the set of new features and improvements we’d like to offer to users.  version 6 new stuff reflects well the most demanded features that have just been marked as completed.

External Tools Integration Using API

CppDepend provides many interesting features to explore and treat the data extracted from the analysis phase, and it’s very interesting to treat data from other static analysis tools.

Since CppDepend 5  CppCheck is supported out of the box. With CppDepend 6 you can integrate easilly other analysis tools to be executed by CppDepend and their results will be loaded and they will profit from all CppDepend features.

To help developers develop their own plugins to integrate other static analysis tools, the source code of the Visual studio analyzer is provided in the install package at %CppDependInstallDir%/Plugins/VSPlugin

Import Coverage Data

Writing automatic tests is a central practice to increase code correctness. Knowing which part of the code is covered by automatic tests helps improving tests and consequently, it helps increasing code correctness.

CppDepend gathers code coverage data from Bullseye™, Cobertura and Visual Studio Team System™. From this data, CppDepend infers some metrics on methods, types, namespaces and projects : PercentageCoverage, NbLinesOfCodeCovered, NbLinesOfCodeNotCovered and BranchCoverage. These metrics can be used conjointly with others CppDepend features.

For example you can know what code have been added or refactored since the last release and is not thoroughly covered by tests. You can write a CQLinq rule to continuously check that a set of classes is 100% covered. You can list which complex methods need more tests.

Latest Clang Used

The developement of Clang is very active, each version brings many improvements including:

  • Better support of Visual Studio projects
  • More interesting diagnostics
  • Many parsing issues resolved like for Boost 1.58.

Sonar Integration

Clearly users were asking loud for more CppDepend integration into their build-process automated workflow.  So far, users were running CppDepend.Console.exe, gathering the report and the information: is there any critical rule violated that should make our build fail? (this info can be obtained CppDepend.Console.exe exit code). Users were asking about more information to be shown right inside their build-process tooling. There are many build-process technologies and the most demanded one was SonarQube.

The SonarQube plugin provides many interesting features as described here.

Enhanced Visual Studio Integration

It was not surprising that users wanted more build-process integration since during the last year the bulk of our efforts were devoted to tooling for developers inside Visual Studio. CppDepend was integrated in Visual Studio through the VS Addin technology because of a choice we’ve made in 2009. At that time VSIX (VS package technology) was immature and we had to support VS2008 and VS2005, hence VS Addin was the right choice. Time passing by made this initial choice less and less relevant, the VS Addin technology didn’t get any improvement from Microsoft and worth, implied a few glitches like random bug, but worth, the impossibility for VS to remember CppDepend windows layout across execution.

With version 6 CppDepend relies on the VSIX technology to integrate in VS 2015, 2013, 2012 and 2010. (Should we mention that MS deprecated the VS Addin technology in VS 2015?). Anyway now thanks to VSIX we are able to offer a smoother and more reliable VS integration with windows layout remembering and with new features like the possibility to attach the CppDepend project to a .suo file (and not only .sln file) and full support for CppDepend commands keyboard-shortcut.

Rule Improvements

C/C++ code ruling is the central feature of CppDepend. We had many feedback from users about how to improve existing default code rules.

While doing so we figured out we have been a bit too geeky. This is great that CppDepend code rules are actually editable queries that can contain some comments. But for many users this didn’t convey enough information about why a rule actually warns, why abiding by a specific rule will enhance their code, and how to fix a violation of the rule. Hence we’ve added the possibility to add 2 formatted texts in a CppDepend rule source code comment through <Description> and <HowToFix> tags. This has been a great opportunity for us to write out about each default rule and provide users more explanations. Both in UI and in report, the user can chose to see the Description/HowToFix, or the rule  source code.

v61

Another need that users were asking was the possibility to share some rule set among several CppDepend projects. Typically a Company has several code bases analyzed each by a CppDepend project, and what users want is a Company-level quality profile that can be applied to each code base. And taking account that CppDepend makes easier than any other tool to define custom rules on .C/C++ code, users wanted even more to define custom quality profile shareable. We addressed this need in CppDepend v6 with the possibility to define rule files that can be shared among CppDepend projects.

Code Metrics Visualization

CppDepend already had code metrics visualization with treemaping and we decided to add coloring. The idea is that we can then visualize two code metrics, one represented by rectangle area, the other one represented by rectangle color. For example, the screenshot below shows CppDepend version 6 code coverage by tests in a unique, yet convenient and accurate way.

  • Rectangles represent methods,
  • Rectangle area is proportional to # Lines of Code,
  • Rectangle color represents cyclomatic complexity

v62

I hope this picture helps understand why we wanted to offer users this feature. At a glance, colored treemaping can help grasp information that would be hard to get through another mean. We can identify aggregation of red rectangles that shed light on  more complex code.

Leave a Reply

Your email address will not be published. Required fields are marked *