{"id":264,"date":"2018-02-02T15:41:26","date_gmt":"2018-02-02T15:41:26","guid":{"rendered":"http:\/\/cppdepend.com\/blog\/?p=264"},"modified":"2018-02-09T17:58:38","modified_gmt":"2018-02-09T17:58:38","slug":"make-your-visual-c-experience-much-better","status":"publish","type":"post","link":"https:\/\/cppdepend.com\/blog\/make-your-visual-c-experience-much-better\/","title":{"rendered":"Make Your Visual C++ Experience Much Better."},"content":{"rendered":"<div class=\"entry-content\">\n<p>Visual C++ is one of the most used C++ IDEs which provides many interesting features to developers, each new version brings new major features and many extensions are available to add more nice features to it.In this post, I will talk about some useful features provided by\u00a0<a href=\"http:\/\/www.cppdepend.com\/\">CppDepend<\/a>.<br \/>\n<!--more--><\/p>\n<h2>Visualize your Code Base<\/h2>\n<h2>Dependency Graph<\/h2>\n<p>The dependency graph is the most common used graph to represent the dependencies between code elements, Visual Studio provides an interesting one. And the Graph provided by CppDepend is more oriented code quality, indeed the box size as the Edge thickness could be proportional to one of many metrics available.<\/p>\n<p><a href=\"https:\/\/paulinsights.files.wordpress.com\/2015\/07\/vs3.png\"><img decoding=\"async\" class=\"alignnone wp-image-24 size-large\" src=\"http:\/\/www.codeproject.com\/KB\/Blogs\/1007933\/vs3.png\" alt=\"vs3\" \/><\/a><\/p>\n<h3>Dependency Matrix<\/h3>\n<p>The DSM (Dependency Structure Matrix) is a compact way to represent and navigate across dependencies between components. DSM is used to represent the same information than a graph, but it\u2019s more practical if:<\/p>\n<ul>\n<li>Many code elements are involved.<\/li>\n<li>You need to discover the dependency weight between elements.<\/li>\n<li>Discover easily dependency cycles between code elements.<\/li>\n<\/ul>\n<p><img decoding=\"async\" class=\"alignnone wp-image-20 size-large\" src=\"http:\/\/www.codeproject.com\/KB\/Blogs\/1007933\/vs1.png\" alt=\"vs1\" \/><\/p>\n<h3>Treemap<\/h3>\n<p>In the Metric View, the code base is represented through a\u00a0<code>Treemap<\/code>. Treemapping is a method for displaying tree-structured data by using nested rectangles. The tree structure used is the usual code hierarchy:<\/p>\n<ul>\n<li>C\/C++ projects contain namespaces<\/li>\n<li>Namespaces contain types<\/li>\n<li>Types contains methods and fields<\/li>\n<\/ul>\n<p>The rectangle size is proportional to the metric you choose, by default it\u2019s the\u00a0<code>NbLinesOfCode<\/code>. And the Metric View can display a second metric by coloring the treemap elements. Hence two code metrics can be displayed at once.<\/p>\n<p>For example, in this treemap, the rectangle size corresponds to the lines of code and the color to the cyclomatic complexity, you can visually detect where are the most complex method and the biggest ones.<\/p>\n<p><a href=\"https:\/\/paulinsights.files.wordpress.com\/2015\/07\/vs2.png\"><img decoding=\"async\" class=\"alignnone wp-image-25 size-large\" src=\"http:\/\/www.codeproject.com\/KB\/Blogs\/1007933\/vs2.png\" alt=\"vs2\" \/><\/a><\/p>\n<h2>Metrics Info<\/h2>\n<p>Many metrics are available for projects, namespaces, classes, methods and fields. The info view report some of these metrics which is very helpful to check in dev the quality of our implementations.<\/p>\n<p><a href=\"https:\/\/paulinsights.files.wordpress.com\/2015\/07\/vs8.png\"><img decoding=\"async\" class=\"alignnone wp-image-22 size-large\" src=\"http:\/\/www.codeproject.com\/KB\/Blogs\/1007933\/vs8.png\" alt=\"vs8\" \/><\/a><\/p>\n<h2>Define Rules<\/h2>\n<p>CQLinq is maybe the most powerful feature provided by CppDepend, we can easily define some advanced queries to search for a specific code elements. The CQLinq editor has many nice features to help us create our custom rules and the result is calculated in real time.<\/p>\n<p><a href=\"https:\/\/paulinsights.files.wordpress.com\/2015\/07\/vs5.png\"><img decoding=\"async\" class=\"alignnone wp-image-26 size-large\" src=\"http:\/\/www.codeproject.com\/KB\/Blogs\/1007933\/vs5.png\" alt=\"vs5\" \/><\/a><\/p>\n<h2>Get Diagnostics<\/h2>\n<p>With CppDepend, you can easily get all Clang, Cppcheck and Vera++ issues. You can plug other tools using the API.<\/p>\n<p><a href=\"https:\/\/paulinsights.files.wordpress.com\/2015\/07\/vs9.png\"><img decoding=\"async\" class=\"alignnone wp-image-33 size-large\" src=\"http:\/\/www.codeproject.com\/KB\/Blogs\/1007933\/vs9.png\" alt=\"vs9\" \/><\/a><\/p>\n<h2>Trend Charts<\/h2>\n<p>Trend chart is a useful feature to explore the evolution of a metric after some code changes. Many charts are provided by default and you can easily create your own charts.<\/p>\n<p><a href=\"https:\/\/paulinsights.files.wordpress.com\/2015\/07\/vs6.png\"><img decoding=\"async\" class=\"alignnone wp-image-28 size-large\" src=\"http:\/\/www.codeproject.com\/KB\/Blogs\/1007933\/vs6.png\" alt=\"vs6\" \/><\/a><\/p>\n<h2>Advanced Search<\/h2>\n<p>Sometimes, it\u2019s useful to search methods by their code size, cyclomatic complexity, comment percent, coupling,\u2026<\/p>\n<p>The CppDepend provides this feature and you can search for code elements using many metrics.<\/p>\n<p><a href=\"https:\/\/paulinsights.files.wordpress.com\/2015\/07\/vs7.png\"><img decoding=\"async\" class=\"alignnone wp-image-29 size-large\" src=\"http:\/\/www.codeproject.com\/KB\/Blogs\/1007933\/vs7.png\" alt=\"vs7\" \/><\/a><\/p>\n<p>Conclusion<\/p>\n<\/div>\n<p><!--more--><\/p>\n<div class=\"entry-content\"><\/div>\n<div class=\"entry-content\">\n<p><a href=\"http:\/\/www.cppdepend.com\/\">CppDepend<\/a>\u00a0could help you to better understand your code base and detect some implementation and design flaws. However, as mentioned before, its feature richness makes it not easily accessible after a first use, you have to spend some hours to master some of its capabilities.<\/p>\n<\/div>\n<p><!--more--><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Visual C++ is one of the most used C++ IDEs which provides many interesting features to developers, each new version brings new major features and many extensions are available to add more nice features to it.In this post, I will talk about some useful features provided by\u00a0CppDepend.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[7,32,13,31,33,20],"class_list":["post-264","post","type-post","status-publish","format-standard","hentry","category-uncategorized","tag-c","tag-code-quality","tag-cpp","tag-graphs","tag-rules","tag-treemap"],"_links":{"self":[{"href":"https:\/\/cppdepend.com\/blog\/wp-json\/wp\/v2\/posts\/264","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/cppdepend.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/cppdepend.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/cppdepend.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/cppdepend.com\/blog\/wp-json\/wp\/v2\/comments?post=264"}],"version-history":[{"count":5,"href":"https:\/\/cppdepend.com\/blog\/wp-json\/wp\/v2\/posts\/264\/revisions"}],"predecessor-version":[{"id":307,"href":"https:\/\/cppdepend.com\/blog\/wp-json\/wp\/v2\/posts\/264\/revisions\/307"}],"wp:attachment":[{"href":"https:\/\/cppdepend.com\/blog\/wp-json\/wp\/v2\/media?parent=264"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/cppdepend.com\/blog\/wp-json\/wp\/v2\/categories?post=264"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/cppdepend.com\/blog\/wp-json\/wp\/v2\/tags?post=264"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}