Questions tagged [fxcop]

Microsoft's free static analysis tool for analyzing .NET managed code assemblies.

FxCop can be used to find coding design issues quickly and early, comes with switchable rulesets, and supports the creation of custom rules.

Available with certain versions of Visual Studio and as part of the Windows 7 SDK, available here.

749 questions
0
votes
1 answer

More FxCop findings in release build than in debug build

I have found that there are more findings generated when running FxCop against release build than debug build. Anybody experienced the same issue?
Jin
  • 1
0
votes
0 answers

FxCop analysis error: Key needs to be greater than 0

I am currently trying to setup code analysis for a legacy WPF application. As part of this I am running FxCop 10.0 but I'm receiving errors for some of my DLLs, all of which build successfully. The error that I'm getting is: When I get this it is…
Fermin
  • 34,961
  • 21
  • 83
  • 129
0
votes
2 answers

FxCop rule list subset for ASP.NET web application

We are in the process of integrating FxCop with VS 2010 professional for code analysis using the FxCop Integration VS Extension. We have seen that with all the default rule sets that are configured in FxCop, we are getting a whole bunch of points…
koder
  • 887
  • 9
  • 29
0
votes
2 answers

How to detect calls to a SPECIFIC method in FxCop via a custom rule -- what to put in Check method

I want to disallow calls to a specific method (MessageBox.Show) via a custom FxCop rule. I know the mechanics of how to get an FxCop rule custom-implemented (the XML file, inheriting from BaseIntrospectionRule, etc.) My question here is what I put…
user1372957
0
votes
2 answers

Sonar fxcop plugin with maven fails

I try to run mvn sonar:sonar and I get this: [ERROR] Failed to execute goal org.codehaus.mojo:sonar-maven-plugin:2.0:sonar (default-cli) on project YamarinArtifactId: Can not execute Sonar: FxCop execution failed. FxCop execution failed with return…
tplehton
  • 21
  • 1
  • 4
-1
votes
1 answer

CA1062 Validate arguments for protected event handlers?

If we don't check the EventArgs in a protected event handler, FxCop raises CA1062: Validate arguments of public methods Yes, someone could theoretically inherit from my page class and call my protected event handling method as though it were a…
sq33G
  • 3,320
  • 1
  • 23
  • 38
-1
votes
1 answer

FXcop option is not shown under General setting in SonarQube hosted site

I'm not able to see FxCop option under General setting in SonarQube hosted site. Because of this I'm not able to set FxCop installation directory path to SonarQube hosted site. Also when I'm running sonarRunner with FxCop custom rule enabled in…
Rasik Bapotra
  • 35
  • 1
  • 8
-1
votes
1 answer

Static Code Analyzer doesn't require to build

Maybe this question doesn't make so much sense but I was wondering if there is out there any Static Code Analyzer (C/C++/C#) that warns me about issues on source code files without building the project itself... I would love to flag the kind of…
user3587624
  • 1,427
  • 5
  • 29
  • 60
-1
votes
1 answer

FxCop 12.0 for Visual Studio 2012

Microsoft Stopped providing FxCop 12.0 separately.It comes bundled with VS 2013 and we are using VS 2012 on our build machines.So is it possible to get FxCop 12.0 with out installing VS 2013? If so please suggest. Thank You
Raviteja
  • 1
  • 4
-1
votes
1 answer

Import custom FxCop rules to sonar

Please help me, Custom assembly : C:\Program Files (x86)\Microsoft FxCop 1.35\Rules\my\DOTNET.dll Rules file : D:\SONAR\extensions\rules\fxcop\DOTNET.xml I click on restore profile and backup this file: export.xml -- after import is 0 rules What is…
-1
votes
1 answer

PresentationFramework DLL could not be loaded

I am running a TeamCity build which is running FXCop Analysis. Getting the following error: [INFO] 2>Project : error : CA0058 : The referenced assembly 'PresentationFramework, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' could…
Arpit
  • 6,212
  • 8
  • 38
  • 69
-2
votes
2 answers

Code analysis using fxCop for C#..NET projects to display its results in Sonar

I am in need of running static code analysis using fxCop for C#..NET projects and display its results in Sonar? I am new to Sonar. Can I run FxCop from Sonar on .NET code. How would I do this and get the results displayed in sonar?
Sal007
  • 67
  • 1
  • 8
-2
votes
1 answer

unreachable code detected in a foreach

I have got this warning in vs2012 but can't figure out where is the unreachable code. private void LoadGridData() { string currentUrl = SPContext.Current.Site.Url; var jobInfoList = new List(); …
Luis Valencia
  • 32,619
  • 93
  • 286
  • 506
-2
votes
1 answer

Fix FxCop CA1062 by generating validation for parameter

Turning the Code anlyisis on for a big project is showing a huge amount of CA1062 wanings, which are absolutely right IMO. I would like to handle these automatically without having to go through each one,is there anyway to automate this in the…
CloudyMarble
  • 36,908
  • 70
  • 97
  • 130
1 2 3
49
50