Archive

Posts Tagged ‘Dead Code’

Code Issues – Empty namespace declaration

January 21st, 2011 Comments off

Cause:

This code issue shows a dead code, which is redundant. Empty namespace declarations don’t have any value, and can be safely removed.

Sample:

CodeRush Code Issues - Empty namespace declaration

How to fix:

  • Remove the empty namespace declaration.
—–
Products: CodeRush Pro
Versions: 12.1 and up
VS IDEs: any
Updated: Nov/12/2012
ID: C048

Refactorings – Remove Parameter

August 13th, 2010 Comments off

Also known as Remove Unused Parameter. This refactoring removes an unused parameter from a method declaration, and updates all calls accordingly. It is very useful when a parameter is no longer used by the method body. A spurious parameter doesn’t cause any problems, and you probably might need it again later. But most of the time this is the wrong choice, because a parameter indicates information that is needed. In this case, a caller has to worry about what values to pass for a fictitious, unused parameter. By not removing the parameter you are making further work for everyone who uses the method.

Read more…