The following issues were found
src/third_party/scons-3.1.2/scons-local-3.1.2/SCons/Subst.py
146 issues
Line: 48
Column: 5
AllowableExceptions = (IndexError, NameError)
def SetAllowableExceptions(*excepts):
global AllowableExceptions
AllowableExceptions = [_f for _f in excepts if _f]
def raise_exception(exception, target, s):
name = exception.__class__.__name__
msg = "%s `%s' trying to evaluate `%s'" % (name, exception, s)
Reported by Pylint.
Line: 187
Column: 24
cleaner conceptually...
"""
def __init__(self, list, func):
self.list = list
self.func = func
def _return_nodelist(self):
return self.nodelist
def _gen_nodelist(self):
Reported by Pylint.
Line: 200
Column: 9
mylist = [mylist]
# The map(self.func) call is what actually turns
# a list into appropriate proxies.
self.nodelist = SCons.Util.NodeList(list(map(self.func, mylist)))
self._create_nodelist = self._return_nodelist
return self.nodelist
_create_nodelist = _gen_nodelist
Reported by Pylint.
Line: 216
Column: 5
a list during variable expansion. We're not really using any
collections.UserList methods in practice.
"""
def __init__(self, nl):
self.nl = nl
def __getattr__(self, attr):
nl = self.nl._create_nodelist()
return getattr(nl, attr)
def __getitem__(self, i):
Reported by Pylint.
Line: 225
Column: 14
nl = self.nl._create_nodelist()
return nl[i]
def __getslice__(self, i, j):
nl = self.nl._create_nodelist()
i = max(i, 0); j = max(j, 0)
return nl[i:j]
def __str__(self):
nl = self.nl._create_nodelist()
return str(nl)
Reported by Pylint.
Line: 250
Column: 13
except IndexError:
# If there is nothing in the list, then we have no attributes to
# pass through, so raise AttributeError for everything.
raise AttributeError("NodeList has no attribute: %s" % attr)
return getattr(nl0, attr)
def __str__(self):
nl = self.nl._create_nodelist()
if nl:
return str(nl[0])
Reported by Pylint.
Line: 283
Column: 5
used to generate the SOURCES and SOURCE
construction variables
"""
dict = {}
if target:
def get_tgt_subst_proxy(thing):
try:
subst_proxy = thing.get_subst_proxy()
Reported by Pylint.
Line: 389
Suggestion:
https://bandit.readthedocs.io/en/latest/blacklists/blacklist_calls.html#b307-eval
s = self.gvars[key]
else:
try:
s = eval(key, self.gvars, lvars)
except KeyboardInterrupt:
raise
except Exception as e:
if e.__class__ in AllowableExceptions:
return ''
Reported by Bandit.
Line: 389
Column: 31
s = self.gvars[key]
else:
try:
s = eval(key, self.gvars, lvars)
except KeyboardInterrupt:
raise
except Exception as e:
if e.__class__ in AllowableExceptions:
return ''
Reported by Pylint.
Line: 390
Column: 22
else:
try:
s = eval(key, self.gvars, lvars)
except KeyboardInterrupt:
raise
except Exception as e:
if e.__class__ in AllowableExceptions:
return ''
raise_exception(e, lvars['TARGETS'], old_s)
Reported by Pylint.
src/third_party/scons-3.1.2/scons-local-3.1.2/SCons/Tool/docbook/__init__.py
143 issues
Line: 58
Column: 5
has_libxml2 = True
has_lxml = True
try:
import libxml2
import libxslt
except:
has_libxml2 = False
try:
import lxml
Reported by Pylint.
Line: 59
Column: 5
has_lxml = True
try:
import libxml2
import libxslt
except:
has_libxml2 = False
try:
import lxml
except:
Reported by Pylint.
Line: 63
Column: 5
except:
has_libxml2 = False
try:
import lxml
except:
has_lxml = False
# Set this to True, to prefer xsltproc over libxml2 and lxml
prefer_xsltproc = False
Reported by Pylint.
Line: 239
Column: 13
if not has_libxml2 or prefer_xsltproc:
if has_lxml and not prefer_xsltproc:
from lxml import etree
xsl_tree = etree.parse(xsl_file)
doc = etree.parse(str(node))
result = doc.xslt(xsl_tree)
Reported by Pylint.
Line: 336
Column: 5
"""
General XSLT builder (HTML/FO), using the lxml module.
"""
from lxml import etree
xslt_ac = etree.XSLTAccessControl(read_file=True,
write_file=True,
create_dir=True,
read_network=False,
Reported by Pylint.
Line: 377
Column: 5
"""
Resolving XIncludes, using the lxml module.
"""
from lxml import etree
doc = etree.parse(str(source[0]))
doc.xinclude()
try:
doc.write(str(target[0]), xml_declaration=True,
Reported by Pylint.
Line: 497
Column: 13
doc.freeDoc()
xpath_context.xpathFreeContext()
elif has_lxml:
from lxml import etree
opf = etree.parse(content_file)
# All the opf:item elements are resources
for item in opf.xpath('//opf:item',
namespaces= { 'opf': 'http://www.idpf.org/2007/opf' }):
Reported by Pylint.
Line: 60
Column: 1
try:
import libxml2
import libxslt
except:
has_libxml2 = False
try:
import lxml
except:
has_lxml = False
Reported by Pylint.
Line: 64
Column: 1
has_libxml2 = False
try:
import lxml
except:
has_lxml = False
# Set this to True, to prefer xsltproc over libxml2 and lxml
prefer_xsltproc = False
Reported by Pylint.
Line: 130
Column: 15
return tpath, stem
else:
stem, ext = os.path.splitext(tpath)
return t, stem
def __get_xml_text(root):
""" Return the text for the given root node (xml.dom.minidom). """
Reported by Pylint.
src/third_party/scons-3.1.2/scons-local-3.1.2/SCons/Executor.py
142 issues
Line: 49
Column: 5
__slots__ = ('targets',
'sources')
def __init__(self, targets=[], sources=[]):
self.targets = targets
self.sources = sources
Reported by Pylint.
Line: 49
Column: 5
__slots__ = ('targets',
'sources')
def __init__(self, targets=[], sources=[]):
self.targets = targets
self.sources = sources
Reported by Pylint.
Line: 65
Column: 5
a list during variable expansion. We're not really using any
collections.UserList methods in practice.
"""
def __init__(self, func):
self.func = func
def __getattr__(self, attr):
nl = self.func()
return getattr(nl, attr)
def __getitem__(self, i):
Reported by Pylint.
Line: 111
Column: 9
Node, e.g.).
"""
try:
rfile = node.rfile
except AttributeError:
return node
else:
return rfile()
Reported by Pylint.
Line: 118
Column: 26
return rfile()
def execute_nothing(obj, target, kw):
return 0
def execute_action_list(obj, target, kw):
"""Actually execute the action list."""
env = obj.get_build_env()
Reported by Pylint.
Line: 118
Column: 34
return rfile()
def execute_nothing(obj, target, kw):
return 0
def execute_action_list(obj, target, kw):
"""Actually execute the action list."""
env = obj.get_build_env()
Reported by Pylint.
Line: 118
Column: 21
return rfile()
def execute_nothing(obj, target, kw):
return 0
def execute_action_list(obj, target, kw):
"""Actually execute the action list."""
env = obj.get_build_env()
Reported by Pylint.
Line: 121
Column: 30
def execute_nothing(obj, target, kw):
return 0
def execute_action_list(obj, target, kw):
"""Actually execute the action list."""
env = obj.get_build_env()
kw = obj.get_kw(kw)
status = 0
for act in obj.get_action_list():
Reported by Pylint.
Line: 131
Column: 3
status = act(*args, **kw)
if isinstance(status, SCons.Errors.BuildError):
status.executor = obj
raise status # TODO pylint E0702: raising int not allowed
elif status:
msg = "Error %s" % status
raise SCons.Errors.BuildError(
errstr=msg,
node=obj.batches[0].targets,
Reported by Pylint.
Line: 152
Column: 22
env)
for action in obj.get_action_list()])
def execute_null_str(obj):
return ''
_execute_str_map = {0 : execute_null_str,
1 : execute_actions_str}
Reported by Pylint.
src/third_party/IntelRDFPMathLib20U1/LIBRARY/src/bid_div_macros.h
140 issues
Line: 301
CWE codes:
758
lq = lx / ly;
CY36.w[1] = CY.w[0] >> (64 - 36);
CY36.w[0] = CY.w[0] << 36;
CQ.w[1] = CQ.w[0] = 0;
// Q >= 2^100 ?
if (!CY.w[1] && !CY36.w[1] && (CX.w[1] >= CY36.w[0])) {
Reported by Cppcheck.
Line: 301
CWE codes:
758
lq = lx / ly;
CY36.w[1] = CY.w[0] >> (64 - 36);
CY36.w[0] = CY.w[0] << 36;
CQ.w[1] = CQ.w[0] = 0;
// Q >= 2^100 ?
if (!CY.w[1] && !CY36.w[1] && (CX.w[1] >= CY36.w[0])) {
Reported by Cppcheck.
Line: 301
CWE codes:
758
lq = lx / ly;
CY36.w[1] = CY.w[0] >> (64 - 36);
CY36.w[0] = CY.w[0] << 36;
CQ.w[1] = CQ.w[0] = 0;
// Q >= 2^100 ?
if (!CY.w[1] && !CY36.w[1] && (CX.w[1] >= CY36.w[0])) {
Reported by Cppcheck.
Line: 301
CWE codes:
758
lq = lx / ly;
CY36.w[1] = CY.w[0] >> (64 - 36);
CY36.w[0] = CY.w[0] << 36;
CQ.w[1] = CQ.w[0] = 0;
// Q >= 2^100 ?
if (!CY.w[1] && !CY36.w[1] && (CX.w[1] >= CY36.w[0])) {
Reported by Cppcheck.
Line: 301
CWE codes:
758
lq = lx / ly;
CY36.w[1] = CY.w[0] >> (64 - 36);
CY36.w[0] = CY.w[0] << 36;
CQ.w[1] = CQ.w[0] = 0;
// Q >= 2^100 ?
if (!CY.w[1] && !CY36.w[1] && (CX.w[1] >= CY36.w[0])) {
Reported by Cppcheck.
Line: 315
CWE codes:
758
Q = (BID_UINT64) lq - 4ull;
// Q*CY
__mul_64x64_to_128 (A2, Q, CY.w[0]);
// A2 <<= 60
A2.w[1] = (A2.w[1] << 60) | (A2.w[0] >> (64 - 60));
A2.w[0] <<= 60;
Reported by Cppcheck.
Line: 315
CWE codes:
758
Q = (BID_UINT64) lq - 4ull;
// Q*CY
__mul_64x64_to_128 (A2, Q, CY.w[0]);
// A2 <<= 60
A2.w[1] = (A2.w[1] << 60) | (A2.w[0] >> (64 - 60));
A2.w[0] <<= 60;
Reported by Cppcheck.
Line: 315
CWE codes:
758
Q = (BID_UINT64) lq - 4ull;
// Q*CY
__mul_64x64_to_128 (A2, Q, CY.w[0]);
// A2 <<= 60
A2.w[1] = (A2.w[1] << 60) | (A2.w[0] >> (64 - 60));
A2.w[0] <<= 60;
Reported by Cppcheck.
Line: 315
CWE codes:
758
Q = (BID_UINT64) lq - 4ull;
// Q*CY
__mul_64x64_to_128 (A2, Q, CY.w[0]);
// A2 <<= 60
A2.w[1] = (A2.w[1] << 60) | (A2.w[0] >> (64 - 60));
A2.w[0] <<= 60;
Reported by Cppcheck.
Line: 315
CWE codes:
758
Q = (BID_UINT64) lq - 4ull;
// Q*CY
__mul_64x64_to_128 (A2, Q, CY.w[0]);
// A2 <<= 60
A2.w[1] = (A2.w[1] << 60) | (A2.w[0] >> (64 - 60));
A2.w[0] <<= 60;
Reported by Cppcheck.
src/third_party/wiredtiger/test/3rdparty/python-subunit-0.0.16/python/subunit/tests/test_test_results.py
140 issues
Line: 22
Column: 1
import sys
import unittest
from testtools import TestCase
from testtools.compat import StringIO
from testtools.content import (
text_content,
TracebackContent,
)
Reported by Pylint.
Line: 23
Column: 1
import unittest
from testtools import TestCase
from testtools.compat import StringIO
from testtools.content import (
text_content,
TracebackContent,
)
from testtools.testresult.doubles import ExtendedTestResult
Reported by Pylint.
Line: 24
Column: 1
from testtools import TestCase
from testtools.compat import StringIO
from testtools.content import (
text_content,
TracebackContent,
)
from testtools.testresult.doubles import ExtendedTestResult
Reported by Pylint.
Line: 28
Column: 1
text_content,
TracebackContent,
)
from testtools.testresult.doubles import ExtendedTestResult
import subunit
import subunit.iso8601 as iso8601
import subunit.test_results
Reported by Pylint.
Line: 34
Column: 1
import subunit.iso8601 as iso8601
import subunit.test_results
import testtools
class LoggingDecorator(subunit.test_results.HookedTestResultDecorator):
def __init__(self, decorated):
Reported by Pylint.
Line: 55
Column: 34
super(AssertBeforeTestResult, self).__init__(decorated)
def _before_event(self):
self.test.assertEqual(1, self.earlier._calls)
super(AssertBeforeTestResult, self)._before_event()
class TimeCapturingResult(unittest.TestResult):
Reported by Pylint.
Line: 85
Column: 29
def tearDown(self):
# The hook in self.result must have been called
self.assertEqual(1, self.result._calls)
# The hook in asserter must have been called too, otherwise the
# assertion about ordering won't have completed.
self.assertEqual(1, self.decorated._calls)
def test_startTest(self):
Reported by Pylint.
Line: 88
Column: 29
self.assertEqual(1, self.result._calls)
# The hook in asserter must have been called too, otherwise the
# assertion about ordering won't have completed.
self.assertEqual(1, self.decorated._calls)
def test_startTest(self):
self.result.startTest(self)
def test_startTestRun(self):
Reported by Pylint.
Line: 145
Column: 9
self.result.wasSuccessful()
def test_shouldStop(self):
self.result.shouldStop
def test_stop(self):
self.result.stop()
def test_time(self):
Reported by Pylint.
Line: 166
Column: 33
def test_without_time_calls_time_is_called_and_not_None(self):
self.result.startTest(self)
self.assertEqual(1, len(self.decorated._calls))
self.assertNotEqual(None, self.decorated._calls[0])
def test_no_time_from_progress(self):
self.result.progress(1, subunit.PROGRESS_CUR)
self.assertEqual(0, len(self.decorated._calls))
Reported by Pylint.
src/third_party/wiredtiger/test/suite/run.py
136 issues
Line: 332
Column: 14
start, end = (int(a) for a in arg.split('-'))
else:
start, end = int(arg), int(arg)
for t in xrange(start, end+1):
addScenarioTests(tests, loader, 'test%03d' % t, scenario)
def error(exitval, prefix, msg):
print('*** ERROR: {}: {}'.format(prefix, msg.replace('\n', '\n*** ')))
sys.exit(exitval)
Reported by Pylint.
Line: 533
Column: 17
if not os.environ.get(ASAN_SYMBOLIZER_ENV):
os.environ[ASAN_SYMBOLIZER_ENV] = which(ASAN_SYMBOLIZER_PROG)
if not os.environ.get(ASAN_SYMBOLIZER_ENV):
error(ASAN_SYMBOLIZER_ENV,
'symbolizer program not found in PATH')
show_env(verbose, ASAN_SYMBOLIZER_ENV)
if not os.environ.get(LD_PRELOAD_ENV):
symbolizer = follow_symlinks(os.environ[ASAN_SYMBOLIZER_ENV])
bindir = os.path.dirname(symbolizer)
Reported by Pylint.
Line: 567
Column: 5
# Use the same version of unittest found by wttest.py
unittest = wttest.unittest
tests = unittest.TestSuite()
from testscenarios.scenarios import generate_scenarios
import wthooks
hookmgr = wthooks.WiredTigerHookManager(hook_names)
# All global variables should be set before any test classes are loaded.
# That way, verbose printing can be done at the class definition level.
Reported by Pylint.
Line: 584
Column: 9
'run.py: specifying a scenario requires a test name\n')
usage()
sys.exit(2)
from discover import defaultTestLoader as loader
suites = loader.discover(suitedir)
suites = sorted(suites, key=lambda c: str(list(c)[0]))
if configfile != None:
suites = configApply(suites, configfile, configwrite)
tests.addTests(restrictScenario(generate_scenarios(suites), ''))
Reported by Pylint.
Line: 83
Column: 21
sys.path.insert(1, os.path.join(wt_builddir, 'lang', 'python'))
# Append to a colon separated path in the environment
def append_env_path(name, value):
path = os.environ.get(name)
if path == None:
v = value
else:
v = path + ':' + value
Reported by Pylint.
Line: 153
Column: 11
')
# Find an executable of the given name in the execution path.
def which(name):
path = os.getenv('PATH')
for pathdir in path.split(os.path.pathsep):
fname = os.path.join(pathdir, name)
if os.path.exists(fname) and os.access(fname, os.X_OK):
return fname
Reported by Pylint.
Line: 168
Column: 15
# Find all instances of a filename under a directory
def find(topdir, filename):
results = []
for root, dirs, files in os.walk(topdir, followlinks=True):
if filename in files:
results.append(os.path.join(root, filename))
return results
# Show an environment variable if verbose enough.
Reported by Pylint.
Line: 174
Column: 14
return results
# Show an environment variable if verbose enough.
def show_env(verbose, envvar):
if verbose >= 2:
print(envvar + "=" + os.getenv(envvar))
# capture the category (AKA 'subsuite') part of a test name,
# e.g. test_util03 -> util
Reported by Pylint.
Line: 183
Column: 20
reCatname = re.compile(r"test_([^0-9]+)[0-9]*")
# Look for a list of the form 0-9,11,15-17.
def parse_int_list(str):
# Use a dictionary as the result set to avoid repeated list scans.
# (Only the keys are used; the values are ignored.)
ret = {}
# Divide the input into ranges separated by commas.
for r in str.split(","):
Reported by Pylint.
Line: 193
Column: 13
bounds = r.split("-")
if len(bounds) == 1 and bounds[0].isdigit():
# It's a single number with no dash.
scenario = int(bounds[0])
ret[scenario] = True
continue
if len(bounds) == 2 and bounds[0].isdigit() and bounds[1].isdigit():
# It's two numbers separated by a dash.
for scenario in range(int(bounds[0]), int(bounds[1]) + 1):
Reported by Pylint.
src/third_party/scons-3.1.2/scons-local-3.1.2/SCons/Tool/tex.py
135 issues
Line: 850
Column: 5
generate_common(env)
from . import dvi
dvi.generate(env)
bld = env['BUILDERS']['DVI']
bld.add_action('.tex', TeXLaTeXAction)
bld.add_emitter('.tex', tex_eps_emitter)
Reported by Pylint.
Line: 153
Column: 9
MakeNewGlossaryAction = None
# Used as a return value of modify_env_var if the variable is not set.
_null = SCons.Scanner.LaTeX._null
modify_env_var = SCons.Scanner.LaTeX.modify_env_var
def check_file_error_message(utility, filename='log'):
msg = '%s returned an error, check the %s file\n' % (utility, filename)
Reported by Pylint.
Line: 201
Column: 5
"""A builder for LaTeX files that checks the output in the aux file
and decides how many times to use LaTeXAction, and BibTeXAction."""
global must_rerun_latex
# This routine is called with two actions. In this file for DVI builds
# with LaTeXAction and from the pdflatex.py with PDFLaTeXAction
# set this up now for the case where the user requests a different extension
# for the target filename
Reported by Pylint.
Line: 217
Column: 5
basefile = os.path.split(str(basename))[1]
abspath = os.path.abspath(basedir)
targetext = os.path.splitext(str(target[0]))[1]
targetdir = os.path.split(str(target[0]))[0]
saved_env = {}
for var in SCons.Scanner.LaTeX.LaTeX.env_variables:
saved_env[var] = modify_env_var(env, var, abspath)
Reported by Pylint.
Line: 265
Column: 9
# routine to update MD5 hash and compare
#
def check_MD5(filenode, suffix):
global must_rerun_latex
# two calls to clear old csig
filenode.clear_memoized_values()
filenode.ninfo = filenode.new_ninfo()
new_md5 = filenode.get_csig()
Reported by Pylint.
Line: 440
Column: 17
if Verbose:
print("Need to run makeindex for newglossary")
newglfile = suffix_nodes[newglossary_suffix[ig][2]]
MakeNewGlossaryAction = SCons.Action.Action("$MAKENEWGLOSSARYCOM ${SOURCE.filebase}%s -s ${SOURCE.filebase}.ist -t ${SOURCE.filebase}%s -o ${SOURCE.filebase}%s" % (newglossary_suffix[ig][2],newglossary_suffix[ig][0],newglossary_suffix[ig][1]), "$MAKENEWGLOSSARYCOMSTR")
result = MakeNewGlossaryAction(newglfile, newglfile, env)
if result != 0:
check_file_error_message('%s (newglossary)' % env['MAKENEWGLOSSARY'],
newglossary_suffix[ig][0])
Reported by Pylint.
Line: 690
Column: 5
#
# file names we will make use of in searching the sources and log file
#
emit_suffixes = ['.aux', '.log', '.ilg', '.blg', '.nls', '.nlg', '.gls', '.glg', '.alg'] + all_suffixes
auxfilename = targetbase + '.aux'
logfilename = targetbase + '.log'
flsfilename = targetbase + '.fls'
syncfilename = targetbase + '.synctex.gz'
Reported by Pylint.
Line: 841
Column: 5
def generate(env):
"""Add Builders and construction variables for TeX to an Environment."""
global TeXLaTeXAction
if TeXLaTeXAction is None:
TeXLaTeXAction = SCons.Action.Action(TeXLaTeXFunction,
strfunction=TeXLaTeXStrFunction)
env.AppendUnique(LATEXSUFFIXES=SCons.Tool.LaTeXSuffixes)
Reported by Pylint.
Line: 867
Column: 9
if (platform.system() == 'Darwin'):
try:
ospath = env['ENV']['PATHOSX']
except:
ospath = None
if ospath:
env.AppendENVPath('PATH', ospath)
def generate_common(env):
Reported by Pylint.
Line: 880
Column: 5
generate_darwin(env)
# A generic tex file Action, sufficient for all tex files.
global TeXAction
if TeXAction is None:
TeXAction = SCons.Action.Action("$TEXCOM", "$TEXCOMSTR")
# An Action to build a latex file. This might be needed more
# than once if we are dealing with labels and bibtex.
Reported by Pylint.
src/third_party/scons-3.1.2/scons-local-3.1.2/SCons/Script/SConscript.py
127 issues
Line: 47
Column: 1
import SCons.Tool
from SCons.Util import is_List, is_String, is_Dict, flatten
from . import Main
import collections
import os
import os.path
import re
Reported by Pylint.
Line: 49
Column: 1
from . import Main
import collections
import os
import os.path
import re
import sys
import traceback
Reported by Pylint.
Line: 133
Column: 1
# For documentation on the methods in this file, see the scons man-page
def Return(*vars, **kw):
retval = []
try:
fvars = flatten(vars)
for var in fvars:
for v in var.split():
Reported by Pylint.
Line: 171
Column: 23
SCons.Script._no_missing_sconscript is True.
"""
if must_exist or (SCons.Script._no_missing_sconscript and must_exist is not False):
msg = "Fatal: missing SConscript '%s'" % f.get_internal_path()
raise SCons.Errors.UserError(msg)
if SCons.Script._warn_missing_sconscript_deprecated:
msg = "Calling missing SConscript without error is deprecated.\n" + \
Reported by Pylint.
Line: 175
Column: 8
msg = "Fatal: missing SConscript '%s'" % f.get_internal_path()
raise SCons.Errors.UserError(msg)
if SCons.Script._warn_missing_sconscript_deprecated:
msg = "Calling missing SConscript without error is deprecated.\n" + \
"Transition by adding must_exist=0 to SConscript calls.\n" + \
"Missing SConscript '%s'" % f.get_internal_path()
SCons.Warnings.warn(SCons.Warnings.MissingSConscriptWarning, msg)
SCons.Script._warn_missing_sconscript_deprecated = False
Reported by Pylint.
Line: 180
Column: 9
"Transition by adding must_exist=0 to SConscript calls.\n" + \
"Missing SConscript '%s'" % f.get_internal_path()
SCons.Warnings.warn(SCons.Warnings.MissingSConscriptWarning, msg)
SCons.Script._warn_missing_sconscript_deprecated = False
else:
msg = "Ignoring missing SConscript '%s'" % f.get_internal_path()
SCons.Warnings.warn(SCons.Warnings.MissingSConscriptWarning, msg)
def _SConscript(fs, *files, **kw):
Reported by Pylint.
Line: 198
Column: 17
try:
SCons.Script.sconscript_reading = SCons.Script.sconscript_reading + 1
if fn == "-":
exec(sys.stdin.read(), call_stack[-1].globals)
else:
if isinstance(fn, SCons.Node.Node):
f = fn
else:
f = fs.File(str(fn))
Reported by Pylint.
Line: 198
Suggestion:
https://bandit.readthedocs.io/en/latest/plugins/b102_exec_used.html
try:
SCons.Script.sconscript_reading = SCons.Script.sconscript_reading + 1
if fn == "-":
exec(sys.stdin.read(), call_stack[-1].globals)
else:
if isinstance(fn, SCons.Node.Node):
f = fn
else:
f = fs.File(str(fn))
Reported by Bandit.
Line: 233
Column: 3
# creating a parallel SConscript directory structure
# in our local directory tree.
#
# XXX This is broken for multiple-repository cases
# where the SConstruct and SConscript files might be
# in different Repositories. For now, cross that
# bridge when someone comes to it.
try:
src_dir = kw['src_dir']
Reported by Pylint.
Line: 286
Suggestion:
https://bandit.readthedocs.io/en/latest/plugins/b102_exec_used.html
scriptdata = _file_.read()
scriptname = _file_.name
_file_.close()
exec(compile(scriptdata, scriptname, 'exec'), call_stack[-1].globals)
except SConscriptReturn:
pass
finally:
if Main.print_time:
time2 = time.time()
Reported by Bandit.
src/third_party/wiredtiger/test/suite/test_join07.py
127 issues
Line: 30
Column: 1
# OTHER DEALINGS IN THE SOFTWARE.
import os, re, run
import wiredtiger, wttest, suite_random
from wtscenario import make_scenarios
class ParseException(Exception):
def __init__(self, msg):
super(ParseException, self).__init__(msg)
Reported by Pylint.
Line: 185
Column: 9
return None
def tty(self, s):
wttest.WiredTigerTestCase.tty(s)
# test_join07.py
# Join interpreter
class test_join07(wttest.WiredTigerTestCase):
reverseop = { '==' : '==', '<=' : '>=', '<' : '>', '>=' : '<=', '>' : '<' }
Reported by Pylint.
Line: 29
Column: 1
# ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
# OTHER DEALINGS IN THE SOFTWARE.
import os, re, run
import wiredtiger, wttest, suite_random
from wtscenario import make_scenarios
class ParseException(Exception):
def __init__(self, msg):
Reported by Pylint.
Line: 29
Column: 1
# ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
# OTHER DEALINGS IN THE SOFTWARE.
import os, re, run
import wiredtiger, wttest, suite_random
from wtscenario import make_scenarios
class ParseException(Exception):
def __init__(self, msg):
Reported by Pylint.
Line: 30
Column: 1
# OTHER DEALINGS IN THE SOFTWARE.
import os, re, run
import wiredtiger, wttest, suite_random
from wtscenario import make_scenarios
class ParseException(Exception):
def __init__(self, msg):
super(ParseException, self).__init__(msg)
Reported by Pylint.
Line: 30
Column: 1
# OTHER DEALINGS IN THE SOFTWARE.
import os, re, run
import wiredtiger, wttest, suite_random
from wtscenario import make_scenarios
class ParseException(Exception):
def __init__(self, msg):
super(ParseException, self).__init__(msg)
Reported by Pylint.
Line: 34
Column: 5
from wtscenario import make_scenarios
class ParseException(Exception):
def __init__(self, msg):
super(ParseException, self).__init__(msg)
class Token:
UNKNOWN = '<unknown>'
NUMBER = 'Number'
Reported by Pylint.
Line: 213
Column: 9
return token
def err(self, token, msg):
self.assertTrue(False, 'ERROR at token ' + str(token) + ': ' + msg)
def gen_key(self, i):
if self.keyformat == 'S':
return [ 'key%06d' % i ] # zero pad so it sorts expectedly
else:
Reported by Pylint.
Line: 253
Column: 17
# Duplicates may be returned when the disjunctions are used,
# so we ignore them.
if not i in gotkeys:
self.assertEquals(self.gen_values(i), values)
if not i in mbr:
self.tty('ERROR: result ' + str(i) + ' is not in: ' +
str(mbr))
self.assertTrue(i in mbr)
mbr.remove(i)
Reported by Pylint.
Line: 260
Column: 9
self.assertTrue(i in mbr)
mbr.remove(i)
gotkeys.append(i)
self.assertEquals(0, len(mbr))
def token_literal(self, token):
if token.kind == Token.STRING:
return token.s
elif token.kind == Token.NUMBER:
Reported by Pylint.
src/third_party/wiredtiger/test/suite/test_cursor_tracker.py
124 issues
Line: 77
Column: 1
# we want to do here).
import hashlib
import wiredtiger, wttest
class TestCursorTracker(wttest.WiredTigerTestCase):
table_name1 = 'test_cursor'
DELETED = 0xffffffffffffffff
TRACE_API = False # a print output for each WT API call
Reported by Pylint.
Line: 69
Column: 9
# Thus, the key remains unchanged, but the associated value
# changes (the size of the value may be altered as well).
#
# TODO: we need to separate the cursor tracking information
# (the current position where we believe we are) from
# the database information (what we think is in the data storage).
# Once that's done, we can have multiple cursor tests
# (though simulating transactions would probably be beyond what
# we want to do here).
Reported by Pylint.
Line: 125
Column: 13
def setup_encoders_decoders(self):
if self.tablekind == 'row':
self.encode_key = self.encode_key_row
self.decode_key = self.decode_key_row
self.encode_value = self.encode_value_row_or_col
self.decode_value = self.decode_value_row_or_col
elif self.tablekind == 'col':
self.encode_key = self.encode_key_col_or_fix
Reported by Pylint.
Line: 126
Column: 13
def setup_encoders_decoders(self):
if self.tablekind == 'row':
self.encode_key = self.encode_key_row
self.decode_key = self.decode_key_row
self.encode_value = self.encode_value_row_or_col
self.decode_value = self.decode_value_row_or_col
elif self.tablekind == 'col':
self.encode_key = self.encode_key_col_or_fix
self.decode_key = self.decode_key_col_or_fix
Reported by Pylint.
Line: 127
Column: 13
if self.tablekind == 'row':
self.encode_key = self.encode_key_row
self.decode_key = self.decode_key_row
self.encode_value = self.encode_value_row_or_col
self.decode_value = self.decode_value_row_or_col
elif self.tablekind == 'col':
self.encode_key = self.encode_key_col_or_fix
self.decode_key = self.decode_key_col_or_fix
self.encode_value = self.encode_value_row_or_col
Reported by Pylint.
Line: 128
Column: 13
self.encode_key = self.encode_key_row
self.decode_key = self.decode_key_row
self.encode_value = self.encode_value_row_or_col
self.decode_value = self.decode_value_row_or_col
elif self.tablekind == 'col':
self.encode_key = self.encode_key_col_or_fix
self.decode_key = self.decode_key_col_or_fix
self.encode_value = self.encode_value_row_or_col
self.decode_value = self.decode_value_row_or_col
Reported by Pylint.
Line: 130
Column: 13
self.encode_value = self.encode_value_row_or_col
self.decode_value = self.decode_value_row_or_col
elif self.tablekind == 'col':
self.encode_key = self.encode_key_col_or_fix
self.decode_key = self.decode_key_col_or_fix
self.encode_value = self.encode_value_row_or_col
self.decode_value = self.decode_value_row_or_col
else:
self.encode_key = self.encode_key_col_or_fix
Reported by Pylint.
Line: 131
Column: 13
self.decode_value = self.decode_value_row_or_col
elif self.tablekind == 'col':
self.encode_key = self.encode_key_col_or_fix
self.decode_key = self.decode_key_col_or_fix
self.encode_value = self.encode_value_row_or_col
self.decode_value = self.decode_value_row_or_col
else:
self.encode_key = self.encode_key_col_or_fix
self.decode_key = self.decode_key_col_or_fix
Reported by Pylint.
Line: 132
Column: 13
elif self.tablekind == 'col':
self.encode_key = self.encode_key_col_or_fix
self.decode_key = self.decode_key_col_or_fix
self.encode_value = self.encode_value_row_or_col
self.decode_value = self.decode_value_row_or_col
else:
self.encode_key = self.encode_key_col_or_fix
self.decode_key = self.decode_key_col_or_fix
self.encode_value = self.encode_value_fix
Reported by Pylint.
Line: 133
Column: 13
self.encode_key = self.encode_key_col_or_fix
self.decode_key = self.decode_key_col_or_fix
self.encode_value = self.encode_value_row_or_col
self.decode_value = self.decode_value_row_or_col
else:
self.encode_key = self.encode_key_col_or_fix
self.decode_key = self.decode_key_col_or_fix
self.encode_value = self.encode_value_fix
self.decode_value = self.decode_value_fix
Reported by Pylint.