Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Address code analysis warnings #45

Closed
4 tasks done
adamralph opened this issue Feb 10, 2013 · 4 comments · Fixed by #103
Closed
4 tasks done

Address code analysis warnings #45

adamralph opened this issue Feb 10, 2013 · 4 comments · Fixed by #103

Comments

@adamralph
Copy link
Contributor

The core FakeItEasy project has 74 warnings. Other projects may also have further warnings.

In each case we should fix the code or suppress the warning, whichever is appropriate.

We should also consider our policy for running code analysis as part of the build. The issue here is speed. Code analysis can really slow the build down. If we do choose to run code analysis as part of the build, it should fail when there are warnings, as mentioned by @philippdolder (#36 (comment)).

  • switch to FakeItEasy ruleset
  • address warnings
  • switch all warnings to errors
  • switch on analysis for all release builds (if desired)
@adamralph
Copy link
Contributor Author

@adamralph
Copy link
Contributor Author

Managed to answer my own SO question ;-). Now I have to decide how to resolve the warnings.

@adamralph
Copy link
Contributor Author

@FakeItEasy/owners does anyone know why the obsolete Configure.Fake<TFake>() has been left in the net35 and SL projects but is not in the net40 project?

I'm getting a code analysis warning because the Obsolete attribute does not have a message. I'm wondering if I can just remove the type altogether. This would be a breaking change but I'd be reluctant to increment the version to 2.0 just for this. Alternatively I can just add a message. Something the following?

Use A.Fake<T>() and A.CallTo() instead.

@adamralph
Copy link
Contributor Author

I did some metrics to gauge build times with code analysis switched on vs off.

Type On Off
Rake build (inc. version and clean) 37s 20s
VS Rebuild 15s 8s

I think we should leave code analysis switched off for Debug builds (which is what we do most of the time in VS). But switch it on for Release builds (rake).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant