Code Consolidation

The Code Consolidation options page enables you to modify options for duplicate code consolidation.

opCodeConsolidation

The options page includes the following options:

  • Limit the number of introduced parameters in the consolidated declaration to

    Check this option to limit the number of parameters to introduce in the consolidated declaration.

    If the number of introduced parameters exceeds the specified value, CodeRush shows that consolidation is not available for the current duplicate code cluster.

  • Limit the number of introduced type parameters in the consolidated declaration to

    Check this option to limit the number of type parameters to introduce in the consolidated declaration.

    If the number of introduced type parameters exceeds the specified value, CodeRush shows that consolidation is not available for the current duplicate code cluster.

  • Move introduced type parameters into

    Specifies whether CodeRush moves type parameters to a class declaration or to a method declaration.

  • When referenced members with the same signature can be consolidated into an ancestor class

    Specifies whether CodeRush creates virtual or abstract members in the ancestor type, or passes the dependency members as parameters to the consolidated declaration, if referenced members with the same signature can be consolidated into an ancestor class.

  • When code differences promoted to parameters exist

    Specifies whether CodeRush wraps member references into lambda expressions, or passes member references as parameters to the consolidated declaration, if there are code differences promoted to parameters.