Taking a look at ReSharpers Code Issues Feature

 

A good way to get acquainted with a new solution I find  is to fix some bugs or do some refactoring. To better get accustomed to working with NBehave I’ve decided that cleaning up some code and doing some refactoring is in order.

Besides stepping through the code and refactoring, tools like StyleCop (with the excellent associated ReSharper plugin), warnings as errors and resharper suggestions are good ways of quickly improving code quality.

So I’m going to take a look at cleaning up those ReSharper warnings and get rid of those haunting yellow lines. Before version 5 you would need to manually go through each source file and apply the suggestions, but now there’s some new handy tools to help.

image

This brings up a new tool window which highlights all the suggestions for an easy overview on what needs attention.

image 

Ouch! It looks quite intimidating however I’m sure most of these are non-issues and can be sorted quite quickly. I hope anyway. It groups up all the errors by source file, however you can slice this up with the filter and toggles provided. The preview window is quite nice and lets you see where the problem is:

image

It’s a shame they didn’t use the standard editor and syntax highlighting but that’s a small qualm. Let’s do something productive and get these issues out of the way. Double clicking on each warning takes you to the source where you can apply quick fixes using alt-enter. However unfortunately there doesn’t seem to be a way to bulk apply quick fixes, Doh!

I’m loathe to manually quick fix this volume of warnings, so perhaps a combination of pattern refactoring and code cleanup might bring the number down quicker… let’s hope version 6 brings some bulk functionality in.

Update: At least for me, after fixing an issue the go-to functionality on the rest of the issues breaks which is quite show stopping. Blogs are no place to submit bugs, but just a heads up as YMMV.

September 29 2010
blog comments powered by Disqus