Merge branch 'main' into redsun82/rust-derive-macro-expansion

This commit is contained in:
Paolo Tranquilli
2025-06-20 15:21:03 +02:00
113 changed files with 2722 additions and 1746 deletions

View File

@@ -16,11 +16,33 @@ When you contribute a new [supported query](supported-queries.md) to this reposi
### Location and file name
Query help files must have the same base name as the query they describe and must be located in the same directory.
Query help files must have the same base name as the query they describe and must be located in the same directory.
### File structure and layout
Query help files are written using a custom XML format, and stored in a file with a `.qhelp` extension. The basic structure is as follows:
Query help files can be written in either a custom XML format (with a `.qhelp` extension) or in Markdown (with a `.md` extension). Both formats are supported by the CodeQL documentation tooling. There are a few minor differences, noted in the section `Differences between XML and markdown formats` below.
#### Markdown query help files
A Markdown query help file should use the following structure and section order (note that the `Implementation notes` section is optional):
```
## Overview
## Recommendation
## Example
## Implementation notes
## References
```
Each section should be clearly marked with the appropriate heading. See the other Markdown files in this repository for examples.
#### XML query help files
Query help files can also be written using a custom XML format, and stored in a file with a `.qhelp` extension. The basic structure is as follows:
```xml
<!DOCTYPE qhelp SYSTEM "qhelp.dtd">
@@ -33,7 +55,7 @@ The header and single top-level `<qhelp>` element are both mandatory.
### Section-level elements
Section-level elements are used to group the information within the query help file. All query help files should include at least the following section elements, in the order specified:
Section-level elements are used to group the information within the query help file. For both Markdown and XML formats, the following sections should be included, in the order specified:
1. `overview`—a short summary of the issue that the query identifies, including an explanation of how it could affect the behavior of the program.
2. `recommendation`—information on how to fix the issue highlighted by the query.
@@ -42,10 +64,9 @@ Section-level elements are used to group the information within the query help f
For further information about the other section-level, block, list and table elements supported by query help files, see [Query help files](https://codeql.github.com/docs/writing-codeql-queries/query-help-files/) on codeql.github.com.
## English style
You should write the overview and recommendation elements in simple English that is easy to follow. You should:
You should write the overview and recommendation sections in simple English that is easy to follow. You should:
* Use simple sentence structures and avoid complex or academic language.
* Avoid colloquialisms and contractions.
@@ -57,10 +78,11 @@ You should write the overview and recommendation elements in simple English that
Whenever possible, you should include a code example that helps to explain the issue you are highlighting. Any code examples that you include should adhere to the following guidelines:
* The example should be less than 20 lines, but it should still clearly illustrate the issue that the query identifies. If appropriate, then the example may also be runnable.
* Put the code example after the recommendation element where possible. Only include an example in the description element if absolutely necessary.
* Put the code example after the recommendation section where possible. Only include an example in the description section if absolutely necessary.
* If you are using an example to illustrate the solution to a problem, and the change required is minor, avoid repeating the whole example. It is preferable to either describe the change required or to include a smaller snippet of the corrected code.
* Clearly indicate which of the samples is an example of bad coding practice and which is recommended practice.
* Define the code examples in `src` files. The language is inferred from the file extension:
* For Markdown files, use fenced code blocks with the appropriate language identifier (for example, <code> ```java </code>).
* For XML files, define the code examples in `src` files. The language is inferred from the file extension:
```xml
<example>
@@ -74,11 +96,11 @@ Whenever possible, you should include a code example that helps to explain the i
</example>
```
Note, if any code words are included in the `overview` and `recommendation` sections, they should be formatted with `<code> ... </code>` for emphasis.
Note, if any code words are included in the `overview` and `recommendation` sections, in Markdown they should be formatted with backticks (<code>`...`</code>) and in XML they should be formatted with`<code> ... </code>` for emphasis.
## Including references
You should include one or more references, list formatted with `<li> ... </li>` for each item, to provide further information about the problem that your query is designed to find. References can be of the following types:
You should include one or more references, formatted as an unordered list (`- ...` or `* ...`) in Markdown or with `<li> ... </li>` for each item in XML, to provide further information about the problem that your query is designed to find. References can be of the following types:
### Books
@@ -90,7 +112,7 @@ For example:
>W. C. Wake, _Refactoring Workbook_, pp. 93 94, Addison-Wesley Professional, 2004.
Note, & symbols need to be replaced by \&amp;. The symbol will be displayed correctly in the HTML files generated from the query help files.
Note, & symbols need to be replaced by \&amp; in XML. The symbol will be displayed correctly in the HTML files generated from the query help files.
### Academic papers
@@ -98,7 +120,6 @@ If you are citing an academic paper, we recommend adopting the reference style o
>S. R. Chidamber and C. F. Kemerer, _A metrics suite for object-oriented design_. IEEE Transactions on Software Engineering, 20(6):476-493, 1994.
### Websites
If you are citing a website, please use the following format, without breadcrumb trails:
@@ -111,28 +132,123 @@ For example:
### Referencing potential security weaknesses
If your query checks code for a CWE weakness, you should use the `@tags` element in the query file to reference the associated CWEs, as explained [here](query-metadata-style-guide.md). When you use these tags, a link to the appropriate entry from the [MITRE.org](https://cwe.mitre.org/scoring/index.html) site will automatically appear as a reference in the output HTML file.
If your query checks code for a CWE weakness, you should use the `@tags` element in the query file to reference the associated CWEs, as explained [here](query-metadata-style-guide.md). When you use these tags in a query help file in the custom XML format, a link to the appropriate entry from the [MITRE.org](https://cwe.mitre.org/scoring/index.html) site will automatically appear as a reference in the output HTML file.
## Validating qhelp files
## Validating query help files
Before making a pull request, please ensure the `.qhelp` files are well-formed and can be generated without errors. This can be done locally with the CodeQL CLI, as shown in the following example:
Before making a pull request, please ensure the `.qhelp` or `.md` files are well-formed and can be generated without errors. This can be done locally with the CodeQL CLI, as shown in the following example:
```bash
# codeql generate query-help <path_to_your_qhelp_file> --format=<format>
# For example:
codeql generate query-help ./myCustomQuery.qhelp --format=markdown
codeql generate query-help ./myCustomQuery.md --format=markdown
```
Please include the query help files (and any associated code snippets) in your pull request, but do not commit the generated Markdown.
Please include the `.qhelp` files (and any associated code snippets) in your pull request, but do not commit the generated Markdown.
More information on how to test your query help files can be found [within the documentation](https://docs.github.com/en/code-security/codeql-cli/using-the-codeql-cli/testing-query-help-files)
More information on how to test your `.qhelp` files can be found [within the documentation](https://docs.github.com/en/code-security/codeql-cli/using-the-codeql-cli/testing-query-help-files)
## Differences between XML and markdown formats
1. The XML format allows for the contents of other files to be included in the output generated by processing the file, as mentioned in the section `Code examples`. This is not possible with the Markdown format.
2. When using the XML format, references are added to the output HTML file based on CWE tags, as mentioned in the section `Referencing potential security weaknesses`.
3. For custom queries and custom query packs, only the Markdown format is supported.
## Query help example
The following example is a query help file for a query from the standard query suite for Java:
The following example is a query help file for a query from the standard query suite for Java, shown in both Markdown and XML formats.
```xml
### Markdown example
````markdown
# Overview
A control structure (an `if` statement or a loop) has a body that is either a block
of statements surrounded by curly braces or a single statement.
If you omit braces, it is particularly important to ensure that the indentation of the code
matches the control flow of the code.
## Recommendation
It is usually considered good practice to include braces for all control
structures in Java. This is because it makes it easier to maintain the code
later. For example, it's easy to see at a glance which part of the code is in the
scope of an `if` statement, and adding more statements to the body of the `if`
statement is less error-prone.
You should also ensure that the indentation of the code is consistent with the actual flow of
control, so that it does not confuse programmers.
## Example
In the example below, the original version of `Cart` is missing braces. This means
that the code triggers a `NullPointerException` at runtime if `i`
is `null`.
```java
class Cart {
Map<Integer, Integer> items = ...
public void addItem(Item i) {
// No braces and misleading indentation.
if (i != null)
log("Adding item: " + i);
// Indentation suggests that the following statements
// are in the body of the 'if'.
Integer curQuantity = items.get(i.getID());
if (curQuantity == null) curQuantity = 0;
items.put(i.getID(), curQuantity+1);
}
}
```
The corrected version of `Cart` does include braces, so
that the code executes as the indentation suggests.
```java
class Cart {
Map<Integer, Integer> items = ...
public void addItem(Item i) {
// Braces included.
if (i != null) {
log("Adding item: " + i);
Integer curQuantity = items.get(i.getID());
if (curQuantity == null) curQuantity = 0;
items.put(i.getID(), curQuantity+1);
}
}
}
```
In the following example the indentation may or may not be misleading depending on your tab width
settings. As such, mixing tabs and spaces in this way is not recommended, since what looks fine in
one context can be very misleading in another.
```java
// Tab width 8
if (b) // Indentation: 1 tab
f(); // Indentation: 2 tabs
g(); // Indentation: 8 spaces
// Tab width 4
if (b) // Indentation: 1 tab
f(); // Indentation: 2 tabs
g(); // Indentation: 8 spaces
```
If you mix tabs and spaces in this way, then you might get seemingly false positives, since your
tab width settings cannot be taken into account.
## References
* Java SE Documentation: [Compound Statements](https://www.oracle.com/java/technologies/javase/codeconventions-statements.html#15395)
* Wikipedia: [Indentation style](https://en.wikipedia.org/wiki/Indentation_style)
````
### XML example
````xml
<!DOCTYPE qhelp PUBLIC
"-//Semmle//qhelp//EN"
"qhelp.dtd">
@@ -154,13 +270,13 @@ later. For example, it's easy to see at a glance which part of the code is in th
scope of an <code>if</code> statement, and adding more statements to the body of the <code>if</code>
statement is less error-prone.</p>
<p>You should also ensure that the indentation of the code is consistent with the actual flow of
<p>You should also ensure that the indentation of the code is consistent with the actual flow of
control, so that it does not confuse programmers.</p>
</recommendation>
<example>
<p>In the example below, the original version of <code>Cart</code> is missing braces. This means
<p>In the example below, the original version of <code>Cart</code> is missing braces. This means
that the code triggers a <code>NullPointerException</code> at runtime if <code>i</code>
is <code>null</code>.</p>
@@ -198,4 +314,4 @@ tab width settings cannot be taken into account.
</references>
</qhelp>
```
````

View File

@@ -1,9 +1,99 @@
ql/javascript/ql/src/AngularJS/DependencyMismatch.ql
ql/javascript/ql/src/AngularJS/DuplicateDependency.ql
ql/javascript/ql/src/AngularJS/IncompatibleService.ql
ql/javascript/ql/src/AngularJS/MissingExplicitInjection.ql
ql/javascript/ql/src/AngularJS/RepeatedInjection.ql
ql/javascript/ql/src/AngularJS/UseNgSrc.ql
ql/javascript/ql/src/DOM/DuplicateAttributes.ql
ql/javascript/ql/src/DOM/MalformedIdAttribute.ql
ql/javascript/ql/src/DOM/PseudoEval.ql
ql/javascript/ql/src/Declarations/ArgumentsRedefined.ql
ql/javascript/ql/src/Declarations/AssignmentToConst.ql
ql/javascript/ql/src/Declarations/ClobberingVarInit.ql
ql/javascript/ql/src/Declarations/ConflictingFunctions.ql
ql/javascript/ql/src/Declarations/DeadStoreOfLocal.ql
ql/javascript/ql/src/Declarations/DeadStoreOfProperty.ql
ql/javascript/ql/src/Declarations/DeclBeforeUse.ql
ql/javascript/ql/src/Declarations/DefaultArgumentReferencesNestedFunction.ql
ql/javascript/ql/src/Declarations/DuplicateVarDecl.ql
ql/javascript/ql/src/Declarations/IneffectiveParameterType.ql
ql/javascript/ql/src/Declarations/MissingThisQualifier.ql
ql/javascript/ql/src/Declarations/MissingVarDecl.ql
ql/javascript/ql/src/Declarations/MixedStaticInstanceThisAccess.ql
ql/javascript/ql/src/Declarations/SuspiciousMethodNameDeclaration.ql
ql/javascript/ql/src/Declarations/TemporalDeadZone.ql
ql/javascript/ql/src/Declarations/UniqueParameterNames.ql
ql/javascript/ql/src/Declarations/UniquePropertyNames.ql
ql/javascript/ql/src/Declarations/UnreachableMethodOverloads.ql
ql/javascript/ql/src/Declarations/UnusedVariable.ql
ql/javascript/ql/src/Expressions/ComparisonWithNaN.ql
ql/javascript/ql/src/Expressions/DuplicateCondition.ql
ql/javascript/ql/src/Expressions/DuplicateProperty.ql
ql/javascript/ql/src/Expressions/DuplicateSwitchCase.ql
ql/javascript/ql/src/Expressions/ExprHasNoEffect.ql
ql/javascript/ql/src/Expressions/HeterogeneousComparison.ql
ql/javascript/ql/src/Expressions/ImplicitOperandConversion.ql
ql/javascript/ql/src/Expressions/MissingAwait.ql
ql/javascript/ql/src/Expressions/MissingDotLengthInComparison.ql
ql/javascript/ql/src/Expressions/MissingSpaceInAppend.ql
ql/javascript/ql/src/Expressions/MisspelledVariableName.ql
ql/javascript/ql/src/Expressions/RedundantExpression.ql
ql/javascript/ql/src/Expressions/SelfAssignment.ql
ql/javascript/ql/src/Expressions/ShiftOutOfRange.ql
ql/javascript/ql/src/Expressions/StringInsteadOfRegex.ql
ql/javascript/ql/src/Expressions/SuspiciousInvocation.ql
ql/javascript/ql/src/Expressions/SuspiciousPropAccess.ql
ql/javascript/ql/src/Expressions/UnboundEventHandlerReceiver.ql
ql/javascript/ql/src/Expressions/UnclearOperatorPrecedence.ql
ql/javascript/ql/src/Expressions/UnknownDirective.ql
ql/javascript/ql/src/Expressions/UnneededDefensiveProgramming.ql
ql/javascript/ql/src/Expressions/WhitespaceContradictsPrecedence.ql
ql/javascript/ql/src/LanguageFeatures/BadTypeof.ql
ql/javascript/ql/src/LanguageFeatures/ConditionalComments.ql
ql/javascript/ql/src/LanguageFeatures/DeleteVar.ql
ql/javascript/ql/src/LanguageFeatures/ExpressionClosures.ql
ql/javascript/ql/src/LanguageFeatures/ForInComprehensionBlocks.ql
ql/javascript/ql/src/LanguageFeatures/IllegalInvocation.ql
ql/javascript/ql/src/LanguageFeatures/InconsistentNew.ql
ql/javascript/ql/src/LanguageFeatures/InvalidPrototype.ql
ql/javascript/ql/src/LanguageFeatures/LengthComparisonOffByOne.ql
ql/javascript/ql/src/LanguageFeatures/NonLinearPattern.ql
ql/javascript/ql/src/LanguageFeatures/PropertyWriteOnPrimitive.ql
ql/javascript/ql/src/LanguageFeatures/SemicolonInsertion.ql
ql/javascript/ql/src/LanguageFeatures/SetterReturn.ql
ql/javascript/ql/src/LanguageFeatures/SpuriousArguments.ql
ql/javascript/ql/src/LanguageFeatures/StrictModeCallStackIntrospection.ql
ql/javascript/ql/src/LanguageFeatures/SyntaxError.ql
ql/javascript/ql/src/LanguageFeatures/TemplateSyntaxInStringLiteral.ql
ql/javascript/ql/src/LanguageFeatures/ThisBeforeSuper.ql
ql/javascript/ql/src/LanguageFeatures/UnusedIndexVariable.ql
ql/javascript/ql/src/LanguageFeatures/WithStatement.ql
ql/javascript/ql/src/LanguageFeatures/YieldInNonGenerator.ql
ql/javascript/ql/src/NodeJS/InvalidExport.ql
ql/javascript/ql/src/NodeJS/MissingExports.ql
ql/javascript/ql/src/Quality/UnhandledErrorInStreamPipeline.ql
ql/javascript/ql/src/React/DirectStateMutation.ql
ql/javascript/ql/src/React/InconsistentStateUpdate.ql
ql/javascript/ql/src/React/UnsupportedStateUpdateInLifecycleMethod.ql
ql/javascript/ql/src/React/UnusedOrUndefinedStateProperty.ql
ql/javascript/ql/src/RegExp/BackrefBeforeGroup.ql
ql/javascript/ql/src/RegExp/BackrefIntoNegativeLookahead.ql
ql/javascript/ql/src/RegExp/DuplicateCharacterInCharacterClass.ql
ql/javascript/ql/src/RegExp/EmptyCharacterClass.ql
ql/javascript/ql/src/RegExp/RegExpAlwaysMatches.ql
ql/javascript/ql/src/RegExp/UnboundBackref.ql
ql/javascript/ql/src/RegExp/UnmatchableCaret.ql
ql/javascript/ql/src/RegExp/UnmatchableDollar.ql
ql/javascript/ql/src/Statements/DanglingElse.ql
ql/javascript/ql/src/Statements/IgnoreArrayResult.ql
ql/javascript/ql/src/Statements/InconsistentLoopOrientation.ql
ql/javascript/ql/src/Statements/LabelInCase.ql
ql/javascript/ql/src/Statements/LoopIterationSkippedDueToShifting.ql
ql/javascript/ql/src/Statements/MisleadingIndentationAfterControlStmt.ql
ql/javascript/ql/src/Statements/ReturnAssignsLocal.ql
ql/javascript/ql/src/Statements/SuspiciousUnusedLoopIterationVariable.ql
ql/javascript/ql/src/Statements/UnreachableStatement.ql
ql/javascript/ql/src/Statements/UseOfReturnlessFunction.ql
ql/javascript/ql/src/Statements/UselessComparisonTest.ql
ql/javascript/ql/src/Statements/UselessConditional.ql
ql/javascript/ql/src/Vue/ArrowMethodOnVueInstance.ql

View File

@@ -1,9 +1,99 @@
ql/javascript/ql/src/AngularJS/DependencyMismatch.ql
ql/javascript/ql/src/AngularJS/DuplicateDependency.ql
ql/javascript/ql/src/AngularJS/IncompatibleService.ql
ql/javascript/ql/src/AngularJS/MissingExplicitInjection.ql
ql/javascript/ql/src/AngularJS/RepeatedInjection.ql
ql/javascript/ql/src/AngularJS/UseNgSrc.ql
ql/javascript/ql/src/DOM/DuplicateAttributes.ql
ql/javascript/ql/src/DOM/MalformedIdAttribute.ql
ql/javascript/ql/src/DOM/PseudoEval.ql
ql/javascript/ql/src/Declarations/ArgumentsRedefined.ql
ql/javascript/ql/src/Declarations/AssignmentToConst.ql
ql/javascript/ql/src/Declarations/ClobberingVarInit.ql
ql/javascript/ql/src/Declarations/ConflictingFunctions.ql
ql/javascript/ql/src/Declarations/DeadStoreOfLocal.ql
ql/javascript/ql/src/Declarations/DeadStoreOfProperty.ql
ql/javascript/ql/src/Declarations/DeclBeforeUse.ql
ql/javascript/ql/src/Declarations/DefaultArgumentReferencesNestedFunction.ql
ql/javascript/ql/src/Declarations/DuplicateVarDecl.ql
ql/javascript/ql/src/Declarations/IneffectiveParameterType.ql
ql/javascript/ql/src/Declarations/MissingThisQualifier.ql
ql/javascript/ql/src/Declarations/MissingVarDecl.ql
ql/javascript/ql/src/Declarations/MixedStaticInstanceThisAccess.ql
ql/javascript/ql/src/Declarations/SuspiciousMethodNameDeclaration.ql
ql/javascript/ql/src/Declarations/TemporalDeadZone.ql
ql/javascript/ql/src/Declarations/UniqueParameterNames.ql
ql/javascript/ql/src/Declarations/UniquePropertyNames.ql
ql/javascript/ql/src/Declarations/UnreachableMethodOverloads.ql
ql/javascript/ql/src/Declarations/UnusedVariable.ql
ql/javascript/ql/src/Expressions/ComparisonWithNaN.ql
ql/javascript/ql/src/Expressions/DuplicateCondition.ql
ql/javascript/ql/src/Expressions/DuplicateProperty.ql
ql/javascript/ql/src/Expressions/DuplicateSwitchCase.ql
ql/javascript/ql/src/Expressions/ExprHasNoEffect.ql
ql/javascript/ql/src/Expressions/HeterogeneousComparison.ql
ql/javascript/ql/src/Expressions/ImplicitOperandConversion.ql
ql/javascript/ql/src/Expressions/MissingAwait.ql
ql/javascript/ql/src/Expressions/MissingDotLengthInComparison.ql
ql/javascript/ql/src/Expressions/MissingSpaceInAppend.ql
ql/javascript/ql/src/Expressions/MisspelledVariableName.ql
ql/javascript/ql/src/Expressions/RedundantExpression.ql
ql/javascript/ql/src/Expressions/SelfAssignment.ql
ql/javascript/ql/src/Expressions/ShiftOutOfRange.ql
ql/javascript/ql/src/Expressions/StringInsteadOfRegex.ql
ql/javascript/ql/src/Expressions/SuspiciousInvocation.ql
ql/javascript/ql/src/Expressions/SuspiciousPropAccess.ql
ql/javascript/ql/src/Expressions/UnboundEventHandlerReceiver.ql
ql/javascript/ql/src/Expressions/UnclearOperatorPrecedence.ql
ql/javascript/ql/src/Expressions/UnknownDirective.ql
ql/javascript/ql/src/Expressions/UnneededDefensiveProgramming.ql
ql/javascript/ql/src/Expressions/WhitespaceContradictsPrecedence.ql
ql/javascript/ql/src/LanguageFeatures/BadTypeof.ql
ql/javascript/ql/src/LanguageFeatures/ConditionalComments.ql
ql/javascript/ql/src/LanguageFeatures/DeleteVar.ql
ql/javascript/ql/src/LanguageFeatures/ExpressionClosures.ql
ql/javascript/ql/src/LanguageFeatures/ForInComprehensionBlocks.ql
ql/javascript/ql/src/LanguageFeatures/IllegalInvocation.ql
ql/javascript/ql/src/LanguageFeatures/InconsistentNew.ql
ql/javascript/ql/src/LanguageFeatures/InvalidPrototype.ql
ql/javascript/ql/src/LanguageFeatures/LengthComparisonOffByOne.ql
ql/javascript/ql/src/LanguageFeatures/NonLinearPattern.ql
ql/javascript/ql/src/LanguageFeatures/PropertyWriteOnPrimitive.ql
ql/javascript/ql/src/LanguageFeatures/SemicolonInsertion.ql
ql/javascript/ql/src/LanguageFeatures/SetterReturn.ql
ql/javascript/ql/src/LanguageFeatures/SpuriousArguments.ql
ql/javascript/ql/src/LanguageFeatures/StrictModeCallStackIntrospection.ql
ql/javascript/ql/src/LanguageFeatures/SyntaxError.ql
ql/javascript/ql/src/LanguageFeatures/TemplateSyntaxInStringLiteral.ql
ql/javascript/ql/src/LanguageFeatures/ThisBeforeSuper.ql
ql/javascript/ql/src/LanguageFeatures/UnusedIndexVariable.ql
ql/javascript/ql/src/LanguageFeatures/WithStatement.ql
ql/javascript/ql/src/LanguageFeatures/YieldInNonGenerator.ql
ql/javascript/ql/src/NodeJS/InvalidExport.ql
ql/javascript/ql/src/NodeJS/MissingExports.ql
ql/javascript/ql/src/Quality/UnhandledErrorInStreamPipeline.ql
ql/javascript/ql/src/React/DirectStateMutation.ql
ql/javascript/ql/src/React/InconsistentStateUpdate.ql
ql/javascript/ql/src/React/UnsupportedStateUpdateInLifecycleMethod.ql
ql/javascript/ql/src/React/UnusedOrUndefinedStateProperty.ql
ql/javascript/ql/src/RegExp/BackrefBeforeGroup.ql
ql/javascript/ql/src/RegExp/BackrefIntoNegativeLookahead.ql
ql/javascript/ql/src/RegExp/DuplicateCharacterInCharacterClass.ql
ql/javascript/ql/src/RegExp/EmptyCharacterClass.ql
ql/javascript/ql/src/RegExp/RegExpAlwaysMatches.ql
ql/javascript/ql/src/RegExp/UnboundBackref.ql
ql/javascript/ql/src/RegExp/UnmatchableCaret.ql
ql/javascript/ql/src/RegExp/UnmatchableDollar.ql
ql/javascript/ql/src/Statements/DanglingElse.ql
ql/javascript/ql/src/Statements/IgnoreArrayResult.ql
ql/javascript/ql/src/Statements/InconsistentLoopOrientation.ql
ql/javascript/ql/src/Statements/LabelInCase.ql
ql/javascript/ql/src/Statements/LoopIterationSkippedDueToShifting.ql
ql/javascript/ql/src/Statements/MisleadingIndentationAfterControlStmt.ql
ql/javascript/ql/src/Statements/ReturnAssignsLocal.ql
ql/javascript/ql/src/Statements/SuspiciousUnusedLoopIterationVariable.ql
ql/javascript/ql/src/Statements/UnreachableStatement.ql
ql/javascript/ql/src/Statements/UseOfReturnlessFunction.ql
ql/javascript/ql/src/Statements/UselessComparisonTest.ql
ql/javascript/ql/src/Statements/UselessConditional.ql
ql/javascript/ql/src/Vue/ArrowMethodOnVueInstance.ql

View File

@@ -7,8 +7,9 @@
* @problem.severity warning
* @precision very-high
* @id js/angular/dependency-injection-mismatch
* @tags correctness
* maintainability
* @tags quality
* reliability
* correctness
* frameworks/angularjs
*/

View File

@@ -5,7 +5,9 @@
* @problem.severity warning
* @precision very-high
* @id js/angular/duplicate-dependency
* @tags maintainability
* @tags quality
* maintainability
* readability
* frameworks/angularjs
*/

View File

@@ -5,7 +5,9 @@
* @problem.severity error
* @precision high
* @id js/angular/incompatible-service
* @tags correctness
* @tags quality
* reliability
* correctness
* frameworks/angularjs
*/

View File

@@ -6,8 +6,9 @@
* @problem.severity warning
* @precision high
* @id js/angular/missing-explicit-injection
* @tags correctness
* maintainability
* @tags quality
* reliability
* correctness
* frameworks/angularjs
*/

View File

@@ -5,7 +5,9 @@
* @problem.severity warning
* @precision high
* @id js/angular/repeated-dependency-injection
* @tags maintainability
* @tags quality
* maintainability
* readability
* frameworks/angularjs
*/

View File

@@ -7,7 +7,9 @@
* @problem.severity warning
* @precision very-high
* @id js/angular/expression-in-url-attribute
* @tags maintainability
* @tags quality
* reliability
* correctness
* frameworks/angularjs
*/

View File

@@ -5,7 +5,8 @@
* @kind problem
* @problem.severity warning
* @id js/duplicate-html-attribute
* @tags maintainability
* @tags quality
* maintainability
* readability
* @precision very-high
*/

View File

@@ -5,7 +5,8 @@
* @kind problem
* @problem.severity warning
* @id js/malformed-html-id
* @tags maintainability
* @tags quality
* reliability
* correctness
* external/cwe/cwe-758
* @precision very-high

View File

@@ -5,7 +5,9 @@
* @kind problem
* @problem.severity recommendation
* @id js/eval-like-call
* @tags maintainability
* @tags quality
* maintainability
* readability
* external/cwe/cwe-676
* @precision very-high
*/

View File

@@ -6,8 +6,9 @@
* @kind problem
* @problem.severity recommendation
* @id js/arguments-redefinition
* @tags efficiency
* maintainability
* @tags quality
* reliability
* performance
* @precision very-high
*/

View File

@@ -5,7 +5,8 @@
* @kind problem
* @problem.severity error
* @id js/assignment-to-constant
* @tags reliability
* @tags quality
* reliability
* correctness
* @precision very-high
*/

View File

@@ -5,7 +5,8 @@
* @kind problem
* @problem.severity error
* @id js/variable-initialization-conflict
* @tags reliability
* @tags quality
* reliability
* correctness
* external/cwe/cwe-563
* @precision very-high

View File

@@ -6,7 +6,8 @@
* @kind problem
* @problem.severity error
* @id js/function-declaration-conflict
* @tags reliability
* @tags quality
* reliability
* correctness
* external/cwe/cwe-563
* @precision high

View File

@@ -5,7 +5,9 @@
* @kind problem
* @problem.severity warning
* @id js/useless-assignment-to-local
* @tags maintainability
* @tags quality
* maintainability
* useless-code
* external/cwe/cwe-563
* @precision very-high
*/

View File

@@ -4,7 +4,9 @@
* @kind problem
* @problem.severity warning
* @id js/useless-assignment-to-property
* @tags maintainability
* @tags quality
* maintainability
* useless-code
* @precision high
*/

View File

@@ -4,7 +4,8 @@
* @kind problem
* @problem.severity warning
* @id js/use-before-declaration
* @tags maintainability
* @tags quality
* maintainability
* readability
* @precision very-high
*/

View File

@@ -6,7 +6,8 @@
* @kind problem
* @problem.severity error
* @id js/nested-function-reference-in-default-parameter
* @tags reliability
* @tags quality
* reliability
* correctness
* @precision very-high
*/

View File

@@ -5,7 +5,9 @@
* @kind problem
* @problem.severity recommendation
* @id js/duplicate-variable-declaration
* @tags maintainability
* @tags quality
* maintainability
* readability
* @precision very-high
*/

View File

@@ -5,9 +5,10 @@
* @problem.severity warning
* @id js/ineffective-parameter-type
* @precision high
* @tags correctness
* @tags quality
* reliability
* correctness
* typescript
* quality
*/
import javascript

View File

@@ -4,7 +4,8 @@
* @kind problem
* @problem.severity error
* @id js/missing-this-qualifier
* @tags maintainability
* @tags quality
* reliability
* correctness
* methods
* @precision high

View File

@@ -5,8 +5,9 @@
* @kind problem
* @problem.severity warning
* @id js/missing-variable-declaration
* @tags reliability
* maintainability
* @tags quality
* reliability
* correctness
* @precision high
*/

View File

@@ -4,7 +4,9 @@
* @kind problem
* @problem.severity error
* @id js/mixed-static-instance-this-access
* @tags correctness
* @tags quality
* reliability
* correctness
* methods
* @precision high
*/

View File

@@ -5,8 +5,10 @@
* @kind problem
* @problem.severity error
* @id js/variable-use-in-temporal-dead-zone
* @tags portability
* @tags quality
* reliability
* correctness
* portability
* @precision very-high
*/

View File

@@ -5,7 +5,8 @@
* @kind problem
* @problem.severity error
* @id js/duplicate-parameter-name
* @tags reliability
* @tags quality
* reliability
* correctness
* @precision very-high
*/

View File

@@ -6,7 +6,8 @@
* @kind problem
* @problem.severity error
* @id js/overwritten-property
* @tags reliability
* @tags quality
* reliability
* correctness
* external/cwe/cwe-563
* @precision very-high

View File

@@ -7,7 +7,9 @@
* @problem.severity warning
* @id js/unreachable-method-overloads
* @precision high
* @tags correctness
* @tags quality
* reliability
* correctness
* typescript
*/

View File

@@ -5,7 +5,9 @@
* @kind problem
* @problem.severity recommendation
* @id js/unused-local-variable
* @tags maintainability
* @tags quality
* maintainability
* useless-code
* @precision very-high
*/

View File

@@ -5,7 +5,8 @@
* @kind problem
* @problem.severity error
* @id js/comparison-with-nan
* @tags reliability
* @tags quality
* reliability
* correctness
* external/cwe/cwe-570
* external/cwe/cwe-571

View File

@@ -5,7 +5,8 @@
* @kind problem
* @problem.severity warning
* @id js/duplicate-condition
* @tags maintainability
* @tags quality
* reliability
* correctness
* external/cwe/cwe-561
* @precision very-high

View File

@@ -5,7 +5,9 @@
* @kind problem
* @problem.severity warning
* @id js/duplicate-property
* @tags maintainability
* @tags quality
* maintainability
* readability
* external/cwe/cwe-563
* @precision very-high
*/

View File

@@ -5,7 +5,8 @@
* @kind problem
* @problem.severity warning
* @id js/duplicate-switch-case
* @tags maintainability
* @tags quality
* reliability
* correctness
* external/cwe/cwe-561
* @precision very-high

View File

@@ -7,10 +7,9 @@
* @id js/useless-expression
* @tags quality
* maintainability
* correctness
* useless-code
* external/cwe/cwe-480
* external/cwe/cwe-561
* useless-code
* @precision very-high
*/

View File

@@ -6,7 +6,8 @@
* @kind problem
* @problem.severity warning
* @id js/comparison-between-incompatible-types
* @tags reliability
* @tags quality
* reliability
* correctness
* external/cwe/cwe-570
* external/cwe/cwe-571

View File

@@ -5,8 +5,9 @@
* @kind problem
* @problem.severity warning
* @id js/implicit-operand-conversion
* @tags reliability
* readability
* @tags quality
* reliability
* correctness
* external/cwe/cwe-704
* @precision very-high
*/

View File

@@ -4,8 +4,9 @@
* @kind problem
* @problem.severity warning
* @id js/missing-await
* @tags correctness
* quality
* @tags quality
* reliability
* correctness
* @precision high
*/

View File

@@ -6,7 +6,9 @@
* @problem.severity warning
* @id js/missing-dot-length-in-comparison
* @precision high
* @tags correctness
* @tags quality
* reliability
* correctness
*/
import javascript

View File

@@ -7,7 +7,9 @@
* @problem.severity warning
* @precision very-high
* @id js/missing-space-in-concatenation
* @tags readability
* @tags quality
* maintainability
* readability
*/
import javascript

View File

@@ -6,8 +6,8 @@
* @kind problem
* @problem.severity warning
* @id js/misspelled-variable-name
* @tags maintainability
* readability
* @tags quality
* reliability
* correctness
* @precision very-high
*/

View File

@@ -6,7 +6,8 @@
* @kind problem
* @problem.severity warning
* @id js/redundant-operation
* @tags reliability
* @tags quality
* reliability
* correctness
* external/cwe/cwe-480
* external/cwe/cwe-561

View File

@@ -4,7 +4,8 @@
* @kind problem
* @problem.severity warning
* @id js/redundant-assignment
* @tags reliability
* @tags quality
* reliability
* correctness
* external/cwe/cwe-480
* external/cwe/cwe-561

View File

@@ -5,7 +5,8 @@
* @kind problem
* @problem.severity error
* @id js/shift-out-of-range
* @tags reliability
* @tags quality
* reliability
* correctness
* external/cwe/cwe-197
* @precision very-high

View File

@@ -4,7 +4,9 @@
* @kind problem
* @problem.severity warning
* @id js/string-instead-of-regex
* @tags correctness
* @tags quality
* reliability
* correctness
* @precision high
*/

View File

@@ -5,7 +5,9 @@
* @kind problem
* @problem.severity error
* @id js/call-to-non-callable
* @tags correctness
* @tags quality
* reliability
* correctness
* external/cwe/cwe-476
* @precision high
*/

View File

@@ -5,7 +5,9 @@
* @kind problem
* @problem.severity error
* @id js/property-access-on-non-object
* @tags correctness
* @tags quality
* reliability
* correctness
* external/cwe/cwe-476
* @precision high
*/

View File

@@ -4,7 +4,9 @@
* @kind problem
* @problem.severity error
* @id js/unbound-event-handler-receiver
* @tags correctness
* @tags quality
* reliability
* correctness
* @precision high
*/

View File

@@ -5,8 +5,9 @@
* @kind problem
* @problem.severity recommendation
* @id js/unclear-operator-precedence
* @tags maintainability
* correctness
* @tags quality
* maintainability
* readability
* statistical
* non-attributable
* external/cwe/cwe-783

View File

@@ -4,7 +4,9 @@
* @kind problem
* @problem.severity warning
* @id js/unknown-directive
* @tags correctness
* @tags quality
* reliability
* correctness
* @precision high
*/

View File

@@ -4,7 +4,9 @@
* @kind problem
* @problem.severity recommendation
* @id js/unneeded-defensive-code
* @tags correctness
* @tags quality
* maintainability
* useless-code
* external/cwe/cwe-570
* external/cwe/cwe-571
* @precision very-high

View File

@@ -5,7 +5,8 @@
* @kind problem
* @problem.severity warning
* @id js/whitespace-contradicts-precedence
* @tags maintainability
* @tags quality
* reliability
* correctness
* statistical
* non-attributable

View File

@@ -6,7 +6,8 @@
* @kind problem
* @problem.severity error
* @id js/useless-type-test
* @tags maintainability
* @tags quality
* reliability
* correctness
* language-features
* external/cwe/cwe-570

View File

@@ -4,8 +4,10 @@
* @kind problem
* @problem.severity warning
* @id js/conditional-comment
* @tags portability
* maintainability
* @tags quality
* reliability
* correctness
* portability
* language-features
* external/cwe/cwe-758
* @precision very-high

View File

@@ -4,8 +4,9 @@
* @kind problem
* @problem.severity warning
* @id js/deletion-of-non-property
* @tags reliability
* maintainability
* @tags quality
* reliability
* correctness
* language-features
* external/cwe/cwe-480
* @precision very-high

View File

@@ -5,8 +5,10 @@
* @kind problem
* @problem.severity warning
* @id js/non-standard-language-feature
* @tags portability
* @tags quality
* maintainability
* readability
* portability
* language-features
* external/cwe/cwe-758
* @precision very-high

View File

@@ -5,8 +5,10 @@
* @kind problem
* @problem.severity error
* @id js/for-in-comprehension
* @tags portability
* @tags quality
* maintainability
* readability
* portability
* language-features
* external/cwe/cwe-758
* @precision very-high

View File

@@ -6,7 +6,9 @@
* @kind problem
* @problem.severity error
* @id js/illegal-invocation
* @tags correctness
* @tags quality
* reliability
* correctness
* language-features
* @precision high
*/

View File

@@ -6,7 +6,8 @@
* @kind problem
* @problem.severity warning
* @id js/inconsistent-use-of-new
* @tags reliability
* @tags quality
* reliability
* correctness
* language-features
* @precision very-high

View File

@@ -5,7 +5,9 @@
* @kind problem
* @problem.severity error
* @id js/invalid-prototype-value
* @tags correctness
* @tags quality
* reliability
* correctness
* language-features
* external/cwe/cwe-704
* @precision high

View File

@@ -5,9 +5,11 @@
* @kind problem
* @problem.severity warning
* @id js/index-out-of-bounds
* @tags reliability
* @tags quality
* reliability
* correctness
* logic
* language-features
* external/cwe/cwe-193
* @precision high
*/

View File

@@ -6,7 +6,8 @@
* @kind problem
* @problem.severity error
* @id js/non-linear-pattern
* @tags reliability
* @tags quality
* reliability
* correctness
* language-features
* @precision very-high

View File

@@ -5,7 +5,9 @@
* @kind problem
* @problem.severity error
* @id js/property-assignment-on-primitive
* @tags correctness
* @tags quality
* reliability
* correctness
* language-features
* external/cwe/cwe-704
* @precision high

View File

@@ -4,7 +4,9 @@
* @kind problem
* @problem.severity recommendation
* @id js/automatic-semicolon-insertion
* @tags maintainability
* @tags quality
* maintainability
* readability
* language-features
* statistical
* non-attributable

View File

@@ -5,7 +5,9 @@
* @kind problem
* @problem.severity warning
* @id js/setter-return
* @tags maintainability
* @tags quality
* maintainability
* useless-code
* language-features
* @precision very-high
*/

View File

@@ -4,10 +4,10 @@
* @kind problem
* @problem.severity warning
* @id js/superfluous-trailing-arguments
* @tags maintainability
* @tags quality
* reliability
* correctness
* language-features
* quality
* external/cwe/cwe-685
* @precision very-high
*/

View File

@@ -6,7 +6,9 @@
* @kind problem
* @problem.severity error
* @id js/strict-mode-call-stack-introspection
* @tags correctness
* @tags quality
* reliability
* correctness
* language-features
* @precision high
*/

View File

@@ -4,7 +4,8 @@
* @kind problem
* @problem.severity recommendation
* @id js/syntax-error
* @tags reliability
* @tags quality
* reliability
* correctness
* language-features
* @precision very-high

View File

@@ -5,7 +5,9 @@
* @kind problem
* @problem.severity error
* @id js/incomplete-object-initialization
* @tags correctness
* @tags quality
* reliability
* correctness
* language-features
* @precision high
*/

View File

@@ -6,7 +6,9 @@
* @problem.severity warning
* @id js/unused-index-variable
* @precision high
* @tags correctness
* @tags quality
* reliability
* correctness
*/
import javascript

View File

@@ -4,7 +4,9 @@
* @kind problem
* @problem.severity warning
* @id js/with-statement
* @tags maintainability
* @tags quality
* maintainability
* complexity
* language-features
* @precision very-high
*/

View File

@@ -4,7 +4,9 @@
* @kind problem
* @problem.severity error
* @id js/yield-outside-generator
* @tags maintainability
* @tags quality
* reliability
* correctness
* language-features
* external/cwe/cwe-758
* @precision very-high

View File

@@ -5,7 +5,9 @@
* @kind problem
* @problem.severity warning
* @id js/node/assignment-to-exports-variable
* @tags maintainability
* @tags quality
* reliability
* correctness
* frameworks/node.js
* external/cwe/cwe-563
* @precision very-high

View File

@@ -5,7 +5,9 @@
* @kind problem
* @problem.severity error
* @id js/node/missing-exports-qualifier
* @tags maintainability
* @tags quality
* reliability
* correctness
* frameworks/node.js
* @precision high
*/

View File

@@ -5,7 +5,9 @@
* @kind problem
* @problem.severity warning
* @id js/react/direct-state-mutation
* @tags reliability
* @tags quality
* reliability
* correctness
* frameworks/react
* @precision very-high
*/

View File

@@ -6,7 +6,9 @@
* @kind problem
* @problem.severity warning
* @id js/react/inconsistent-state-update
* @tags reliability
* @tags quality
* reliability
* correctness
* frameworks/react
* @precision very-high
*/

View File

@@ -4,7 +4,9 @@
* @kind problem
* @problem.severity warning
* @id js/react/unsupported-state-update-in-lifecycle-method
* @tags reliability
* @tags quality
* reliability
* correctness
* frameworks/react
* @precision high
*/

View File

@@ -4,8 +4,9 @@
* @kind problem
* @problem.severity warning
* @id js/react/unused-or-undefined-state-property
* @tags correctness
* @tags quality
* reliability
* correctness
* frameworks/react
* @precision high
*/

View File

@@ -5,7 +5,8 @@
* @kind problem
* @problem.severity error
* @id js/regex/back-reference-before-group
* @tags reliability
* @tags quality
* reliability
* correctness
* regular-expressions
* @precision very-high

View File

@@ -5,7 +5,8 @@
* @kind problem
* @problem.severity error
* @id js/regex/back-reference-to-negative-lookahead
* @tags reliability
* @tags quality
* reliability
* correctness
* regular-expressions
* @precision very-high

View File

@@ -4,7 +4,8 @@
* @kind problem
* @problem.severity warning
* @id js/regex/empty-character-class
* @tags reliability
* @tags quality
* reliability
* correctness
* regular-expressions
* @precision very-high

View File

@@ -4,9 +4,10 @@
* @kind problem
* @problem.severity warning
* @id js/regex/always-matches
* @tags correctness
* @tags quality
* reliability
* correctness
* regular-expressions
* quality
* @precision high
*/

View File

@@ -6,7 +6,8 @@
* @kind problem
* @problem.severity warning
* @id js/regex/unbound-back-reference
* @tags reliability
* @tags quality
* reliability
* correctness
* regular-expressions
* @precision very-high

View File

@@ -6,7 +6,8 @@
* @kind problem
* @problem.severity error
* @id js/regex/unmatchable-caret
* @tags reliability
* @tags quality
* reliability
* correctness
* regular-expressions
* external/cwe/cwe-561

View File

@@ -6,7 +6,8 @@
* @kind problem
* @problem.severity error
* @id js/regex/unmatchable-dollar
* @tags reliability
* @tags quality
* reliability
* correctness
* regular-expressions
* external/cwe/cwe-561

View File

@@ -4,7 +4,9 @@
* @kind problem
* @problem.severity warning
* @id js/misleading-indentation-of-dangling-else
* @tags readability
* @tags quality
* maintainability
* readability
* statistical
* non-attributable
* external/cwe/cwe-483

View File

@@ -4,7 +4,8 @@
* @kind problem
* @problem.severity warning
* @id js/ignore-array-result
* @tags maintainability
* @tags quality
* reliability
* correctness
* @precision high
*/

View File

@@ -8,7 +8,9 @@
* @kind problem
* @problem.severity error
* @id js/inconsistent-loop-direction
* @tags correctness
* @tags quality
* reliability
* correctness
* external/cwe/cwe-835
* @precision very-high
*/

View File

@@ -5,8 +5,9 @@
* @kind problem
* @problem.severity warning
* @id js/label-in-switch
* @tags reliability
* readability
* @tags quality
* reliability
* correctness
* @precision very-high
*/

View File

@@ -5,7 +5,9 @@
* @kind problem
* @problem.severity warning
* @id js/loop-iteration-skipped-due-to-shifting
* @tags correctness
* @tags quality
* reliability
* correctness
* @precision high
*/
@@ -146,7 +148,12 @@ class ArrayIterationLoop extends ForStmt {
or
this.hasPathThrough(splice, cfg.getAPredecessor()) and
this.getLoopEntry().dominates(cfg.getBasicBlock()) and
not this.hasIndexingManipulation(cfg)
not this.hasIndexingManipulation(cfg) and
// Don't continue through a branch that tests the splice call's return value
not exists(ConditionGuardNode guard | cfg = guard |
guard.getTest() = splice.asExpr() and
guard.getOutcome() = false
)
}
}

View File

@@ -5,7 +5,9 @@
* @kind problem
* @problem.severity warning
* @id js/misleading-indentation-after-control-statement
* @tags correctness
* @tags quality
* maintainability
* readability
* statistical
* non-attributable
* external/cwe/cwe-483

View File

@@ -5,8 +5,9 @@
* @kind problem
* @problem.severity warning
* @id js/useless-assignment-in-return
* @tags maintainability
* readability
* @tags quality
* reliability
* correctness
* external/cwe/cwe-563
* @precision very-high
*/

View File

@@ -4,7 +4,8 @@
* @kind problem
* @problem.severity error
* @id js/unused-loop-variable
* @tags maintainability
* @tags quality
* reliability
* correctness
* @precision high
*/

View File

@@ -4,7 +4,8 @@
* @kind problem
* @problem.severity warning
* @id js/unreachable-statement
* @tags maintainability
* @tags quality
* reliability
* correctness
* external/cwe/cwe-561
* @precision very-high

View File

@@ -4,7 +4,8 @@
* @kind problem
* @problem.severity warning
* @id js/use-of-returnless-function
* @tags maintainability
* @tags quality
* reliability
* correctness
* @precision high
*/

View File

@@ -5,7 +5,9 @@
* @kind problem
* @problem.severity warning
* @id js/useless-comparison-test
* @tags correctness
* @tags quality
* reliability
* correctness
* @precision high
*/

View File

@@ -6,7 +6,9 @@
* @kind problem
* @problem.severity warning
* @id js/trivial-conditional
* @tags correctness
* @tags quality
* reliability
* correctness
* external/cwe/cwe-570
* external/cwe/cwe-571
* @precision very-high

View File

@@ -4,7 +4,9 @@
* @kind problem
* @problem.severity warning
* @id js/vue/arrow-method-on-vue-instance
* @tags reliability
* @tags quality
* reliability
* correctness
* frameworks/vue
* @precision high
*/

View File

@@ -0,0 +1,4 @@
---
category: minorAnalysis
---
* Fixed false positives in the `js/loop-iteration-skipped-due-to-shifting` query when the return value of `splice` is used to decide whether to adjust the loop counter.

View File

@@ -0,0 +1,4 @@
---
category: minorAnalysis
---
* The `js/loop-iteration-skipped-due-to-shifting` query now has the `reliability` tag.

Some files were not shown because too many files have changed in this diff Show More