Archive

Posts Tagged ‘Redundancy’

CodeRush code issues specific to constructors

September 29th, 2011 Comments off

A constructor is a special class member that is executed when a new object is created. There are two types of constructors: instance constructors and static constructors. Instance constructors are used to create and initialize instances of classes or structures. A static constructor is used to initialize a class itself. A static constructor is called automatically to initialize the class before the first instance is created or any static members are invoked.

Read more…

Code Issues – Redundant namespace reference

June 30th, 2011 Comments off

Cause:

The Redundant namespace reference code issue highlights unused namespace references that can be safely removed in gray (dead code issue), which may improve readability.

Read more…

Code Issues – Redundant field initialization

May 20th, 2011 Comments off

Cause:

The redundant field initialization code issue of type ‘dead code‘ highlights unecessary initialization of fields that can be safely removed (because the common language runtime initializes all fields to their default values, regardless of their type). Value types are initialized to 0 and reference types are initialized to null. Explicitly initializing a field to its default value is redundant, degrades performance and adds to maintenance costs.

Read more…