53

e.g. alt enter -> context menu -> Find all 'Redundant name qualifier' issues -> but now in the new window that lists all those issues in my project, is there a way to fix them all ? (rather than go through them individualy)

ta.

5
  • 2
    In case anyone still stumbles across this: You can do this now, since Resharper 8.0. Apparently it's called the "Fix in Scope" feature.
    – Flo
    Sep 3, 2013 at 12:44
  • 1
    Just tried to use this feature but it's severely limited. See: jetbrains.com/resharper/webhelp/…
    – Karle
    Oct 8, 2013 at 21:39
  • Fix in Scope seems pretty strong now. I'm using ReSharper 9. Dec 29, 2014 at 18:50
  • Use Indexer still isn't in scope for fix in scope :-(
    – Squirrel
    Apr 21, 2015 at 14:04
  • I've started using some of Resharper's bulk fix functions, but, I'm still really disappointed that so few fixes can be applied in bulk. There are so many problems that it can detect that it can't fix across a project/solution. The other feature is a feature that lets you know which features can be bulk applied. I have only found the bulk fix features by hunting around on forums like this. Another annoying thing is that it opens up every single file as a document in Visual Studio which is a pointless waste of resources and slows down the performance. May 2, 2017 at 1:12

5 Answers 5

34

For now, you have to go through the issues individually. There's an existing request to batch-apply fixes to all similar issues selected in the "Inspection Results" tool window.

Code Cleanup does batch-remove certain issues in any given scope but it's quite limited in the number of fixes it can apply, compared to the number of code issues that ReSharper is able to detect.

13
  • 26
    it is incredible that this option is not available. Having similar issues in a list, the menu of fix options would be the same, so this is pretty easy to implement.
    – user694833
    May 8, 2012 at 16:31
  • 1
    Is this still not fixed with resharper 7?
    – joncodo
    Sep 13, 2012 at 18:51
  • 2
    Dan, that's correct, thanks for noting this. We're also developing Fix in Scope further for 9.0. For example, we've already implemented mass naming fixes. Apr 10, 2014 at 17:53
  • 2
    Really? 5 years and 4 versions later, we still have to Alt+Enter every single squiggly? Even when it's all listed right there? Can't just select multiple -> alt + enter? Beyond lame.
    – RJB
    May 6, 2016 at 18:00
  • 2
    It seems incredible to me that they implemented the whole "Find similar issues" functionality only to have an Inspection Results window that is completely useless. Really, export? Why would I ever want to do that!
    – Coxy
    May 24, 2016 at 7:46
26

Click into a redundant qualifier, alt+enter, then choose from the context menu that lets you fix the issue however thoroughly you'd like.

Resharper options to remove redundant qualifier

I'm running ReSharper 8.2.

enter image description here

17

Yes, you can use ReSharper's "Cleanup Code" to remove redundant qualifiers (amongst other things). This is available from the context-menu when you right-click files, projects and folders in the Solution Explorer window. Code Cleanup will run over all the selected files, reformatting and fixing common issues - it is also customizable.

7
  • 8
    If you are going to use code correct features such as this I highly recommend that you do a diff on each file changed and confirm the changes. I would NEVER run something like this on production code without a line by line inspection (changes) after running it.
    – tsells
    Sep 2, 2011 at 15:03
  • 4
    @tsells I've been doing this for years, it's FINE.
    – Tim Lloyd
    Sep 2, 2011 at 15:06
  • 4
    I would disagree. Every piece of software has the potential for bugs. What happens when the next release of resharper contains some unknown race condition that your code happened to raise. Now your code will still compile - but depending on what changes to your code were made - you may now have a bug in your code that your clients will suffer for. You should never check in code without knowing EXACTLY what changes were made.
    – tsells
    Sep 2, 2011 at 15:17
  • 5
    Except that your answer throws a subtactical cleanup nuke on the code that addresses way more issues than the original "Fix this kind of errors". I agree with tsells that you should not blindly check in all the changes ReSharper believes are The Right Thing without making sure it actually is the right thing.
    – Cornelius
    Oct 12, 2011 at 9:24
  • 4
    I agree with the caution expressed, however I also agree with @TimLloyd that, unless you're using reflection (including serialization; ESPECIALLY BinaryFormatter), you will be fine. I would even go so far as to argue that if your code can't "withstand" a ReSharper cleanup, you're doing something else wrong.
    – Jeff
    Oct 16, 2013 at 3:21
7

This is available (in part) in the latest build. If you go to a specific issue in the code editor, click the lightbulb the fix option now has a submenu for some issues that can be applied to the entire solution. Would be cooler if it was available from the Code Issues window, but still a great improvement.

New Fix in Scope Options https://www.jetbrains.com/help/resharper/2016.1/Code_Analysis__Fix_in_Scope.html

-2

No use for Resharper Just Go To Visual Studio

Analyze Menu Code Cleanup Menu Run Code ....tion

And Complate

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.