I have code I don't want used to calculate code coverage or code metrics

by Donovan Brown 1. September 2011 18:56

Problem:

I have code that I don't want to be calculated in my code coverage results and/or my code metrics.

Solution:

Apply the GeneratedCodeAttribute, DebuggerNonUserCode or DebuggerHidden attributes to the specific code.

Explanation:

 

GeneratedCodeAttribute

DebuggerNonUserCode DebuggerHidden

Code Metrics

Excludes code

No Effect

Code Analysis

Excludes code

No Effect

Code Coverage

No Effect

Excludes code

Tags: , ,

Work

About the author

My name is Donovan Brown and I am a process consultant for Imaginet with a background in application development.  I also run one of the Nation’s fastest growing online registration sites for motorsports events DLBRacing.com.  When I am not writing software I race cars for fun.  DLBRacing.com has given me the opportunity to combine my two passions writing software and racing cars.

AdSense

Month List

AdSense