Movatterモバイル変換


[0]ホーム

URL:


CodeQL documentation
CodeQL resources

Syntax error

ID: js/syntax-errorKind: problemSecurity severity: Severity: recommendationPrecision: very-highTags:   - quality   - reliability   - correctness   - language-featuresQuery suites:   - javascript-security-and-quality.qls

Click to see the query in the CodeQL repository

Syntax errors prevent code from executing correctly. If a piece of code contains syntax errors, this most likely indicates that it is never run and thus is dead code that should be removed.

Recommendation

Fix the syntax error. It may also be worth investigating whether the file containing the erroneous code fragment is ever included from anywhere. If it is not, then it is dead code, which should be removed.

Example

In the following example, functionfindBox contains incomplete code: the string literal and its containing block statement are not properly terminated, leading to a syntax error.

functionfindBox(){return$("box.important

References

  • Ecma International,ECMAScript Language Definition, 5.1 Edition, Section 15.11.6.4. ECMA, 2011.


[8]ページ先頭

©2009-2025 Movatter.jp