Sign in
Code Analysis Team Blog
Translate This Page
Translate this page
Powered by
Microsoft® Translator
Tags
ASP.NET
Books
Bugs
C++
Code Analysis
Code Analysis Policy
Code Metrics
CodeCommunit Analysis
Community
Configuration
Custom Rules
Documentation
Dogfooding
Exceptions
FAQ
Framework Design Guidelines
FxCop
Pages
Releases
Rules
Suppressions
SuppressUnmanagedCode
Team Build
Team System
Tips and Tricks
Tools
tsbt-dev
Visual Studio 2005
Visual Studio 2008
y
Browse by Tags
MSDN Blogs
>
Code Analysis Team Blog
>
All Tags
>
rules
Tagged Content List
Blog Post:
Fun with Code Analysis Rule Sets
cristend
Two weeks ago, I introduced you to Visual Studio 2010 September '08 CTP (Community Technology Preview). This CTP is available as a Virtual PC (VPC) image which can be downloaded at http://go.microsoft.com/fwlink/?LinkId=129231 . The goal of the Community Technology Preview is to obtain feedback from...
on
12 Nov 2008
Blog Post:
New for Visual Studio 2008 SP1 and FxCop 1.36 – Multi-targeting rule
David M. Kean
I've just published a post over my blog about a new feature we added for Visual Studio 2008 SP1 and FxCop 1.36. New for Visual Studio 2008 SP1 and FxCop 1.36 – Multi-targeting rule
on
25 Aug 2008
Blog Post:
FxCop 1.36 Released!
brettwo
We are pleased to announce that we've released the next version of FxCop . This release has a number of changes since FxCop 1.36 Beta 2, including, but not limited to, the following: Bug fixes that reduce noise, missing analysis and rule crashes. New portability rule: Use Only API from...
on
19 Aug 2008
Blog Post:
New for Visual Studio 2008 - Custom Dictionaries
David M. Kean
Once you turn on the new spelling rules that we've added to Visual Studio 2008, you will want to start to customize the words that it fires on; this is where the new custom dictionary support comes in. A custom dictionary in its basic form, similar to the concept in Microsoft Word, allows you to silence...
on
20 Aug 2007
Blog Post:
New for Visual Studio 2008 - Spelling rules
David M. Kean
Surprisingly, one the biggest requests for Code Analysis in Visual Studio 2005 was to include the spelling rules that shipped with the FxCop standalone. We had Microsoft consultants tell us that they actually had trouble moving some customers from FxCop to Code Analysis because they were not included...
on
12 Aug 2007
Blog Post:
What rules do Microsoft have turned on internally?
David M. Kean
I've recently received a few requests asking about the Code Analysis rules we run internally against Microsoft's own code. While it might come as a surprise, we do not actually run every single rule against our own binaries. There are many reasons for this: Applicability . Not every rule is applicable...
on
9 Aug 2007
Blog Post:
TIP: How to change the (Orcas) Managed Code Analysis naming/design rules to fire on internals
David M. Kean
A while ago I mentioned that FxCop (and hence Managed Code Analysis) naming and design rules only fire on publicly visible types and members. As you may recall, there were a couple of reason for this: The .NET Framework Design Guidelines , which FxCop/Managed Code Analysis enforces, only contains...
on
8 May 2007
Blog Post:
What resolutions or warnings need to provide more information?
David M. Kean
One of things that we are doing for Orcas, is to basically do what we call a resolution scrub . This is where we print out every single possible resolution/warning and read over them to check for consistency, proper grammer and to see if they provide enough information for the user to both understand...
on
3 Feb 2007
Blog Post:
How to Design Exception Hierarchies
David M. Kean
Krzysztof Cwalina, owner of the Framework Design Guidelines , has written a great post on designing exception hierarchies . He gives a great overview on the different categories of exceptions, which are placed under two main buckets he calls usage and system , and the right situations to throw them....
on
1 Feb 2007
Blog Post:
FAQ: What exception should I throw instead of the reserved exceptions that DoNotRaiseReservedExceptionTypes warns against?
David M. Kean
Throwing a general exception type such as System.Exception or System.SystemException in a library or Framework forces consumers to catch all exceptions, including unknown exceptions that they do not know how to handle (see FAQ: Why does FxCop warn against catch(Exception)? for reasons as to why this...
on
22 Jan 2007
Blog Post:
TIP: Automatically generate Managed Code Analysis/FxCop suppressions
David M. Kean
I see a lot of users attempting to hand code a SuppressMessageAttribute themselves. This can be error prone and is not needed when both Visual Studio and the standalone FxCop can automatically generate these for you. In Visual Studio 2005 Right-click a Code Analysis warning in the Error List...
on
18 Jan 2007
Blog Post:
FAQ: How do I fix a violation of MovePInvokesToNativeMethodsClass?
David M. Kean
MovePInvokesToNativeMethodsClass fires on P/Invokes (ie methods marked with DllImport) that are not members of one of the following classes; NativeMethods, SafeNativeMethods or UnsafeNativeMethods. For example, the following sample fires this warning. [C#] using System; using System.Runtime.InteropServices;...
on
14 Jan 2007
Blog Post:
January Orcas CTP Released!
David M. Kean
Update: A Virtual PC image is also available. We've just released the Visual Studio 'Orcas' - January CTP . This is the first of the side-by-side installable CTPs, however, before installing, please read the Release Notes and do not install this on a production machine as this will likely break Visual...
on
12 Jan 2007
Blog Post:
And now back to your regularly scheduled FxCop documentation...
David M. Kean
As a lot of you noticed, just before Christmas all of our rule documentation links broke from within FxCop. Unfortunately, due to the timing (and with the required people on holidays), we could not get this fixed as soon as we had hoped. However, as of early this week, the documentation should be...
on
6 Jan 2007
Blog Post:
How would you rate the usefulness of this content? [David Kean]
David M. Kean
At Microsoft, we have a number of internal tools and websites that help improve our interaction with the community. One such site at our disposal is a tool that helps us browse feedback provided about MSDN Library topics. This feedback, which at times can be very telling, is provided via a rating scale...
on
26 Oct 2006
Blog Post:
TIP: How to change the FxCop naming/design rules to fire on internals [David Kean]
David M. Kean
By default, the FxCop naming and design rules only fire on publicly visible types and members. There are a couple reasons for this: The .NET Framework Design Guidelines , which FxCop enforces, only contains guidelines for publicly visible API. What internal Microsoft teams (and you) do with their...
on
8 Aug 2006
Blog Post:
FxCop 1.35 rule documentation now on MSDN Wiki [David Kean]
David M. Kean
One thing you might notice from today when you fire up FxCop 1.35 , is that the rule URLs are now redirecting to the new MSDN Library Wiki as opposed to the old docs on GotDotNet. To see this in action, try the following: Open FxCop 1.35 Choose Windows -> Rules Expand the Naming Rules...
on
29 Jun 2006
Blog Post:
FAQ: Why does FxCop warn against catch(Exception)? - Part 3 [Nick Guerrera]
MSDNArchive
This is the third installment in a three-part series on why FxCop warns against catch(Exception): FAQ: Why does FxCop warn against catch(Exception)? - Part 1 FAQ: Why does FxCop warn against catch(Exception)? - Part 2 FAQ: Why does FxCop warn against catch(Exception)? - Part 3 I said from the beginning...
on
20 Jun 2006
Blog Post:
FAQ: Why does FxCop warn against catch(Exception)? - Part 2 [Nick Guerrera]
MSDNArchive
This is the second installment in a three-part series on why FxCop warns against catch(Exception): FAQ: Why does FxCop warn against catch(Exception)? - Part 1 FAQ: Why does FxCop warn against catch(Exception)? - Part 2 FAQ: Why does FxCop warn against catch(Exception)? - Part 3 On Wednesday, I explained...
on
18 Jun 2006
Blog Post:
FAQ: Why does FxCop warn against catch(Exception)? - Part 1 [Nick Guerrera]
MSDNArchive
This is the first installment in a three-part series on why FxCop warns against catch(Exception): FAQ: Why does FxCop warn against catch(Exception)? - Part 1 FAQ: Why does FxCop warn against catch(Exception)? - Part 2 FAQ: Why does FxCop warn against catch(Exception)? - Part 3 This question comes...
on
15 Jun 2006
Blog Post:
TIP: Get more information about a rule/warning within Visual Studio [David Kean]
David M. Kean
Did you know you can get more information about a particular rule/warning within Visual Studio; including its description, information on how to fix it, whether or not it is considered a breaking change, when or when not to suppress it and code samples? To do this for a particular warning in the Error...
on
13 Jun 2006
Blog Post:
FAQ: Why does DoNotExposeGenericLists recommend that I expose Collection<T> instead of List<T>? [David Kean]
David M. Kean
DoNotExposeGenericLists fires when I publicly expose List<T> via a field, method, property, or parameter. Why? Although Krzysztof briefly touched on this last year , we wanted to expand on this a little through the use of examples. The first reason is that List<T> is designed for speed...
on
27 Apr 2006
Blog Post:
Seen any Microsoft produced code that doesn't pass Code Analysis/FxCop? [David Kean]
David M. Kean
As some of you may already know, the majority of the Developer Division is currently planning features to be included in the next version of Visual Studio (Orcas). As part of this planning phase, the Managed Code Analysis (FxCop) team is beginning to work with other teams around Microsoft to ensure that...
on
12 Apr 2006
Blog Post:
FAQ: Why do some sources recommend extending ApplicationException while FxCop does not? [Michael Fanning, David Kean]
David M. Kean
TypesShouldNotExtendCertainBaseTypes fires on types that derive from ApplicationException and DoNotRaiseReservedExceptionTypes on members that throw ApplicationException. Why? There are several outdated documents floating around on the web (some orginally published by Microsoft) recommending that...
on
5 Apr 2006
Blog Post:
FAQ: How do I indicate to DoNotDeclareReadOnlyMutableReferenceTypes that a type is immutable? [David Kean]
David M. Kean
DoNotDeclareReadOnlyMutableReferenceTypes is a rule that checks for visible read-only fields that are mutable reference types (classes). A mutable type is a type whose instance data can be changed once it has been constructed. For example, the following type is considered mutable: namespace Microsoft...
on
4 Apr 2006
Page 1 of 1 (25 items)