Review Forbidden Text

Top  Previous  Next

The Review Forbidden Text feature allows you to execute reviews that you create to detect that you are not using "forbidden text" in your source code. "Forbidden text" is defined by you and typically is code that is considered a bad programming practice. This feature is specially useful in organizations to enforce some coding standards. For example, a review of forbidden text can be created to detect the usage of "Exit Sub" statements in VB.NET code, since it is considered a better programming practice to have a single point of exit in procedures, and therefore "Exit Sub" should not be used.

MZ-Tools offers the following ways to review forbidden text:

  • The MZ-Tools | Other Utilities | Review Forbidden Text... menu.
  • The Other Utilities | Review Forbidden Text... menu on the MZ-Tools toolbar.
  • The keyboard shortcut associated with the MZTools6_VSXXXX.ReviewForbiddenText command.

When you invoke this feature, a dialog window is shown that allows you to select the scope of the operation. The results are shown in a Result Window.

You create the reviews in the Corporate Options window, Review Forbidden Text section. For each review, you must define the forbidden text (which can use regular expressions), the .NET language which it applies to, the kind of file which it applies to, the level (file, class, procedure, etc.) and other properties.

Each review can be launched automatically before a build in Release configuration. If a failed review is detected, the Result window keeps open (otherwise it is closed). You should fix the failed reviews before building the executable.

Remarks:

  • Ensure that the source code can be compiled without errors before running this feature.

See Also:

Result Window

Review Forbidden Text Options

Review Properties

Keyboard Shortcuts Options