InspectCode 10.0.2 presents different results than Resharper 10.0.2 inside Visual Studio

 Hi,

I want to get exactly the same results using code analysis from InspectCode and Resharper but I get different results.

Today I have downloaded the latest versions of the Inspect Code 10.0.2 and the R# 10.0.2. I prepared some small solution with just few classes. I compared code analysis results using the following approaches:

  1. I executed inspection from Visual Studio 2015 using the following command: Resharper -> Inspect -> “Code issues in solution”. After that I saved result into xml file.
  2. I executed InspectCode with output parameter to save result in the xml file.

At the end I compared both results and everything was OK. I decided to check how it works with some bigger solution so I downloaded source code of the EntityFramework from github (master branch) and removed EntityFramework.sln.DotSettings file. I generated the results as I described with previous solution but results are completely different. I tried to execute code analysis with and without solution-wide analysis but it doesn't work. Below is the list of issues I got in each run.

  • R# with solution-wide analysis: 31106 issues found
  • R# without solution-wide analysis: 19287 issues found
  • InspectCode with solution-wide analysis: 41553 issues found
  • InspectCode without solution-wide analysis: 24272 issues found

Why doesn't it work?

5 comments
Comment actions Permalink

This deserves a response.

We use InspectCode as part of a SonarQube analysis run. We get a large number of issues incorrectly raised on the source code e.g. 'Using directive is not required...' warnings in large solutions is very common but removing them means the code no longer compiles.

These spurious warnings cause credibility issues when trying to get developers and management to address more important technical debt and we are seriously considering dropping InspectCode which could have a knock-on effect on our ReSharper licensing.

1
Comment actions Permalink

We are introducing R# and were happy to see that there is a TFS plugin. But as long as InspectCode returns different results that R# it is pretty useless.

0
Comment actions Permalink

Hi again,

i did now run inspectcode and R# on the same solution and i can say the output is completely different:

R# has no warnings, but a lot of hints and issues

inspect has warnings and less hints

i am only using team settings, do have only .sln.DotSettings file

update: i was able to get rid of most of the warnigs with turning off the solution-wide-inspections, but the results between the two tools still do differ

 

0
Comment actions Permalink

I came here to post about this exact same problem and found this thread. It's 2018 and I guess this still hasn't been addressed.

I even created a brand new UWP Solution, removed all the issues from code, then added this line of code:

string test = "tmp"; 

So naturally I get only these 2 issues:

  1. Use 'var' (built-in types)
  2. Local variable 'test' is only assigned but its value is never used

So then I run the CLI tool without setting a severity, and I get only the second issue, which is understandable because the default severity is Suggestion and up, so naturally the first issue (a Hint) wouldn't show up.

Ok, so let's add /s=HINT so we can see the first issue as well, and the result is the same as above, except now we have a third issue:

  • Inconsistent modifiers style: missing 'internal' modifier

Where did that come from? I have all the filters checked in Visual Studio but it never shows up, and when I go to the class with the issue, there is no indication about this issue.

We would like to use the CLI tool in our build process but the results are really inconsistent. Would it be possible to at-least use the CLI tool in Visual Studio somehow?

Thank you.

0
Comment actions Permalink

Some bugs were fixed in Resharper in 2018.x version, I suggest updating and trying again!

0

Please sign in to leave a comment.