Telerik® JustCode™ by Progress

Clean Code command offers a set of default steps that helps you easily achieving desired formatting of your code. This article is intended to describe each step priority for the users willing to write their own Telerik® JustCode™ extensions.

Note

Language Support

Supported: C#, VB.NET, JavaScript, HTML, XAML Markup, XML, Razor, CSS, LESS

Code Cleaner Steps Order

C# Step name

Order

Description

Arrange 'this' qualifier

100

Sets 'this' keyword where missing.

Arrange code block usage

200

Adds code block where possible.

Arrange namespaces

300

Arrange namespaces as it says.

Remove redundant casts

400

Removes any casts that are not necessary.

Use String.Format() where possible

500

Converts string concatenation into String.Format() statement.

Remove empty statements

600

Remove empty statements

Simplify identical if-else statements

700

For example if you have code like "if (true) { DoIt(); } else { DoIt(); }" this cleaning step will convert it to just "DoIt();".

Remove redundant overrides

800

Removes redundant overriden methods.

Use auto-implemented property where possible

900

Converts field-backed properties to a auto-implemented property.

Remove unused variables

1000

Remove unused variables

Remove unused private members

1100

Remove unused private members

Make private fields readonly where possible

1200

Make private fields readonly

Add missing using directives

1300

Add missing using directives

Remove unused usings directives

1400

Remove unused usings directives

Reorder using directives

1500

Orders using directives alphabetically and regarding some Options settings.

Introduce File Header Text

1600

Introduce File Header Text

Remove Regions

1600

Removes #region and #endregion preprocessor directives

Move types to separate files

1700

Move every type to its own file.

Reorder and Format code

9000

Orders the code regarding the Code Ordering settings and Format it.

Format code

10000

Format the code regarding set settings.

VB.NET Step name

Order

Description

Arrange 'Me' qualifier

100

Sets 'Me' keyword where missing.

Arrange namespaces

200

Arrange namespaces as it says.

Remove redundant casts

300

Removes any casts that are not necessary.

Use String.Format() where possible

400

Converts string concatenation into String.Format() statement.

Simplify identical if-else statements

500

Converts "if else" statement to a single line statement.

Remove redundant overrides

600

Removes redundant overriden methods.

Use auto-implemented property where possible

700

Converts field-backed properties to a auto-implemented property.

Remove unused variables

800

Remove unused variables

Remove unused private members

900

Remove unused private members

Make private fields readonly where possible

1000

Make private fields readonly

Add missing Imports

1100

Add missing using directives

Remove unused Imports

1200

Remove unused usings directives

Reorder Imports

1300

Orders using directives alphabetically and regarding some Options settings.

Introduce File Header Text

1400

Introduce File Header Text

Remove Regions

1400

Removes #region and #endregion preprocessor directives

Move types to separate files

1500

Move every type to its own file.

Format code

10000

Format the code regarding set settings.

JavaScript Step name

Order

Description

Arrange code block usage

100

Adds code block where possible.

Add missing semicolons

200

Adds semicolons where missing.

Remove empty statements

300

Remove empty statements

Simplify identical if-else statements

400

Converts "if else" statement to a single line statement.

Remove unused variables

500

Remove unused variables

Introduce File Header Text

600

Introduce File Header Text

Format code

10000

Format the code regarding set settings.

HTML Step name

Order

Description

Format code

10000

Format the code regarding set settings.

XAML Markup Step name

Order

Description

Format code

10000

Format the code regarding set settings.

XML Step name

Order

Description

Format code

10000

Format the code regarding set settings.

Razor Step name

Order

Description

Introduce File Header Text

100

Introduce File Header Text

Format code

10000

Format the code regarding set settings.

CSS Step name

Order

Description

Format code

10000

Format the code regarding set settings.

LESS Step name

Order

Description

Format code

10000

Format the code regarding set settings.

Refer to Code Cleaning Options to learn how you can create cleaning profiles matching your preferences in JustCode Options window.

Refer to How To Use Code Styles to learn how you can create a style matching your preferences in JustCode Options window.

See Also