Compare commits

..

1 Commits

Author SHA1 Message Date
dependabot[bot]
880011ce13 Bump the pip group across 2 directories with 2 updates
Bumps the pip group with 1 update in the /misc/codegen directory: [pytest](https://github.com/pytest-dev/pytest).
Bumps the pip group with 1 update in the /python/ql/test/query-tests/Security/CWE-943-NoSqlInjection/PoC directory: [pymongo](https://github.com/mongodb/mongo-python-driver).


Updates `pytest` from 8.3.5 to 9.0.3
- [Release notes](https://github.com/pytest-dev/pytest/releases)
- [Changelog](https://github.com/pytest-dev/pytest/blob/main/CHANGELOG.rst)
- [Commits](https://github.com/pytest-dev/pytest/compare/8.3.5...9.0.3)

Updates `pymongo` from 3.9 to 4.6.3
- [Release notes](https://github.com/mongodb/mongo-python-driver/releases)
- [Changelog](https://github.com/mongodb/mongo-python-driver/blob/master/doc/changelog.rst)
- [Commits](https://github.com/mongodb/mongo-python-driver/compare/3.9.0...4.6.3)

---
updated-dependencies:
- dependency-name: pytest
  dependency-version: 9.0.3
  dependency-type: direct:production
  dependency-group: pip
- dependency-name: pymongo
  dependency-version: 4.6.3
  dependency-type: direct:production
  dependency-group: pip
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-06-18 10:24:33 +00:00
497 changed files with 1373 additions and 1891 deletions

View File

@@ -1,18 +1,3 @@
{
"attributes": {},
"markdownMessage": "Internal telemetry for the Java extractor.\n\nNo action needed.",
"severity": "note",
"source": {
"extractorName": "java",
"id": "java/extractor/summary",
"name": "Java extractor telemetry"
},
"visibility": {
"cliSummaryTable": false,
"statusPage": false,
"telemetry": true
}
}
{
"markdownMessage": "Because no usable build tool (Gradle, Maven, etc) was found, build scripts could not be queried for guidance about the appropriate JDK version for the code being extracted, or precise dependency information. The default JDK will be used, and external dependencies will be inferred from the Java package names used.",
"severity": "unknown",

View File

@@ -1,18 +1,3 @@
{
"attributes": {},
"markdownMessage": "Internal telemetry for the Java extractor.\n\nNo action needed.",
"severity": "note",
"source": {
"extractorName": "java",
"id": "java/extractor/summary",
"name": "Java extractor telemetry"
},
"visibility": {
"cliSummaryTable": false,
"statusPage": false,
"telemetry": true
}
}
{
"markdownMessage": "Java analysis used build tool Gradle to pick a JDK version and/or to recommend external dependencies.",
"severity": "unknown",

View File

@@ -1,18 +1,3 @@
{
"attributes": {},
"markdownMessage": "Internal telemetry for the Java extractor.\n\nNo action needed.",
"severity": "note",
"source": {
"extractorName": "java",
"id": "java/extractor/summary",
"name": "Java extractor telemetry"
},
"visibility": {
"cliSummaryTable": false,
"statusPage": false,
"telemetry": true
}
}
{
"markdownMessage": "Java analysis used build tool Gradle to pick a JDK version and/or to recommend external dependencies.",
"severity": "unknown",

View File

@@ -1,18 +1,3 @@
{
"attributes": {},
"markdownMessage": "Internal telemetry for the Java extractor.\n\nNo action needed.",
"severity": "note",
"source": {
"extractorName": "java",
"id": "java/extractor/summary",
"name": "Java extractor telemetry"
},
"visibility": {
"cliSummaryTable": false,
"statusPage": false,
"telemetry": true
}
}
{
"markdownMessage": "A Gradle process was aborted because it didn't write to the console for 5 seconds. Consider either lengthening the timeout if appropriate by setting CODEQL_EXTRACTOR_JAVA_BUILDLESS_CHILD_PROCESS_IDLE_TIMEOUT to a higher value or zero for no timeout, or else investigate why Gradle timed out. Java analysis will continue, but the analysis may be of reduced quality.",
"severity": "note",

View File

@@ -1,18 +1,3 @@
{
"attributes": {},
"markdownMessage": "Internal telemetry for the Java extractor.\n\nNo action needed.",
"severity": "note",
"source": {
"extractorName": "java",
"id": "java/extractor/summary",
"name": "Java extractor telemetry"
},
"visibility": {
"cliSummaryTable": false,
"statusPage": false,
"telemetry": true
}
}
{
"markdownMessage": "Java analysis used build tool Gradle to pick a JDK version and/or to recommend external dependencies.",
"severity": "unknown",

View File

@@ -1,18 +1,3 @@
{
"attributes": {},
"markdownMessage": "Internal telemetry for the Java extractor.\n\nNo action needed.",
"severity": "note",
"source": {
"extractorName": "java",
"id": "java/extractor/summary",
"name": "Java extractor telemetry"
},
"visibility": {
"cliSummaryTable": false,
"statusPage": false,
"telemetry": true
}
}
{
"markdownMessage": "Java analysis used build tool Maven to pick a JDK version and/or to recommend external dependencies.",
"severity": "unknown",

View File

@@ -1,18 +1,3 @@
{
"attributes": {},
"markdownMessage": "Internal telemetry for the Java extractor.\n\nNo action needed.",
"severity": "note",
"source": {
"extractorName": "java",
"id": "java/extractor/summary",
"name": "Java extractor telemetry"
},
"visibility": {
"cliSummaryTable": false,
"statusPage": false,
"telemetry": true
}
}
{
"markdownMessage": "Java analysis used build tool Maven to pick a JDK version and/or to recommend external dependencies.",
"severity": "unknown",

View File

@@ -1,18 +1,3 @@
{
"attributes": {},
"markdownMessage": "Internal telemetry for the Java extractor.\n\nNo action needed.",
"severity": "note",
"source": {
"extractorName": "java",
"id": "java/extractor/summary",
"name": "Java extractor telemetry"
},
"visibility": {
"cliSummaryTable": false,
"statusPage": false,
"telemetry": true
}
}
{
"markdownMessage": "Java analysis used build tool Maven to pick a JDK version and/or to recommend external dependencies.",
"severity": "unknown",

View File

@@ -1,18 +1,3 @@
{
"attributes": {},
"markdownMessage": "Internal telemetry for the Java extractor.\n\nNo action needed.",
"severity": "note",
"source": {
"extractorName": "java",
"id": "java/extractor/summary",
"name": "Java extractor telemetry"
},
"visibility": {
"cliSummaryTable": false,
"statusPage": false,
"telemetry": true
}
}
{
"markdownMessage": "Java analysis used build tool Maven to pick a JDK version and/or to recommend external dependencies.",
"severity": "unknown",

View File

@@ -1,18 +1,3 @@
{
"attributes": {},
"markdownMessage": "Internal telemetry for the Java extractor.\n\nNo action needed.",
"severity": "note",
"source": {
"extractorName": "java",
"id": "java/extractor/summary",
"name": "Java extractor telemetry"
},
"visibility": {
"cliSummaryTable": false,
"statusPage": false,
"telemetry": true
}
}
{
"markdownMessage": "Java analysis used build tool Maven to pick a JDK version and/or to recommend external dependencies.",
"severity": "unknown",

View File

@@ -1,18 +1,3 @@
{
"attributes": {},
"markdownMessage": "Internal telemetry for the Java extractor.\n\nNo action needed.",
"severity": "note",
"source": {
"extractorName": "java",
"id": "java/extractor/summary",
"name": "Java extractor telemetry"
},
"visibility": {
"cliSummaryTable": false,
"statusPage": false,
"telemetry": true
}
}
{
"markdownMessage": "A Maven process was aborted because it didn't write to the console for 5 seconds. Consider either lenghtening the timeout if appropriate by setting CODEQL_EXTRACTOR_JAVA_BUILDLESS_CHILD_PROCESS_IDLE_TIMEOUT to a higher value or zero for no timeout, or else investigate why Maven timed out. Java analysis will continue, but the analysis may be of reduced quality.",
"severity": "note",

View File

@@ -1,18 +1,3 @@
{
"attributes": {},
"markdownMessage": "Internal telemetry for the Java extractor.\n\nNo action needed.",
"severity": "note",
"source": {
"extractorName": "java",
"id": "java/extractor/summary",
"name": "Java extractor telemetry"
},
"visibility": {
"cliSummaryTable": false,
"statusPage": false,
"telemetry": true
}
}
{
"markdownMessage": "At least one dependency JAR suggested by the build system could not be downloaded. This means the analysis will try to satisfy the dependency with its default choice for the required external package name, which may be the wrong version or the wrong package entirely. This may lead to partial analysis of code using this dependency. See the extraction log for full details. If the cause appears to be a temporary outage, consider retrying the analysis.",
"severity": "note",

View File

@@ -1,4 +1,4 @@
def test(codeql, java, check_diagnostics_java):
def test(codeql, java):
codeql.database.create(
build_mode="none",
)

View File

@@ -1,18 +1,3 @@
{
"attributes": {},
"markdownMessage": "Internal telemetry for the Java extractor.\n\nNo action needed.",
"severity": "note",
"source": {
"extractorName": "java",
"id": "java/extractor/summary",
"name": "Java extractor telemetry"
},
"visibility": {
"cliSummaryTable": false,
"statusPage": false,
"telemetry": true
}
}
{
"markdownMessage": "Java analysis used build tool Maven to pick a JDK version and/or to recommend external dependencies.",
"severity": "unknown",

View File

@@ -1,18 +1,3 @@
{
"attributes": {},
"markdownMessage": "Internal telemetry for the Java extractor.\n\nNo action needed.",
"severity": "note",
"source": {
"extractorName": "java",
"id": "java/extractor/summary",
"name": "Java extractor telemetry"
},
"visibility": {
"cliSummaryTable": false,
"statusPage": false,
"telemetry": true
}
}
{
"markdownMessage": "Java analysis used build tool Gradle to pick a JDK version and/or to recommend external dependencies.",
"severity": "unknown",

View File

@@ -1,18 +1,3 @@
{
"attributes": {},
"markdownMessage": "Internal telemetry for the Java extractor.\n\nNo action needed.",
"severity": "note",
"source": {
"extractorName": "java",
"id": "java/extractor/summary",
"name": "Java extractor telemetry"
},
"visibility": {
"cliSummaryTable": false,
"statusPage": false,
"telemetry": true
}
}
{
"markdownMessage": "Java analysis used build tool Maven to pick a JDK version and/or to recommend external dependencies.",
"severity": "unknown",

View File

@@ -1,18 +1,3 @@
{
"attributes": {},
"markdownMessage": "Internal telemetry for the Java extractor.\n\nNo action needed.",
"severity": "note",
"source": {
"extractorName": "java",
"id": "java/extractor/summary",
"name": "Java extractor telemetry"
},
"visibility": {
"cliSummaryTable": false,
"statusPage": false,
"telemetry": true
}
}
{
"markdownMessage": "Java analysis dropped the following dependencies because a sibling project depends on a higher version:\n\n* `junit/junit-4.11`",
"severity": "unknown",

View File

@@ -1,18 +1,3 @@
{
"attributes": {},
"markdownMessage": "Internal telemetry for the Java extractor.\n\nNo action needed.",
"severity": "note",
"source": {
"extractorName": "java",
"id": "java/extractor/summary",
"name": "Java extractor telemetry"
},
"visibility": {
"cliSummaryTable": false,
"statusPage": false,
"telemetry": true
}
}
{
"markdownMessage": "Because no usable build tool (Gradle, Maven, etc) was found, build scripts could not be queried for guidance about the appropriate JDK version for the code being extracted, or precise dependency information. The default JDK will be used, and external dependencies will be inferred from the Java package names used.",
"severity": "unknown",

View File

@@ -1,21 +1,3 @@
{
"attributes": {
"java_vendor": "__REDACTED__",
"java_version": "11.0.31"
},
"markdownMessage": "Internal telemetry for the Java extractor.\n\nNo action needed.",
"severity": "note",
"source": {
"extractorName": "java",
"id": "java/extractor/summary",
"name": "Java extractor telemetry"
},
"visibility": {
"cliSummaryTable": false,
"statusPage": false,
"telemetry": true
}
}
{
"markdownMessage": "Analyzed a Gradle project without the [Gradle wrapper](https://docs.gradle.org/current/userguide/gradle_wrapper.html). This may use an incompatible version of Gradle.",
"severity": "warning",

View File

@@ -4,8 +4,7 @@ import pathlib
# The version of gradle used doesn't work on java 17
def test(codeql, use_java_11, java, environment, check_diagnostics):
check_diagnostics.redact += ["attributes.java_vendor"]
def test(codeql, use_java_11, java, environment):
gradle_override_dir = pathlib.Path(tempfile.mkdtemp())
if runs_on.windows:
(gradle_override_dir / "gradle.bat").write_text("@echo off\nexit /b 2\n")

View File

@@ -1,18 +1,3 @@
{
"attributes": {},
"markdownMessage": "Internal telemetry for the Java extractor.\n\nNo action needed.",
"severity": "note",
"source": {
"extractorName": "java",
"id": "java/extractor/summary",
"name": "Java extractor telemetry"
},
"visibility": {
"cliSummaryTable": false,
"statusPage": false,
"telemetry": true
}
}
{
"markdownMessage": "Java analysis used build tool Maven to pick a JDK version and/or to recommend external dependencies.",
"severity": "unknown",

View File

@@ -2,7 +2,7 @@ import os
import os.path
import shutil
def test(codeql, java, check_diagnostics_java):
def test(codeql, java, check_diagnostics):
# Avoid shutil resolving mvn to the wrapper script in the test dir:
os.environ["NoDefaultCurrentDirectoryInExePath"] = "0"

View File

@@ -14,7 +14,7 @@ pluggy==1.5.0
# via pytest
pystache==0.6.8
# via -r misc/codegen/requirements_in.txt
pytest==8.3.5
pytest==9.0.3
# via -r misc/codegen/requirements_in.txt
pyyaml==6.0.2
# via -r misc/codegen/requirements_in.txt

View File

@@ -1,2 +1 @@
query: Classes/InconsistentMRO.ql
postprocess: utils/test/InlineExpectationsTestQuery.ql
Classes/InconsistentMRO.ql

View File

@@ -6,7 +6,7 @@ class X(object):
class Y(X):
pass
class Z(X, Y): # $ Alert
class Z(X, Y):
pass
class O:

View File

@@ -1,2 +1 @@
query: Classes/PropertyInOldStyleClass.ql
postprocess: utils/test/InlineExpectationsTestQuery.ql
Classes/PropertyInOldStyleClass.ql

View File

@@ -1,2 +1 @@
query: Classes/SlotsInOldStyleClass.ql
postprocess: utils/test/InlineExpectationsTestQuery.ql
Classes/SlotsInOldStyleClass.ql

View File

@@ -1,2 +1 @@
query: Classes/SuperInOldStyleClass.ql
postprocess: utils/test/InlineExpectationsTestQuery.ql
Classes/SuperInOldStyleClass.ql

View File

@@ -1,7 +1,7 @@
#Only works for Python2
class OldStyle1: # $ Alert[py/slots-in-old-style-class]
class OldStyle1:
__slots__ = [ 'a', 'b' ]
@@ -12,7 +12,7 @@ class OldStyle1: # $ Alert[py/slots-in-old-style-class]
class OldStyle2:
def __init__(self, x):
super().__init__(x) # $ Alert[py/super-in-old-style]
super().__init__(x)
class NewStyle1(object):

View File

@@ -5,6 +5,6 @@ class OldStyle:
def __init__(self, x):
self._x = x
@property # $ Alert[py/property-in-old-style-class]
@property
def piosc(self):
return self._x

View File

@@ -1,2 +1 @@
query: Classes/MaybeUndefinedClassAttribute.ql
postprocess: utils/test/InlineExpectationsTestQuery.ql
Classes/MaybeUndefinedClassAttribute.ql

View File

@@ -1,2 +1 @@
query: Classes/UndefinedClassAttribute.ql
postprocess: utils/test/InlineExpectationsTestQuery.ql
Classes/UndefinedClassAttribute.ql

View File

@@ -1,2 +1 @@
query: Exceptions/CatchingBaseException.ql
postprocess: utils/test/InlineExpectationsTestQuery.ql
Exceptions/CatchingBaseException.ql

View File

@@ -1,2 +1 @@
query: Exceptions/EmptyExcept.ql
postprocess: utils/test/InlineExpectationsTestQuery.ql
Exceptions/EmptyExcept.ql

View File

@@ -1,2 +1 @@
query: Exceptions/IllegalExceptionHandlerType.ql
postprocess: utils/test/InlineExpectationsTestQuery.ql
Exceptions/IllegalExceptionHandlerType.ql

View File

@@ -1,2 +1 @@
query: Exceptions/IllegalRaise.ql
postprocess: utils/test/InlineExpectationsTestQuery.ql
Exceptions/IllegalRaise.ql

View File

@@ -1,2 +1 @@
query: Exceptions/IncorrectExceptOrder.ql
postprocess: utils/test/InlineExpectationsTestQuery.ql
Exceptions/IncorrectExceptOrder.ql

View File

@@ -14,4 +14,4 @@ def raise_tuple(cond):
raise (Exception, "bananas", 17)
else:
#This is an error
raise (17, "bananas", Exception) # $ Alert[py/illegal-raise]
raise (17, "bananas", Exception)

View File

@@ -1,2 +1 @@
query: Exceptions/UnguardedNextInGenerator.ql
postprocess: utils/test/InlineExpectationsTestQuery.ql
Exceptions/UnguardedNextInGenerator.ql

View File

@@ -2,12 +2,12 @@
def bad1(it):
while True:
yield next(it) # $ Alert
yield next(it)
def bad2(seq):
it = iter(seq)
#Not OK as seq may be empty
raise KeyError(next(it)) # $ Alert
raise KeyError(next(it))
yield 0
def ok1(seq):

View File

@@ -1,2 +1 @@
query: Exceptions/RaisingTuple.ql
postprocess: utils/test/InlineExpectationsTestQuery.ql
Exceptions/RaisingTuple.ql

View File

@@ -5,11 +5,11 @@ def ok():
def bad1():
ex = Exception, "message"
raise ex # $ Alert
raise ex
def bad2():
raise (Exception, "message") # $ Alert
raise (Exception, "message")
def bad3():
ex = Exception,
raise ex, "message" # $ Alert
raise ex, "message"

View File

@@ -1,2 +1 @@
query: Expressions/TruncatedDivision.ql
postprocess: utils/test/InlineExpectationsTestQuery.ql
Expressions/TruncatedDivision.ql

View File

@@ -62,14 +62,14 @@ print(average([1.0, 2.0]))
# This case is bad, and is a minimal obvious case that should be bad. It
# SHOULD be found by the query.
print(3 / 2) # $ Alert[py/truncated-division]
print(3 / 2)
# This case is bad. It uses indirect returns of integers through function calls
# to produce the problem. I
print(return_three() / return_two()) # $ Alert[py/truncated-division]
print(return_three() / return_two())

View File

@@ -16,7 +16,7 @@ def useofapply():
# This use of `apply` is a reference to the builtin function and so SHOULD be
# caught by the query.
apply(foo, [1]) # $ Alert[py/use-of-apply]
apply(foo, [1])

View File

@@ -1,2 +1 @@
query: Expressions/UseofApply.ql
postprocess: utils/test/InlineExpectationsTestQuery.ql
Expressions/UseofApply.ql

View File

@@ -1,2 +1 @@
query: Expressions/UseofInput.ql
postprocess: utils/test/InlineExpectationsTestQuery.ql
Expressions/UseofInput.ql

View File

@@ -1,9 +1,9 @@
def use_of_apply(func, args):
apply(func, args) # $ Alert[py/use-of-apply]
apply(func, args)
def use_of_input():
return input() # $ Alert[py/use-of-input] # NOT OK
return input() # NOT OK
def not_use_of_input():

View File

@@ -1,2 +1 @@
query: Functions/DeprecatedSliceMethod.ql
postprocess: utils/test/InlineExpectationsTestQuery.ql
Functions/DeprecatedSliceMethod.ql

View File

@@ -1,2 +1 @@
query: Imports/EncodingError.ql
postprocess: utils/test/InlineExpectationsTestQuery.ql
Imports/EncodingError.ql

View File

@@ -1,2 +1 @@
query: Imports/EncodingError.ql
postprocess: utils/test/InlineExpectationsTestQuery.ql
Imports/EncodingError.ql

View File

@@ -1,2 +1 @@
query: Imports/SyntaxError.ql
postprocess: utils/test/InlineExpectationsTestQuery.ql
Imports/SyntaxError.ql

View File

@@ -8,5 +8,5 @@
# encoding:shift-jis
def f():
print "Python <20>̊J<CC8A><4A><EFBFBD>́A1990 <20>N<EFBFBD><4E><EFBFBD><EFBFBD><EB82A9><EFBFBD>J<EFBFBD>n<EFBFBD><6E><EFBFBD><EFBFBD><EFBFBD>Ă<EFBFBD><C482>܂<EFBFBD>" # $ Alert[py/encoding-error]
print "Python <20>̊J<CC8A><4A><EFBFBD>́A1990 <20>N<EFBFBD><4E><EFBFBD><EFBFBD><EB82A9><EFBFBD>J<EFBFBD>n<EFBFBD><6E><EFBFBD><EFBFBD><EFBFBD>Ă<EFBFBD><C482>܂<EFBFBD>"
"""

View File

@@ -1,4 +1,4 @@
`Twas brillig, and the slithy toves # $ Alert[py/syntax-error]
`Twas brillig, and the slithy toves
Did gyre and gimble in the wabe:
All mimsy were the borogoves,
And the mome raths outgrabe.

View File

@@ -1,2 +1 @@
query: Lexical/OldOctalLiteral.ql
postprocess: utils/test/InlineExpectationsTestQuery.ql
Lexical/OldOctalLiteral.ql

View File

@@ -1,6 +1,6 @@
#Bad Octal literal
017 # $ Alert
017
#Good Octal literal
0o17
#Special case file permissions

View File

@@ -1,2 +1 @@
query: Statements/ExecUsed.ql
postprocess: utils/test/InlineExpectationsTestQuery.ql
Statements/ExecUsed.ql

View File

@@ -1,2 +1 @@
query: Statements/IterableStringOrSequence.ql
postprocess: utils/test/InlineExpectationsTestQuery.ql
Statements/IterableStringOrSequence.ql

View File

@@ -1,2 +1 @@
query: Statements/TopLevelPrint.ql
postprocess: utils/test/InlineExpectationsTestQuery.ql
Statements/TopLevelPrint.ql

View File

@@ -1,2 +1,2 @@
#Top level prints in modules are bad
print ("Side effect on import") # $ Alert[py/print-during-import]
print ("Side effect on import")

View File

@@ -2,7 +2,7 @@
def exec_used(val):
exec (val) # $ Alert[py/use-of-exec]
exec (val)
#Top level print
import module
@@ -18,7 +18,7 @@ def f(x):
s = u"Hello World"
else:
s = [ u'Hello', u'World']
for thing in s: # $ Alert[py/iteration-string-and-sequence]
for thing in s:
print (thing)
import fake_six

View File

@@ -1 +1 @@
query: Summary/LinesOfCode.ql
Summary/LinesOfCode.ql

View File

@@ -1 +1 @@
query: Summary/LinesOfUserCode.ql
Summary/LinesOfUserCode.ql

View File

@@ -1,2 +1 @@
query: Variables/LeakingListComprehension.ql
postprocess: utils/test/InlineExpectationsTestQuery.ql
Variables/LeakingListComprehension.ql

View File

@@ -2,12 +2,12 @@ from __future__ import print_function
def undefined_in_3():
[x for x in range(3)]
print(x) # $ Alert
print(x)
def different_in_3():
y = 10
[y for y in range(3)]
print(y) # $ Alert
print(y)
def ok():
[z for z in range(4)]

View File

@@ -1,6 +1,6 @@
__all__ = [ "x", "y", "z", "module" ] # $ Alert[py/undefined-export]
__all__ = [ "x", "y", "z", "module" ]
x = 1
if 0:

View File

@@ -1,2 +1 @@
query: Variables/UndefinedExport.ql
postprocess: utils/test/InlineExpectationsTestQuery.ql
Variables/UndefinedExport.ql

View File

@@ -1,2 +1 @@
query: Variables/UndefinedGlobal.ql
postprocess: utils/test/InlineExpectationsTestQuery.ql
Variables/UndefinedGlobal.ql

View File

@@ -1,2 +1 @@
query: Variables/UninitializedLocal.ql
postprocess: utils/test/InlineExpectationsTestQuery.ql
Variables/UninitializedLocal.ql

View File

@@ -1 +1 @@
__all__ = [ "module", "not_exists" ] # $ Alert[py/undefined-export]
__all__ = [ "module", "not_exists" ]

View File

@@ -1,2 +1 @@
query: Classes/DefineEqualsWhenAddingAttributes.ql
postprocess: utils/test/InlineExpectationsTestQuery.ql
Classes/DefineEqualsWhenAddingAttributes.ql

View File

@@ -9,7 +9,7 @@ class RedefineEquals:
def __eq__(self, other):
return other is "Tuesday"
class C(RedefineEquals): # $ Alert
class C(RedefineEquals):
def __init__(self, args):
self.a, self.b = args

View File

@@ -1,2 +1 @@
query: Classes/InconsistentMRO.ql
postprocess: utils/test/InlineExpectationsTestQuery.ql
Classes/InconsistentMRO.ql

View File

@@ -6,12 +6,12 @@ class X(object):
class Y(X):
pass
class Z(X, Y): # $ Alert
class Z(X, Y):
pass
class O:
pass
#This is OK in Python 2
class N(object, O): # $ Alert
class N(object, O):
pass

View File

@@ -1,2 +1 @@
query: Classes/MaybeUndefinedClassAttribute.ql
postprocess: utils/test/InlineExpectationsTestQuery.ql
Classes/MaybeUndefinedClassAttribute.ql

View File

@@ -1,2 +1 @@
query: Classes/UndefinedClassAttribute.ql
postprocess: utils/test/InlineExpectationsTestQuery.ql
Classes/UndefinedClassAttribute.ql

View File

@@ -1,2 +1 @@
query: Expressions/WrongNameForArgumentInCall.ql
postprocess: utils/test/InlineExpectationsTestQuery.ql
Expressions/WrongNameForArgumentInCall.ql

View File

@@ -1,2 +1 @@
query: Expressions/WrongNumberArgumentsInCall.ql
postprocess: utils/test/InlineExpectationsTestQuery.ql
Expressions/WrongNumberArgumentsInCall.ql

View File

@@ -9,8 +9,8 @@ f(1, 2, 3, kw1=1)
f(1, 2, kw1=1, kw2=2)
#Not OK
f(1, 2, 3, kw1=1, kw3=3) # $ Alert[py/call/wrong-named-argument]
f(1, 2, 3, kw3=3) # $ Alert[py/call/wrong-named-argument]
f(1, 2, 3, kw1=1, kw3=3)
f(1, 2, 3, kw3=3)
#ODASA-5897
@@ -21,4 +21,4 @@ def ok():
return analyze_member_access(msg, original=original, chk=chk)
def bad():
return analyze_member_access(msg, original, chk=chk) # $ Alert[py/call/wrong-arguments]
return analyze_member_access(msg, original, chk=chk)

View File

@@ -1,2 +1 @@
query: Expressions/WrongNumberArgumentsForFormat.ql
postprocess: utils/test/InlineExpectationsTestQuery.ql
Expressions/WrongNumberArgumentsForFormat.ql

View File

@@ -1,2 +1 @@
query: Expressions/TruncatedDivision.ql
postprocess: utils/test/InlineExpectationsTestQuery.ql
Expressions/TruncatedDivision.ql

View File

@@ -1,2 +1 @@
query: Expressions/UseofApply.ql
postprocess: utils/test/InlineExpectationsTestQuery.ql
Expressions/UseofApply.ql

View File

@@ -1,2 +1 @@
query: Imports/EncodingError.ql
postprocess: utils/test/InlineExpectationsTestQuery.ql
Imports/EncodingError.ql

View File

@@ -1,2 +1 @@
query: Imports/EncodingError.ql
postprocess: utils/test/InlineExpectationsTestQuery.ql
Imports/EncodingError.ql

View File

@@ -1,2 +1 @@
query: Imports/SyntaxError.ql
postprocess: utils/test/InlineExpectationsTestQuery.ql
Imports/SyntaxError.ql

View File

@@ -8,5 +8,5 @@
# encoding:shift-jis
def f():
print "Python <20>̊J<CC8A><4A><EFBFBD>́A1990 <20>N<EFBFBD><4E><EFBFBD><EFBFBD><EB82A9><EFBFBD>J<EFBFBD>n<EFBFBD><6E><EFBFBD><EFBFBD><EFBFBD>Ă<EFBFBD><C482>܂<EFBFBD>" # $ Alert[py/encoding-error]
print "Python <20>̊J<CC8A><4A><EFBFBD>́A1990 <20>N<EFBFBD><4E><EFBFBD><EFBFBD><EB82A9><EFBFBD>J<EFBFBD>n<EFBFBD><6E><EFBFBD><EFBFBD><EFBFBD>Ă<EFBFBD><C482>܂<EFBFBD>"
"""

View File

@@ -1,4 +1,4 @@
`Twas brillig, and the slithy toves # $ Alert[py/syntax-error]
`Twas brillig, and the slithy toves
Did gyre and gimble in the wabe:
All mimsy were the borogoves,
And the mome raths outgrabe.

View File

@@ -1,2 +1 @@
query: Statements/ExecUsed.ql
postprocess: utils/test/InlineExpectationsTestQuery.ql
Statements/ExecUsed.ql

View File

@@ -1,2 +1 @@
query: Statements/TopLevelPrint.ql
postprocess: utils/test/InlineExpectationsTestQuery.ql
Statements/TopLevelPrint.ql

View File

@@ -1,2 +1,2 @@
#Top level prints in modules are bad
print ("Side effect on import") # $ Alert[py/print-during-import]
print ("Side effect on import")

View File

@@ -2,7 +2,7 @@
def exec_used(val):
exec(val) # $ Alert[py/use-of-exec]
exec(val)
#Top level print
import module

View File

@@ -1,2 +1 @@
query: Statements/IterableStringOrSequence.ql
postprocess: utils/test/InlineExpectationsTestQuery.ql
Statements/IterableStringOrSequence.ql

View File

@@ -1,2 +1 @@
query: Statements/NonIteratorInForLoop.ql
postprocess: utils/test/InlineExpectationsTestQuery.ql
Statements/NonIteratorInForLoop.ql

View File

@@ -23,5 +23,5 @@ async def good():
yield x
async def bad():
async for x in MissingAiter(): # $ Alert[py/non-iterable-in-for-loop]
async for x in MissingAiter():
yield x

View File

@@ -18,7 +18,7 @@ def f(x):
s = u"Hello World"
else:
s = [ u'Hello', u'World']
for thing in s: # $ Alert[py/iteration-string-and-sequence]
for thing in s:
print (thing)
@@ -31,7 +31,7 @@ class Color(Enum):
def colors():
for color in Color:
print(color)
for color in 1: # $ Alert[py/non-iterable-in-for-loop]
for color in 1:
print(color)
colors()

View File

@@ -1,2 +1 @@
query: Statements/UnreachableCode.ql
postprocess: utils/test/InlineExpectationsTestQuery.ql
Statements/UnreachableCode.ql

View File

@@ -1,2 +1 @@
query: Statements/UnreachableCode.ql
postprocess: utils/test/InlineExpectationsTestQuery.ql
Statements/UnreachableCode.ql

View File

@@ -1 +1 @@
query: Summary/LinesOfCode.ql
Summary/LinesOfCode.ql

View File

@@ -1 +1 @@
query: Summary/LinesOfUserCode.ql
Summary/LinesOfUserCode.ql

View File

@@ -1,6 +1,6 @@
__all__ = [ "x", "y", "z", "module", "w" ] # $ Alert[py/undefined-export]
__all__ = [ "x", "y", "z", "module", "w" ]
x = 1
if 0:

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