EX0020 : Specified text found in comments |
![]() |
The topic describes the EX0020 analysis rule.

Specified text found in comments

This rule checks comments and reports when a configured regular expression is matched.

The rule is only informational.

The rule has a Batch scope and is applied only on the SQL script.

Name | Description | Default Value |
---|---|---|
CommentTextMatchRegex |
Regular expression that to be matched in comments. |
regexp:Fix|Hack|Todo|Bug|Issue |
IgnoreCase |
The parameter specifies whether to ignore the matched text case. |
yes |

The rule does not need Analysis Context or SQL Connection.


Explicit Rules

There is no additional info for this rule.

SQL
1CREATE PROCEDURE [dbo].[uspGetWhereUsedProductID] 2 @StartProductID [int] 3, @CheckDate [datetime] 4AS 5BEGIN 6 SET NOCOUNT ON; 7 DECLARE @result int 8 9 BEGIN TRY 10 SELECT @result = 1/0 -- bug 11 /* 12 some other comment 13 */ 14 END TRY 15 BEGIN CATCH 16 -- todo: add error handling 17 PRINT 'Division by 0' 18 END CATCH 19 20 SET @result = 5 -- hack 21 22 RETURN @result; 23END |

Message | Line | Column | |
---|---|---|---|
1 | EX0020 : Text `bug` found inside comments. | 10 | 22 |
2 | EX0020 : Text `todo` found inside comments. | 16 | 2 |
3 | EX0020 : Text `hack` found inside comments. | 20 | 17 |
