Differences between FxCop GUI and VS 2005
-
Wednesday, March 15, 2006 11:24 PM
Hi all,
is there any place where I can find what the main differences are between FxCop GUI and VS IDE (as far as code analysis goes)?
For instance, I see that VS doesn't show the URL for the documentation on a given rule. What else is missing?
Is the "suppress message" in VS relative to the "exclude" in FxCop? If so, how do can I force developers to type in the reason why they're supressing a message? And how can I see a list of all the messages suppressed?
It seems to me that code analysis support is just half-baked in VS, and in such case, I see no use in migrating from FxCop GUI to VS. Any comments on that?
Thanks in advance,
Claudio Lassala
Answers
-
Thursday, March 16, 2006 2:50 AMModerator
Claudio,
There are a number of differences between the external UI and the VS IDE:
- There are a number of new rules that don't ship with the external UI, including (but not limited to): AvoidExcessiveInheritance, AvoidExcessiveComplexity, DisposeObjectsBeforeLosingScope, DoNotLockObjectsWithWeakIdentity
- The ability to integrate Code Analysis with Team Foundation policy, ie you can prevent users from checking in code that doesn't adhere to particular rules
- Code Analysis is fully integrated with MsBuild and Visual Studio so violations are shown alongside build warnings and errors in the Error List and rule selections are stored in the project file itself
- You can get Visual Studio to suppress an error automatically by right-clicking the violation and choose Suppress Message(s) and Visual Studio will apply the SuppressMessageAttribute to the offending member
- There is no easy way to use the external UI on the new ASP.NET 'project-less' system, whereas the VS Managed Code Analysis makes this easy
Although there is the ability to provide to a reason as to why developers are suppressing a message (via the Justification property on the SuppressMessageAttribute), the only way of viewing this currently is by visiting the offending member itself.
You can view the rule help by right-clicking on the violation and choose Show Help, this displays the rule help within Microsoft Document Explorer.
Hope this helps
David
-
Monday, April 17, 2006 12:53 AMModerator
All Replies
-
Thursday, March 16, 2006 2:50 AMModerator
Claudio,
There are a number of differences between the external UI and the VS IDE:
- There are a number of new rules that don't ship with the external UI, including (but not limited to): AvoidExcessiveInheritance, AvoidExcessiveComplexity, DisposeObjectsBeforeLosingScope, DoNotLockObjectsWithWeakIdentity
- The ability to integrate Code Analysis with Team Foundation policy, ie you can prevent users from checking in code that doesn't adhere to particular rules
- Code Analysis is fully integrated with MsBuild and Visual Studio so violations are shown alongside build warnings and errors in the Error List and rule selections are stored in the project file itself
- You can get Visual Studio to suppress an error automatically by right-clicking the violation and choose Suppress Message(s) and Visual Studio will apply the SuppressMessageAttribute to the offending member
- There is no easy way to use the external UI on the new ASP.NET 'project-less' system, whereas the VS Managed Code Analysis makes this easy
Although there is the ability to provide to a reason as to why developers are suppressing a message (via the Justification property on the SuppressMessageAttribute), the only way of viewing this currently is by visiting the offending member itself.
You can view the rule help by right-clicking on the violation and choose Show Help, this displays the rule help within Microsoft Document Explorer.
Hope this helps
David
-
Friday, March 17, 2006 6:09 PMDavid, thanks for the info once again. I can see the benefits from using VS IDE, but I'm still hoping for it to catch up with the external UI's features.
-
Friday, March 17, 2006 6:12 PMModerator
Claudio,
We're hoping to improve this future versions. What would you like to see in Visual Studio?
-
Friday, March 17, 2006 11:29 PM
David,
I definitely like the integration of code analysis into the VS IDE. I think that's a great way to see violations right there along with compiler error/warnings. However, I think it'd be very useful to have an alternative to that view, where we'd see a list similar to what we get on the external UI.
The following columns are pretty useful: Level, Fix Category, Certainty, Resolution, User, Last Note, Last Note Modified. Also, the coloring indicating whether the line is a new violation of if it was there before is useful.
Those are the kind of things that make it easier to monitor what's going on on a project, as far as static code analysis go.
Those are things I can thing of right now. Other than that, I'm definitely waiting on some better documentation and support for creating custom rules. :)
Thanks once again,
Claudio
-
Saturday, March 18, 2006 12:22 AMModerator
Claudio,
As we speak we are working on improving the SDK experience, including cleaning up the code base and writing documentation for types and members, we will also be providing more in depth samples for common scenarios.
Thanks for the feedback.
Regards
David
-
Tuesday, March 28, 2006 2:59 AMThat's great, David. Looking forward to get that! :)
-
Sunday, April 16, 2006 1:41 PM
Hi David,
I want to ask how I can integrate my custom rules with VS code analysis?
-
Monday, April 17, 2006 12:53 AMModerator

