mirror of
https://github.com/github/codeql.git
synced 2026-04-29 18:55:14 +02:00
QL code and tests for C#/C++/JavaScript.
This commit is contained in:
39
javascript/ql/src/LanguageFeatures/SyntaxError.qhelp
Normal file
39
javascript/ql/src/LanguageFeatures/SyntaxError.qhelp
Normal file
@@ -0,0 +1,39 @@
|
||||
<!DOCTYPE qhelp PUBLIC
|
||||
"-//Semmle//qhelp//EN"
|
||||
"qhelp.dtd">
|
||||
<qhelp>
|
||||
<overview>
|
||||
<p>
|
||||
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.
|
||||
</p>
|
||||
|
||||
</overview>
|
||||
<recommendation>
|
||||
|
||||
<p>
|
||||
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.
|
||||
</p>
|
||||
|
||||
</recommendation>
|
||||
<example>
|
||||
|
||||
<p>
|
||||
In the following example, function <code>findBox</code> contains incomplete code: the string
|
||||
literal and its containing block statement are not properly terminated, leading to a syntax
|
||||
error.
|
||||
</p>
|
||||
|
||||
<sample src="examples/SyntaxError.js" />
|
||||
|
||||
</example>
|
||||
<references>
|
||||
|
||||
|
||||
<li>Ecma International, <i>ECMAScript Language Definition</i>, 5.1 Edition, Section 15.11.6.4. ECMA, 2011.</li>
|
||||
|
||||
|
||||
</references>
|
||||
</qhelp>
|
||||
Reference in New Issue
Block a user