Both Code Analysis, FxCop and Code Metrics make extensive use of CompilerGeneratedAttribute and GeneratedCodeAttribute to distinguish between user-written code and tool and compiler generated code. The following describes this behavior: Code Analysis