Archive

Posts Tagged ‘Code Metrics’

How to use CodeMetricProvider control to build you own code metric

December 9th, 2010 Comments off

Let’s implement the Comment Density code metric using the CodeMetricProvider DXCore component. This code metric provides the ratio of comment lines to all lines and indicates the comments coverage of your source code. We are going to calculate it in percents for all type declarations like this:

Comment Density = (comment lines / code lines) * 100

The density of comments metric value will be between 0 and 100 percents, and can be used as a quality indicator to see how much of the code is commented. So, if the comment density value for instance is below a certain value defined by the project manager, it indicates that the code is under commented. Let’s assume that what’s recommended is a commenting of at least 15% of the code and a maximum of 30%.

Read more…

DXCore Components – CodeMetricProvider

December 9th, 2010 Comments off

The CodeMetricProvider component calculates and returns a code metric used in the Metrics tool window of Refactor! Pro and the Show Metrics CodeRush feature. See the “Show Metrics” post to learn more about software metrics.

Read more…

Code Metrics – Here’s your new code metric

November 29th, 2010 1 comment

This is the second part of the article, written in March of 2005 by the chief architect of IDE tools – Mark Miller, the author of the Maintenance Complexity code metric existing in CodeRush. It is updated to include maintenance complexity points for new language elements, that appeared in the new language versions (C#3.0, C#4.0, VB9.0, VB10.0). Posted with his permission.

Read more…

Code Metrics – Feeling the need for a new software metric

November 29th, 2010 Comments off

This is an article, written in July of 2004 by chief architect of IDE tools – Mark Miller. The article has been posted on Mark’s original blog, which existed before his new one. But later, the original blog and article were lost. I am reposting this article here, so everyone can learn something new about code metrics existing in CodeRush and Refactor! products. Posted with his permission.

Read more…

Shared Source – Show Metrics

November 29th, 2010 Comments off

CodeRush Pro includes the Show Metrics (also known as Code Metrics) visualization feature, which is indented to evaluate code metrics right in the code editor while you are writing and/or reviewing the code. It shows a specific code metric for each method, property or event (with add and remove methods) near its declaration:

CodeRush ShowMetrics preview

Read more…