I've got the latest mspec from the codebetter teamcity site and installed the Resharper5.1 runner as suggested. The runner and the annotations show up fine in the resharper option dialogs.
Now even with the annotations library ticked I still get "field xxx is never used" warnings everywhere and when I ask resharper to run all tests in the solution it doesn't seem to find my specifications.
I have unblocked the dlls.
Using resharper 5.1.
"Field xyz is never used" warnings only go away for classes that have the Subject attribute applied. If you don't use Subject you can work around the issue by disabling warning 169 in your spec projects.
Some questions about your issues with solution runs:
Did your enable MSpec under ReSharper | Options | Unit Testing?
Do specification runs for projects
(as opposed to solution runs) work
for you?
Can you start
specifications by clicking the
green/yellow icon in the gutter?
Does the Unit Text Explorer window
correctly reflect the solution's
contexts and specifications?
Related
I've run SonarQube analysis on my Android/Java project and it resulted, among others, with issues:
Sections of code should not be "commented out"
If SonarQube is able to identify them, is it possible to automatically commented out code in Android Studio? I can't just remove all comments, because there are also some that are legit.
I have 500+ of them and don't want to do it manually. Any ideas?
There is no general solution for issues reported by SonarQube since SonarQube only finds problems, it doesn't offer a way to fix them.
In this particular case of commented out code, the same check is available directly in IntelliJ.
from the menu, select "Code | Analyze Code | Run Inspection by Name"
type "commented" to select the inspection about commented code
run it on the whole project
This inspection now lists the occurrences, and the Problems tool window offers you to fix all of them at once.
is it possible to only enable resharper for javascript and css files? I don't want it inspecting my c# files as it's driving me nuts with it's styling and and at times somewhat controversial recommendations. I haven't got time to set each individual setting, I'm just looking for a "don't inspect c# files" check box, if there isn't one I think my resharper trial will be officially over.
If you really want to disable ReSharper for C#, try going to ReSharper | Options -> Code Inspection | Settings -> Edit Items to Skip and add a file mask to skip *.cs.
But better way would be to disable those ReSharper warnings that you don't like. To do this, click Alt-Enter on the suggestion that you don't like, go to Options submenu, select Configure inspection severity and then Do not show. This is for ReSharper 8.0, in 7.1 it should be pretty similar.
Today I tried to made "Code Cleanup" of single file in ReSharper 6.0 (VS 2010). The Code Cleanup dialog did not show up so I tried again.
I then discovered, that the feature is grayed out and when I press hotkey for Code Cleanup, the notification area shows that the "command is not available at the moment".
Even the Code Cleanup settings are hidden. The panel where settings should be shown says that the settings are solution-specific and thus a solution needs to be opened (although it is, however).
All other solution-specific settings and features work, except for Code Cleanup.
I want to avoid re-installing ReSharper or resetting its settings, because otherwise I would need to set it up again (long and annoying work of setting all the options as before re-install).
I am afraid that backing up settings and restoring it again restores the problem as well.
Any suggestions?
Suggestions:
Ensure that the file that you're trying to cleanup is included in your solution.
Try to reopen solution (close and then open again).
Upgrade to 6.1.1, maybe its fixed there.
File a bug report at http://youtrack.jetbrains.com
Both ReSharper 7 and 8 seems to work OK.
I know this is an old answer, but I found a little more insight on this. According to Jerrie Pelser in this blog post from last year, this may have to do with the file being part of a NuGet package. In my case, this was definitely it!
In case of link rot, basically the post mentions that ReSharper will avoid refactoring/code cleaning for files it detects were added as part of NuGet packages. This is similar to how it will not allow code cleanup for generated code.
Has anyone used JustCode from Telerik lately? This question has been asked about two years ago, but I'm sure the issues must have been resolved by now. Especially referring to running it side by side with ReSharper.
I have been using Resharper for a while now. I decided to try JustCode to see how it behave.
After a week of using JustCode, I am uninstalling it and returning to Resharper.
What I like about JustCode:
A single window indicating all warnings/errors in entire solution.
Performance seemed to be a bit better than Resharper.
Refactoring is easier to get to.
Projects can be excluded, or type of file
Language can be excluded (such as XAML)
What I did not like about JustCode:
Sometimes the underline used to open the option for fixing or refactoring is frustratingly hard to click since VS also puts an underline at the same spot (and it is the context menu of the latter that pops up).
Cannot change an hint to be a warning instead.
Saw some minor bugs
JustCode was giving hundreds of false positive warnings in the XAML code (luckily I could turn the inspection of XAML off)
What I was missing from Resharper:
Warnings about method parameter missing/mismatch from the documentation
Hints to transform an expression into a Linq expression.
When writing an opening bracket, resharper automatically adds the closing one and puts you on an empty line in between the two.
When completing a method, Resharper adds the first parentheses. It also adds the last one if that method is parameterless.
I am sure there is a bunch of other stuff that I can't remember now
You can install both Resharper and JustCode alongside. I first suspended Resharper before installing JustCode and used JustCode fine. When I resumed Resharper and restarted VS, both were running together without error.
Together, Resharper was finding more than JustCode.
For example, JustCode did not give a warning for the following: "Value assigned is not used in any execution path."
It even missed an error: "Cannot convert type 'int' to 'bool'." The expression was:
if ((bool)CanDoIt) // Here CanDoIt is a property of type int.
{
...
}
All in all, the tool is not bad. I recommend it over not having any. But if you have the choice between Resharper and JustCode, go with Resharper... for the moment; JustCode is still young.
You can change the size of JustCode's smart tag or turn off Visual Studio's smart tag in JustCode's options menu. I prefer to access VS's smart tag by using ctrl+., so it hasn't been an issue for me.
I'm using ReSharper for my solution (that contains 10 projects) and I'd like to see the hints/suggestions/warnings/errors (listed in a window) for a chosen project. How can I do that?
Note: the solution analyzer window shows only errors.
In ReSharper 5, you can right-click solution explorer and select Inspect Code. It will show you all the issues found in the selected scope. There is a button on the toolbar to filter issues.
Doesn't seem to be an available option with the current release of Resharper...
We are not going to include warnings
in SWA in ReSharper 4 release cycle.
This is due to complexity of some of
analyses, due to complexity of UI to
deal with thousands of possible
warnings, and so on and so forth. We
are going to improve SWA in many ways,
we have a lot of plans, but they need
some time to implement. I can't say
any specific dates right now, but I
think we can add more solution-wide
features in the next major release
after ReSharper
4.0.
As a workaround, you can set severity of warnings you are
interested in to the "error" level.
You may have to restart VS to force
SWA reanalyse files.
Source:
http://www.jetbrains.net/devnet/thread/273096