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…
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…
To make the big hint component work, execute the following steps:
- Drop the BigHint control on the PlugIn design surface
- Fill the Title property with a short message
- Fill the Text property with a message or some information
- Call one of the ShowAt() overloads inside your code.
Read more…
Big hints are large tool tips which describe the active feature or provide other helpful information. This is what the big hint looks like:

Read more…
Let’s assume that we need to highlight all local variables with incorrect names using CodeRush Code Issues technology. For example, the name is incorrect if it starts from an upper case letter instead of a lower case letter. Follow these steps to get the IssueProvider component working:
- Create a new DXCore plug-in if you haven’t done it yet
- Drop the IssueProvider control on the plug-in designer surface
- Fill the ProviderName property of the IssueProvider
- Fill the Description property of the IssueProvider if needed
Read more…
The IssueProvider component represents a particular code issue check provider, which verifies the source code. This component is a part of the Code Issues Analysis Engine from the CodeRush. The newly created provider will be automatically registered once DXCore/CodeRush is loaded. You should be able to see it appear on the Editor | Code Analysis | Catalog options page in the Options Dialog.
Read more…
The ThirdPartyExtensions service provides methods to check whether or not specified Visual Studio 2010 extensions are installed and/or enabled. This service also contains a few useful properties for the Microsoft Power Tools extension.
Read more…
The ActionHint service provides methods for manipulating of action hints and tweaking its settings for the current Visual Studio session.
Read more…