FxCop is not suitable for Web Applications?
We are implenting code analysis as a check-in policy. Recently we found an article indicating that FxCop (which is the base of the code analysis function) is not suitable for web applications.
http://forums.microsoft.com/msdn/ShowPost.aspx?PostID=101038
Is this true?
If this is true, how do we indicate which projects should be skipped automatically? We know for sure that it is not the case that web applications are automatically SKIPPED as we have been refactoring for some time to get our web services to comply without analysis check-in policy.
Best regards, Jerry
I played with FXCop yesterday, my analysis is that a lot of the 'rules' it enforces are useless. Given that to use FXCop at all, you would need to attack the rules, so you only enforce the useful ones, I don't see any reason why you can't build your own rule set, to enforce the rules that you want to apply to your asp.net code.
Nearly half of FxCop's analysis is dedicated to enforcing the Microsoft Design Guidelines for reusable libraries. Given the fact that web applications are not engineered for reuse by third-party developers, you can argue that the tool's value in this context is limited. Having said that, there is general value in writing code that conforms to the standard, as these guidelines comprise a standard that all managed developers should internalize.
Another portion of FxCop's analysis is dedicated to platform correctness, that is, correct usage of the framework libraries. This analysis is certainly valuable against any managed assembly.
For web app projects, you can disable FxCop's analysis if you wish. If you have a check-in policy enabled for your team project, this means you will be required to override a policy warning for each web app project check-in (which notes that code analysis is disabled for the current project).
Creating analysis that's specific to web applications will be a focus in our next development cycles. Please let me know if you have more specific questions about the current features here.