DeepSource has joined Harness. Learn more
Dart Analyze logoDart Analyze/
DRT-W1641

Text direction Unicode code points in commentDRT-W1641

Major severityMajor
Bug Risk categoryBug Risk

The analyzer produces this diagnostic when it encounters source that contains text direction Unicode code points. These code points cause source code in either a string literal or a comment to be interpreted and compiled differently than how it appears in editors, leading to possible security vulnerabilities.

Example

The following code produces this diagnostic twice because there are hidden characters at the start and end of the label string:

var label = 'Interactive text';

Common fixes

If the code points are intended to be included in the string literal, then escape them:

var label = '\u202AInteractive text\u202C';

If the code points aren't intended to be included in the string literal, then remove them:

var label = 'Interactive text';