Microsoft Developer Network > Forums Home > Visual Studio Team System Forums > Visual Studio Code Analysis and Code Metrics > Persuading Microsoft developers (internal) to conform to Microsoft's code analysis guidelines... or at least use the GeneratedCode attribute

Discussion Persuading Microsoft developers (internal) to conform to Microsoft's code analysis guidelines... or at least use the GeneratedCode attribute

  • Wednesday, May 12, 2010 8:05 PM
     
     

    Our firm is taking the plunge into code analysis with Visual Studio 2010.  We work primarily with Microsoft CRM and were excited to see the new enhancements in the CRM SDK 4.0.12, which can generate strongly-typed entities.  When I gave this a test run with a sample project and then ran code analysis, I was gobsmacked when I saw not hundreds, not thousands, but tens of thousands of warnings (25,356 to be exact, and we're not even using the full ruleset).

    If the generated code conformed to the code analysis rules, that would be fine.  If the generated code was tagged with the GeneratedCode attribute, that would also be fine.  To not follow either practice results in code that we have to either manually tag as GeneratedCode or wrap it in its own project in such a way that the code analysis tools simply ignore it, while supervising the rest of our code.

    My question is: why do Microsoft product teams selectively use these tools and techniques and what can we do to change this for the better?  For example, CRM5 is coming out soon and it would be great if this functionality in the CRM5 SDK used the GeneratedCode attribute.