CodeIt.Right Evaluation Guide
Part 1: Get a feel for it - Key features of CodeIt.Right
- What is CodeIt.Right?
- Profiles
- Instant Code Review
- OnDemand Code Review
- Violations Report
- Rules and Rule Instances
- Check-In Policy (EE)
- Build Process Integration
- Reporting
- Metrics
- Generate Guidelines Document
Part 2: Try it Out - Suggestions for features you can try
- Start/Stop Instant Review
- Run an OnDemand Review
- View an individual violation
- Correct a violation
- Correct multiple violations
- Undo corrections
- Adjust Severity Thresholds
- Export a Violations Report
- Create a Pivot View Report
- Create a Metrics Report
- Edit an existing profile
- Create a new profile
- Publish a profile
- Create a Custom Rule
- Extend an Existing Rule
- Generate Guidelines Document
Part 3: Get back to us - Questions, Comments, Need more time?
This guide is designed to help you discover and try out the key features of CodeIt.Right to help you quickly assess the benefits of this product.
Part 1: Overview - the main features of CodeIt.Right
What is CodeIt.Right?
CodeIt.Right is a tool that automatically checks that your source code adheres to your predefined requirements, style guidelines and best coding practices. It does this by testing your code against those requirements, guidelines and practices and then automatically and safely refactoring the issues into conforming code. To make the process easier, hundreds of pre-defined rules, based on industry standards, ship with the product and can be included in the analysis. You can of course add your own rules and you can exclude any predefined rules you don't want applied.
The analysis can be run in real time, with issues being flagged while code is being written, or can be called on demand when required. It is fully integrated into Visual Studio from 2005 right up to the 2013 edition. It can also be incorporated into source control check-in policy and within build process integration.
By automatically analyzing code at source, CodeIt.Right improves the product quality, ensures that code complies with internal or regulatory quality initiatives, saves time and cost of code reviews, and reduces QA testing time. In summary, by automatically analyzing your code at source, CodeIt.Right ensures continuous high level, conformant code quality.
Profiles
A CodeIt.Right Profile is a comprehensive collection of rules that can be applied against your code. The two Built-In Profiles that ship with CodeIt.Right are:
- Microsoft Guidelines Profile and
- SubMain Instant Review Profile
These are easily accessible from the main CodeIt.Right menu.
The Built-In Microsoft Guidelines Profile contains 300+ rules configured to comply with Microsoft Design Guidelines and best industry practices. By default, most of these rules are turned on - meaning that they will be applied to your code during the analysis - but you can turn individual rules off and on as you wish.
In addition, the SubMain Instant Review Profile, which again contains 300+ individual rules grouped into logical sections, includes many of the same rules as the Microsoft Guidelines Profile but only a carefully selected number of rules are turned on by default. These are specifically the rules that are relevant at the stage when code is being written.
You can of course turn any of these rules on or off to meet your requirements.
You can switch between these profiles whenever you need - either when running Instant Review or OnDemand Analysis. You can use these Built-In profiles as the basis for new profiles you create for your precise needs (see this item for more information).
Instant Code Review
The Instant Review feature of CodeIt.Right allows for the real time analysis of code as it is being written. The analysis is based on the profile you have currently chosen and any newly written code line that contains code that doesn't conform to a checked rule in that profile is immediately flagged up:
As you can see from the screenshot above, not only is the violation flagged up and described, but you can immediately correct the violation by clicking on the Correction Option. Alternatively, you can choose to ignore the violation.
Instant Review keeps developers on track as they code and brings an additional benefit. Experience shows that over time the recurring prompts help developers to get into the habit of writing code that conforms to the rules.
In addition to the dialog box that pops up for each individual violation, Instant Review includes a Violations Bar at the right hand side of the code window:
This identifies all violations of the selected rules in the current file and, like the individual highlight on the code line, each violation listed in the Violations Bar is color coded by severity.
OnDemand Review
The OnDemand feature of CodeIt.Right lets the developer run the code quality analysis whenever it's convenient. Unlike Instant Review (see previous section), OnDemand lets the developer get on with code writing without interruption. Clicking the Start Analysis button will get the review under way and a Violations Report will be created and displayed on screen (see next section).
See this section for details of how to try out this feature.
Violations Report
The Violations Report displays a comprehensive listing of all issues found in the analysis, broken down into logical groups. You can sort and filter the issues displayed, read detailed information on every issue raised, then have CodeIt.Right automatically correct any or all of the violations in the list.
A wide range of menu and filtering options are available at the top of the report. See this section for details of how to try out some of them. Below that, the color coded violations are listed in the main body of the report.
A typical report might look like this:
In this example, the issues are grouped by severity. Then each line contains detailed information about the violation, including its
- location
- description
- category
- severity and
- recommended action
In addition, a checkbox allows for the selection of individual items to be corrected - the correction being implemented when the user clicks on the Correct button for the item. The report also lets the user correct a selection of issues (or all the issues) in one go.
Selecting an individual item reveals detailed information about the issue:
Rules and Rule Instances
Each CodeIt.Right Profile contains a collection of Rules which are implementations of the CodeIt.Right SDK IRule Interface. Each rule that's created using this Interface has its own logic to detect a violation and optionally also includes logic to correct the violation. Each Rule contains a number of configurable properties. In addition to the rules that ship with CodeIt.Right, you can build your own custom rules based on the IRule Interface.
A Rule Instance is a configured instance of one of these rules. You take the base Rule (either a CodeIt.Right created rule or one of your own custom rules) and you change one or more of its configurable properties. This creates a specific implementation of the generic rule. This Rule Instance is then saved as a selectable option in a CodeIt.Right profile.
The Rule is the general class; the Rule Instance is a specific implementation of one of those general rules, with one or more of the configurable properties set. See this section for links to more information of the options available to you.
Check-In Policy
The Enterprise Edition of CodeIt.Right integrates seamlessly into your Source Control procedures, letting you scan files, highlight issues or violations and fix them before check-in. Because you can test the code against any configured profile, you can be sure that it conforms to the team's requirements before it's allowed to be checked in. See this tutorial for more information on how this works.
Integration into the Build process
CodeItRight.Cmd is the command-line companion to CodeIt.Right. Just like the Visual Studio based version, CodeItRight.Cmd analyzes source code and reports violations, such as possible design, performance, and security issues. CodeIt.Right.cmd can be integrated into your Build process using the command line interface directly or MSBuild and NAnt tasks. You also will find walkthroughs and sample integrations with TeamCity, CruiseControl.NET and Jenkins CI.
Follow this link for more details of the options available.
Reporting
With CodeIt.Right you can create reports and pivot tables that can then be customized, saved for future reuse, exported, emailed and printed. The very powerful pivot reporting features of CodeIt.Right let you view and analyze the health of your code base in many different ways. You can compare violations or violation categories by project or file, projects by violation severity and category - these are just a couple of examples that are shipped out of the box. But you are not restricted to built-in reports - you can use the data filtering and sorting options to your own custom reports.
Follow this link for details on how to create and fine-tune these reports.
Metrics
This feature is available only in the Enterprise Edition of CodeIt.Right. Use Code Metrics to gain insight into the overall complexity of your applications and to spot potential problem areas that should be changed or tested. Code Metrics are also useful for analyzing code you may not have written, but have to maintain.
The range of metrics available includes:
- Member metrics
- Cyclomatic Complexity, Lines of Code, Statements, Locals
- Type Metrics
- Depth of Inheritance, Fields, Methods, Properties, Events, Nested Types
- Code Metrics
- Types, Code Lines, Lines, Empty Lines, Comment Lines
Generate Guidelines Document
The Generate Template feature of the Profile Editor allows you to create an electronic or printed team guidelines document at the push of a button. CodeIt.Right gathers all the information from the profiles you have created or edited.
Because this document is created using XML and an XSLT stylesheet, rendered in HTML, you can edit the stylesheet in any way you choose - for example, removing sections you don't want to include. The produced HTML document can be saved as a Word or PDF document and distributed to teams or viewed online in its HTML format. The document is created based on the profile of your choosing that you configured to implement your own team guidelines.
Part 2: Try it Out - Suggestions for features you can try
Try out Instant Review
To turn on Instant Review, simply click on the Instant Review icon in the toolbar:
Immediately, all violations in all open files will be highlighted. You can see from the image below that the code in the above screenshot has been analyzed and some violations found and highlighted in red, blue or green by CodeIt.Right:
Try this with a code file of your own and then type in some code that you know will violate a rule. You'll see this violation immediately flagged up.
If you want to turn off Instant Review, simply click on the icon again. While Instant Review is turned on, you can instantly switch between profiles by clicking on the Review Now! Icon next to the Enable Instant Review icon.
Run an OnDemand Review
To run an OnDemand Review at any time, click on the Start Analysis item in the toolbar. When you click this button, you'll see a list of all projects in the current solution:
You can select the complete solution or an individual project for analysis. Simply making a selection will cause the analysis process to begin. At the end of which, a Violations Report will be created and displayed:
View details of an individual Violation
When you click on an item in the Violations Report, details of the issue will be displayed in the pane below the report:
(Note that you can get even more information by clicking on the 'Tell me more...' link, which will open the CodeIt.Right Help file at the relevant help item).
If you want to see the actual violation in the code file, then just double click on the item in the Violations Report. This will open the code file, set the cursor next to the violation and highlight the particular issue. In the example shown here, double-clicking the usage violation in the Violations Report brings up line 318 of the MultiDictionary.cs code file:
Correct an individual violation
You can correct any or all the violations listed in the report. To begin with, you may want to confirm that all the issues raised are things you want corrected. So scroll through the list and to try it out pick an item you definitely want corrected. Then click on the 'Correct' button at the right hand side of that issue.
The violation will be corrected and the item in the Violations Report updated to show this has been done. The item will be color coded Black, the text struck through and the 'Correct' button disabled:
Note that violations that have more than one valid correction choice have a dropdown arrow to the left of the 'Correct' button. Hover over or click on this drop down button to see the corrections available and optionally choose one of them.
Correct multiple violations
You can correct all selected violations with one button click. Selected violations are those that have a check in the 'Correct' option column of the report.
Note: Although this is a very powerful feature, we strongly recommend that while you are evaluating CodeIt.Right you use it with very great care. You should resist the temptation to batch correct hundreds of violations in one pass until you fully understand the implications.
Note: The Correct All feature has been changed to optional and is turned off by default in the most recent versions. You can enable the Correct All in CodeIt.Right using Options -> General -> Allow batch correction action.
When you think about it, you'll see that there may be unwanted side effects if you change countless lines of code in one pass, because a change on one line may have an impact on others that are then changed, possibly breaking your code. Once you are familiar with the product and have configured and tested your own set of rules, that would be the time to start experimenting with batch corrections. So, while evaluating just try out and enjoy the many other correction option features of CodeIt.Right and the Instant Code Review, so you have a chance to review the corrected code quickly and easily.
To have all checked violations corrected in one pass, simply click the 'Correct Checked' button at the top of the Violations Report.
Note that in the example above, not all the issues have been checked and only the checked items will be corrected. You can change this setting so that every violation found is corrected by clicking on the 'Check All' button first.
The 'Clear All' button reverses this setting.
Undo Corrections
To undo one or more corrections, use the standard Visual Studio button and select the reversals to want to apply.
Adjust the Severity Threshold
To reduce the size of the Violations Report or to concentrate on high impact issues, alter the Severity Threshold by selecting a new value in the Severity Threshold combo box:
Make a selection from this combo box and the Violations Report will be automatically updated to show all violations of the severity you selected and higher. So in the above example, the report will show all Error and Critical Error issues.
Export a Violations Report
To export a Violations Report to either Excel or XML format, just click on the appropriate icon at the right hand side of the toolbar:
You will be prompted to select a location to save the file, which will then be built and can be displayed:
Create a Pivot View Report
To try one or more of the Pivot View Report options, click on the Pivot View button at the top of the Violations Report and then select one of the report types from the combo box:
Try the Violations by Project option to see a side by side comparison of issues in projects, grouped and totaled by category:
To home in on issues you are most interested in, hover the cursor over Category column header until the small filter icon appears. Click on this icon, then choose categories to include in the report:
Click on the Refresh button to regenerate the filtered report. Then save it, export it to an Excel file or print it out, using the buttons at the top of the report:
Experiment with the other pivot report types, such as Project File by Category:
Tweak the output by using the filter icons available in any of the groupings:
- Item
- Type
- Violation
- Severity
- Category
- Project
- File
These can all be selected from buttons or column headers at the top of the report:
Try dragging and dropping headings between the Columns area and Rows area to create sub-categories used to fine-tune the layout of the report. As an example, you could drag the Severity button to the Columns area so that the columns are sorted by Severity instead of rows.
You can create the exact configuration for the reports you want and then save them for later re-use by selecting the Save View button.
Create a Metrics Report
Try the same kind of report creation using drag and drop between the Column Fields and Rows area as described in the Pivot View Reports above.
Edit/Clone an Existing Profile
Editing an existing Profile in CodeIt.Right is very easy. See this tutorial for how to do this.
Create a new profile
To create a new profile from scratch is also simple. Follow this link and then scroll down to the second section - 'Creating new profile' in that tutorial.
Publish a Profile
With the Enterprise Edition you also have the option to publish your profile, which contains your configured coding standards, to you team. See this walkthrough for the steps involved.
Create a Custom Rule
To add a custom rule to a profile, follow the step by step guide published here.
Extend an Existing Rule
You can tweak individual methods in an existing rule as shown in this tutorial.
Generate Guidelines Document
To try this feature out, click on the Profile Editor button in the CodeIt.Right toolbar. Then, select the Generate Template button from the Profile Editor:
In the Save File dialog that appears next, enter a file name and locate to save the template. After you click the Save button, you will be offered the chance to view the generated guidelines document template immediately - choose Yes to see the document rendered in Internet Explorer.
Part 3: Get back to us - Questions, Comments, Need more time?
Contact Information
Have a question? Email us at customer-service@submain.com or call 1 (800) 936-2134
Request a Quote
Make your first step towards enjoying the new product - request a quote by emailing us at sales@submain.com
Need more time to evaluate?
If you need more time to evaluate the product, you can request an extension - just email us with your trial results and tell us how much more time you need for a thorough evaluation customer-service@submain.com
Resources Summary
- CodeIt.Right Tutorials, eBooks and Webcasts
- How to create own Profile
- Publishing Custom Configured Coding Standards to Your Team
- Creating Custom Rules
- Extending Existing Rules
- Check-In Policy Integration
- CodeItRight.Cmd.exe Command Line Options