Skip to content

Disallow Configured Custom Regex Patterns ​

WarningAnti-Patterns & Bad Practices#EC NO_CUSTOM_PATTERNRemote Enabled

Overview ​

Disallow configured custom regex patterns.

ATC Finding Message: Source code matches forbidden custom regex pattern

Rationale ​

Enterprise coding standards often require banning specific placeholder comments (such as TODO, FIXME, XXX), temporary variable patterns (such as TMP_* or DEBUG_*), sensitive keywords, or prohibited terminology. This check inspects all tokens against a configurable table of regular expressions, reporting any prohibited matches.

Non-Compliant ​

abap
" Flagged when 'TODO' is configured in PATTERNS
DATA lv_todo_item TYPE i.

Compliant ​

abap
DATA lv_clean_item TYPE i.

Configuration & Thresholds ​

This check can be fine-tuned directly in the ATC Check Variant Editor (CHKV) in Eclipse ADT:

Parameter NameData TypeDefault ValueDescription & Guidance
PATTERNStringTODO|FIXME|XXXRegular expression pattern to disallow (defaults to TODO|FIXME|XXX)

Suppression ​

To suppress findings for this rule, append the pseudo-comment to the statement:

abap
" Standard pseudo-comment:
... "#EC NO_CUSTOM_PATTERN

" SAP CI_ prefix format:
... "#EC CI_NO_CUSTOM_PATTERN

Technical Details ​

Released under the MIT License.