mirror of
https://github.com/github/codeql.git
synced 2025-12-21 19:26:31 +01:00
Python: Remove references to LGTM
This commit is contained in:
@@ -8,11 +8,3 @@ def bar(s:set)->Set:
|
||||
|
||||
t1 = Optional[Optional[int]]
|
||||
t2 = Optional[int][int]
|
||||
|
||||
# ODASA-8075
|
||||
# Commented out until the fix has been pushed to LGTM.com
|
||||
#class baz():
|
||||
# pass
|
||||
#
|
||||
#while True:
|
||||
# baz = baz[baz]
|
||||
|
||||
@@ -25,14 +25,12 @@ except re.error:
|
||||
|
||||
re.compile("]]][[[[]") #$ charSet=3:8
|
||||
|
||||
|
||||
#ODASA-3985
|
||||
#Half Surrogate pairs
|
||||
re.compile(u'[\uD800-\uDBFF][\uDC00-\uDFFF]') #$ charSet=0:5 charSet=5:10
|
||||
#Outside BMP
|
||||
re.compile(u'[\U00010000-\U0010ffff]') #$ charSet=0:5
|
||||
|
||||
#Misparsed on LGTM
|
||||
#Misparsed
|
||||
re.compile(r"\[(?P<txt>[^[]*)\]\((?P<uri>[^)]*)") #$ charSet=10:14 charSet=28:32
|
||||
|
||||
# parses wrongly, sees this \|/ as a char set start
|
||||
|
||||
@@ -21,7 +21,7 @@ re.compile(u'[\uD800-\uDBFF][\uDC00-\uDFFF]') # not escapes
|
||||
#Outside BMP
|
||||
re.compile(u'[\U00010000-\U0010ffff]') # not escapes
|
||||
|
||||
#Misparsed on LGTM
|
||||
#Misparsed
|
||||
re.compile(r"\[(?P<txt>[^[]*)\]\((?P<uri>[^)]*)") #$ escapedCharacter=0:2 escapedCharacter=16:18 escapedCharacter=18:20
|
||||
|
||||
#Non-raw string
|
||||
|
||||
@@ -62,7 +62,7 @@ re.compile(r'x|')
|
||||
#Named group with caret and empty choice.
|
||||
re.compile(r'(?:(?P<n1>^(?:|x)))')
|
||||
|
||||
#Misparsed on LGTM
|
||||
#Misparsed
|
||||
re.compile(r"\[(?P<txt>[^[]*)\]\((?P<uri>[^)]*)")
|
||||
|
||||
re.compile("", re.M) # ODASA-8056
|
||||
|
||||
@@ -11,7 +11,7 @@ re.compile(r'(?:.|\n)*b', re.DOTALL) # Has ReDoS.
|
||||
# minimal example constructed by @erik-krogh
|
||||
baz = re.compile(r'\+0')
|
||||
|
||||
# exerpts from LGTM.com
|
||||
# exerpts from real-world results
|
||||
re.compile(r'\+0x')
|
||||
re.compile(r'\+0x.*')
|
||||
re.compile(r'+\-0+\.')
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
#This code has conflicting attributes,
|
||||
#but the documentation in the standard library tells you do it this way :(
|
||||
|
||||
#See https://discuss.lgtm.com/t/warning-on-normal-use-of-python-socketserver-mixins/677
|
||||
|
||||
class ThreadingMixIn(object):
|
||||
|
||||
def process_request(selfself, req):
|
||||
|
||||
@@ -39,7 +39,7 @@ class UVT(UT, PU):
|
||||
class IUVT(IUT, UVT):
|
||||
pass
|
||||
|
||||
#False positive observed on LGTM
|
||||
#False positive
|
||||
class M1(object):
|
||||
def __init__(self):
|
||||
print("A")
|
||||
|
||||
@@ -78,7 +78,7 @@ class C(object):
|
||||
'''
|
||||
return self is other
|
||||
|
||||
#Was FP -- https://github.com/lgtmhq/lgtm-queries/issues/13
|
||||
#Was FP
|
||||
def both_sides_known(zero_based="auto", query_id=False):
|
||||
if query_id and zero_based == "auto":
|
||||
zero_based = True
|
||||
|
||||
@@ -46,7 +46,7 @@ class InitCallsBadInit(ExplicitReturnInInit):
|
||||
|
||||
# OK as procedure implicitly returns None
|
||||
#
|
||||
# this was seen in the wild: https://lgtm.com/projects/b/jjburton/cgmtools/snapshot/0d8a429b7ea17854a5e5341df98b1cbd54d7fe6c/files/mayaTools/cgm/lib/classes/AttrFactory.py?sort=name&dir=ASC&mode=heatmap#L90
|
||||
# this was seen in the wild:
|
||||
# using a pattern of `return procedure_that_logs_error()`
|
||||
|
||||
def procedure():
|
||||
|
||||
@@ -127,7 +127,7 @@ Z().meth(0)
|
||||
# makes it such. As a consequence, the query `py/not-named-self` and other
|
||||
# relevant queries need to account for this.
|
||||
#
|
||||
# This has come up in the wild via LGTM as a false positive. For example,
|
||||
# This has come up in the wild as a false positive. For example,
|
||||
# `__init_subclass__`:
|
||||
# https://docs.python.org/3/reference/datamodel.html#customizing-class-creation
|
||||
# `__class_getitem__`:
|
||||
|
||||
@@ -127,7 +127,7 @@ def decorated_inner_function():
|
||||
|
||||
|
||||
|
||||
#FP observed https://lgtm.com/projects/g/torchbox/wagtail/alerts/
|
||||
#FP observed
|
||||
def test_dict_unpacking(queryset, field_name, value):
|
||||
#True positive
|
||||
for tag in value.split(','):
|
||||
|
||||
Reference in New Issue
Block a user