The following issues were found

src/third_party/wiredtiger/test/suite/test_join03.py
29 issues
Unable to import 'wiredtiger'
Error

Line: 30 Column: 1

              # OTHER DEALINGS IN THE SOFTWARE.

import os
import wiredtiger, wttest, run

# test_join03.py
#    Join operations
# Joins with a custom extractor
class test_join03(wttest.WiredTigerTestCase):

            

Reported by Pylint.

Unused import os
Error

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
import wiredtiger, wttest, run

# test_join03.py
#    Join operations
# Joins with a custom extractor

            

Reported by Pylint.

Unused import wiredtiger
Error

Line: 30 Column: 1

              # OTHER DEALINGS IN THE SOFTWARE.

import os
import wiredtiger, wttest, run

# test_join03.py
#    Join operations
# Joins with a custom extractor
class test_join03(wttest.WiredTigerTestCase):

            

Reported by Pylint.

Unused import run
Error

Line: 30 Column: 1

              # OTHER DEALINGS IN THE SOFTWARE.

import os
import wiredtiger, wttest, run

# test_join03.py
#    Join operations
# Joins with a custom extractor
class test_join03(wttest.WiredTigerTestCase):

            

Reported by Pylint.

Using deprecated method assertEquals()
Error

Line: 58 Column: 13

                          [k] = jc.get_keys()
            i = k - 1
            [v] = jc.get_values()
            self.assertEquals(self.gen_values(i), [v])
            if not i in mbr:
                self.tty('  result ' + str(i) + ' is not in: ' + str(mbr))
            self.assertTrue(i in mbr)
            mbr.remove(i)
        self.assertEquals(0, len(mbr))

            

Reported by Pylint.

Using deprecated method assertEquals()
Error

Line: 63 Column: 9

                              self.tty('  result ' + str(i) + ' is not in: ' + str(mbr))
            self.assertTrue(i in mbr)
            mbr.remove(i)
        self.assertEquals(0, len(mbr))

    # Common function for testing the most basic functionality
    # of joins
    def join(self, csvformat, args0, args1):
        self.session.create('table:join03', 'key_format=r' +

            

Reported by Pylint.

Using deprecated method assertEquals()
Error

Line: 96 Column: 9

                          c0.set_key('60')
        else:
            c0.set_key(60)
        self.assertEquals(0, c0.search())
        self.session.join(jc, c0, 'compare=ge' + args0)

        c1a = self.session.open_cursor('index:join03:index1', None, None)
        if csvformat[1] == 'S':
            c1a.set_key('21')

            

Reported by Pylint.

Using deprecated method assertEquals()
Error

Line: 104 Column: 9

                          c1a.set_key('21')
        else:
            c1a.set_key(21)
        self.assertEquals(0, c1a.search())
        self.session.join(jc, c1a, 'compare=gt' + args1)

        c1b = self.session.open_cursor('index:join03:index1', None, None)
        if csvformat[1] == 'S':
            c1b.set_key('41')

            

Reported by Pylint.

Using deprecated method assertEquals()
Error

Line: 112 Column: 9

                          c1b.set_key('41')
        else:
            c1b.set_key(41)
        self.assertEquals(0, c1b.search())
        self.session.join(jc, c1b, 'compare=lt' + args1)

        # Iterate, and make sure that reset allows us to iterate again.
        self.iter_common(jc)


            

Reported by Pylint.

Missing module docstring
Error

Line: 1 Column: 1

              #!/usr/bin/env python
#
# Public Domain 2014-present MongoDB, Inc.
# Public Domain 2008-2014 WiredTiger, Inc.
#
# This is free and unencumbered software released into the public domain.
#
# Anyone is free to copy, modify, publish, use, compile, sell, or
# distribute this software, either in source code form or as a compiled

            

Reported by Pylint.

src/third_party/mozjs-60/extract/js/src/jit/arm/CodeGenerator-arm.cpp
29 issues
access - This usually indicates a security flaw. If an attacker can change anything along the path between the call to access() and the file's actual use (e.g., by moving files), the attacker can exploit the race condition
Security

Line: 2006 Column: 14 CWE codes: 362/367!
Suggestion: Set up the correct permissions (e.g., using setuid()) and try to open the file directly

                  MIRType resultType = mir->type();
    Register ptr;

    if (mir->access().offset() || mir->access().type() == Scalar::Int64) {
        ptr = ToRegister(lir->ptrCopy());
    } else {
        MOZ_ASSERT(lir->ptrCopy()->isBogusTemp());
        ptr = ToRegister(lir->ptr());
    }

            

Reported by FlawFinder.

access - This usually indicates a security flaw. If an attacker can change anything along the path between the call to access() and the file's actual use (e.g., by moving files), the attacker can exploit the race condition
Security

Line: 2006 Column: 40 CWE codes: 362/367!
Suggestion: Set up the correct permissions (e.g., using setuid()) and try to open the file directly

                  MIRType resultType = mir->type();
    Register ptr;

    if (mir->access().offset() || mir->access().type() == Scalar::Int64) {
        ptr = ToRegister(lir->ptrCopy());
    } else {
        MOZ_ASSERT(lir->ptrCopy()->isBogusTemp());
        ptr = ToRegister(lir->ptr());
    }

            

Reported by FlawFinder.

access - This usually indicates a security flaw. If an attacker can change anything along the path between the call to access() and the file's actual use (e.g., by moving files), the attacker can exploit the race condition
Security

Line: 2014 Column: 31 CWE codes: 362/367!
Suggestion: Set up the correct permissions (e.g., using setuid()) and try to open the file directly

                  }

    if (resultType == MIRType::Int64)
        masm.wasmLoadI64(mir->access(), HeapReg, ptr, ptr, ToOutRegister64(lir));
    else
        masm.wasmLoad(mir->access(), HeapReg, ptr, ptr, ToAnyRegister(lir->output()));
}

void

            

Reported by FlawFinder.

access - This usually indicates a security flaw. If an attacker can change anything along the path between the call to access() and the file's actual use (e.g., by moving files), the attacker can exploit the race condition
Security

Line: 2016 Column: 28 CWE codes: 362/367!
Suggestion: Set up the correct permissions (e.g., using setuid()) and try to open the file directly

                  if (resultType == MIRType::Int64)
        masm.wasmLoadI64(mir->access(), HeapReg, ptr, ptr, ToOutRegister64(lir));
    else
        masm.wasmLoad(mir->access(), HeapReg, ptr, ptr, ToAnyRegister(lir->output()));
}

void
CodeGeneratorARM::visitWasmLoad(LWasmLoad* lir)
{

            

Reported by FlawFinder.

access - This usually indicates a security flaw. If an attacker can change anything along the path between the call to access() and the file's actual use (e.g., by moving files), the attacker can exploit the race condition
Security

Line: 2042 Column: 40 CWE codes: 362/367!
Suggestion: Set up the correct permissions (e.g., using setuid()) and try to open the file directly

                  Register tmp1 = ToRegister(lir->getTemp(1));

    if (resultType == MIRType::Int64) {
        masm.wasmUnalignedLoadI64(mir->access(), HeapReg, ptr, ptr, ToOutRegister64(lir), tmp1);
    } else if (IsFloatingPointType(resultType)) {
        Register tmp2(ToRegister(lir->getTemp(2)));
        Register tmp3(Register::Invalid());
        if (mir->access().byteSize() == 8)
            tmp3 = ToRegister(lir->getTemp(3));

            

Reported by FlawFinder.

access - This usually indicates a security flaw. If an attacker can change anything along the path between the call to access() and the file's actual use (e.g., by moving files), the attacker can exploit the race condition
Security

Line: 2046 Column: 18 CWE codes: 362/367!
Suggestion: Set up the correct permissions (e.g., using setuid()) and try to open the file directly

                  } else if (IsFloatingPointType(resultType)) {
        Register tmp2(ToRegister(lir->getTemp(2)));
        Register tmp3(Register::Invalid());
        if (mir->access().byteSize() == 8)
            tmp3 = ToRegister(lir->getTemp(3));
        masm.wasmUnalignedLoadFP(mir->access(), HeapReg, ptr, ptr, ToFloatRegister(lir->output()),
                                 tmp1, tmp2, tmp3);
    } else {
        masm.wasmUnalignedLoad(mir->access(), HeapReg, ptr, ptr, ToRegister(lir->output()), tmp1);

            

Reported by FlawFinder.

access - This usually indicates a security flaw. If an attacker can change anything along the path between the call to access() and the file's actual use (e.g., by moving files), the attacker can exploit the race condition
Security

Line: 2048 Column: 39 CWE codes: 362/367!
Suggestion: Set up the correct permissions (e.g., using setuid()) and try to open the file directly

                      Register tmp3(Register::Invalid());
        if (mir->access().byteSize() == 8)
            tmp3 = ToRegister(lir->getTemp(3));
        masm.wasmUnalignedLoadFP(mir->access(), HeapReg, ptr, ptr, ToFloatRegister(lir->output()),
                                 tmp1, tmp2, tmp3);
    } else {
        masm.wasmUnalignedLoad(mir->access(), HeapReg, ptr, ptr, ToRegister(lir->output()), tmp1);
    }
}

            

Reported by FlawFinder.

access - This usually indicates a security flaw. If an attacker can change anything along the path between the call to access() and the file's actual use (e.g., by moving files), the attacker can exploit the race condition
Security

Line: 2051 Column: 37 CWE codes: 362/367!
Suggestion: Set up the correct permissions (e.g., using setuid()) and try to open the file directly

                      masm.wasmUnalignedLoadFP(mir->access(), HeapReg, ptr, ptr, ToFloatRegister(lir->output()),
                                 tmp1, tmp2, tmp3);
    } else {
        masm.wasmUnalignedLoad(mir->access(), HeapReg, ptr, ptr, ToRegister(lir->output()), tmp1);
    }
}

void
CodeGeneratorARM::visitWasmUnalignedLoad(LWasmUnalignedLoad* lir)

            

Reported by FlawFinder.

access - This usually indicates a security flaw. If an attacker can change anything along the path between the call to access() and the file's actual use (e.g., by moving files), the attacker can exploit the race condition
Security

Line: 2085 Column: 36 CWE codes: 362/367!
Suggestion: Set up the correct permissions (e.g., using setuid()) and try to open the file directly

              CodeGeneratorARM::emitWasmStore(T* lir)
{
    const MWasmStore* mir = lir->mir();
    Scalar::Type accessType = mir->access().type();
    Register ptr;

    // Maybe add the offset.
    if (mir->access().offset() || accessType == Scalar::Int64) {
        ptr = ToRegister(lir->ptrCopy());

            

Reported by FlawFinder.

access - This usually indicates a security flaw. If an attacker can change anything along the path between the call to access() and the file's actual use (e.g., by moving files), the attacker can exploit the race condition
Security

Line: 2089 Column: 14 CWE codes: 362/367!
Suggestion: Set up the correct permissions (e.g., using setuid()) and try to open the file directly

                  Register ptr;

    // Maybe add the offset.
    if (mir->access().offset() || accessType == Scalar::Int64) {
        ptr = ToRegister(lir->ptrCopy());
    } else {
        MOZ_ASSERT(lir->ptrCopy()->isBogusTemp());
        ptr = ToRegister(lir->ptr());
    }

            

Reported by FlawFinder.

site_scons/site_tools/vcredist.py
29 issues
Unable to import 'winreg'
Error

Line: 26 Column: 1

              import os
import re
import subprocess
import winreg

import SCons


def exists(env):

            

Reported by Pylint.

Unable to import 'SCons'
Error

Line: 28 Column: 1

              import subprocess
import winreg

import SCons


def exists(env):
    result = "msvc" in env["TOOLS"]
    return result

            

Reported by Pylint.

Undefined variable 'WindowsError'
Error

Line: 188 Column: 12

                      vslib_version, vslib_version_type = winreg.QueryValueEx(
            vsruntime_key, "Version"
        )
    except WindowsError:
        return

    # Fallback to directory search if we don't find the expected version
    redist_path = os.path.join(
        redist_root, re.match("v(\d+\.\d+\.\d+)\.\d+", vslib_version).group(1)

            

Reported by Pylint.

Unused import SCons
Error

Line: 28 Column: 1

              import subprocess
import winreg

import SCons


def exists(env):
    result = "msvc" in env["TOOLS"]
    return result

            

Reported by Pylint.

TODO: Expand this map as needed.
Error

Line: 53 Column: 3

              # different windows targets, the values are the tag that VS uses
# for the associated redistributable for that platform.
#
# TODO: Expand this map as needed.
target_arch_expansion_map = {
    "amd64": "x64",
    "arm": None,
    "arm64": "arm64",
    "emt64": "x64",

            

Reported by Pylint.

TODO: Getting this path is a start, but we should later provide
Error

Line: 109 Column: 3

                  # depending on the various paths we take throught this logic.
    programfilesx86 = None

    # TODO: Getting this path is a start, but we should later provide
    # an abstraction over the names of the merge modules
    # themselves. They seem to have the form
    # Microsoft_VC{msvc_major}{msvc_minor}_{Feature}_{target_arch}.msm. It
    # would be useful to provide an env.MergeModuleNameFor('feature')
    # that consulted the values we have found here and used

            

Reported by Pylint.

Unused variable 'vslib_version_type'
Error

Line: 185 Column: 24

                          msvc_major=msvc_major
        )
        vsruntime_key = winreg.OpenKey(winreg.HKEY_LOCAL_MACHINE, vsruntime_key_name)
        vslib_version, vslib_version_type = winreg.QueryValueEx(
            vsruntime_key, "Version"
        )
    except WindowsError:
        return


            

Reported by Pylint.

Anomalous backslash in string: '\d'. String constant might be missing an r prefix.
Error

Line: 193 Column: 34

              
    # Fallback to directory search if we don't find the expected version
    redist_path = os.path.join(
        redist_root, re.match("v(\d+\.\d+\.\d+)\.\d+", vslib_version).group(1)
    )
    if not os.path.isdir(redist_path):
        redist_path = None
        dirs = os.listdir(redist_root)
        dirs.sort()

            

Reported by Pylint.

Anomalous backslash in string: '\d'. String constant might be missing an r prefix.
Error

Line: 193 Column: 39

              
    # Fallback to directory search if we don't find the expected version
    redist_path = os.path.join(
        redist_root, re.match("v(\d+\.\d+\.\d+)\.\d+", vslib_version).group(1)
    )
    if not os.path.isdir(redist_path):
        redist_path = None
        dirs = os.listdir(redist_root)
        dirs.sort()

            

Reported by Pylint.

Anomalous backslash in string: '\.'. String constant might be missing an r prefix.
Error

Line: 193 Column: 37

              
    # Fallback to directory search if we don't find the expected version
    redist_path = os.path.join(
        redist_root, re.match("v(\d+\.\d+\.\d+)\.\d+", vslib_version).group(1)
    )
    if not os.path.isdir(redist_path):
        redist_path = None
        dirs = os.listdir(redist_root)
        dirs.sort()

            

Reported by Pylint.

src/third_party/wiredtiger/test/suite/test_cursor_compare.py
29 issues
Unable to import 'wiredtiger'
Error

Line: 29 Column: 1

              # ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
# OTHER DEALINGS IN THE SOFTWARE.

import wiredtiger, wttest
from wtdataset import SimpleDataSet, ComplexDataSet, ComplexLSMDataSet
from wtscenario import filter_scenarios, make_scenarios

# Test cursor comparisons.
class test_cursor_comparison(wttest.WiredTigerTestCase):

            

Reported by Pylint.

Missing module docstring
Error

Line: 1 Column: 1

              #!/usr/bin/env python
#
# Public Domain 2014-present MongoDB, Inc.
# Public Domain 2008-2014 WiredTiger, Inc.
#
# This is free and unencumbered software released into the public domain.
#
# Anyone is free to copy, modify, publish, use, compile, sell, or
# distribute this software, either in source code form or as a compiled

            

Reported by Pylint.

Multiple imports on one line (wiredtiger, wttest)
Error

Line: 29 Column: 1

              # ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
# OTHER DEALINGS IN THE SOFTWARE.

import wiredtiger, wttest
from wtdataset import SimpleDataSet, ComplexDataSet, ComplexLSMDataSet
from wtscenario import filter_scenarios, make_scenarios

# Test cursor comparisons.
class test_cursor_comparison(wttest.WiredTigerTestCase):

            

Reported by Pylint.

Class name "test_cursor_comparison" doesn't conform to PascalCase naming style
Error

Line: 34 Column: 1

              from wtscenario import filter_scenarios, make_scenarios

# Test cursor comparisons.
class test_cursor_comparison(wttest.WiredTigerTestCase):
    name = 'test_compare'

    types = [
        ('file', dict(type='file:', lsm=False, dataset=SimpleDataSet)),
        ('lsm', dict(type='table:', lsm=True, dataset=ComplexLSMDataSet)),

            

Reported by Pylint.

Missing class docstring
Error

Line: 34 Column: 1

              from wtscenario import filter_scenarios, make_scenarios

# Test cursor comparisons.
class test_cursor_comparison(wttest.WiredTigerTestCase):
    name = 'test_compare'

    types = [
        ('file', dict(type='file:', lsm=False, dataset=SimpleDataSet)),
        ('lsm', dict(type='table:', lsm=True, dataset=ComplexLSMDataSet)),

            

Reported by Pylint.

Missing function or method docstring
Error

Line: 51 Column: 5

                  scenarios = filter_scenarios(make_scenarios(types, keyfmt),
        lambda name, d: not (d['lsm'] and d['keyfmt'] == 'r'))

    def test_cursor_comparison(self):
        uri = self.type + 'compare'
        uriX = self.type + 'compareX'

        # Build the object.
        ds = self.dataset(self, uri, 100, key_format=self.keyfmt)

            

Reported by Pylint.

Too many statements (64/50)
Error

Line: 51 Column: 5

                  scenarios = filter_scenarios(make_scenarios(types, keyfmt),
        lambda name, d: not (d['lsm'] and d['keyfmt'] == 'r'))

    def test_cursor_comparison(self):
        uri = self.type + 'compare'
        uriX = self.type + 'compareX'

        # Build the object.
        ds = self.dataset(self, uri, 100, key_format=self.keyfmt)

            

Reported by Pylint.

Variable name "uriX" doesn't conform to snake_case naming style
Error

Line: 53 Column: 9

              
    def test_cursor_comparison(self):
        uri = self.type + 'compare'
        uriX = self.type + 'compareX'

        # Build the object.
        ds = self.dataset(self, uri, 100, key_format=self.keyfmt)
        dsX = self.dataset(self, uriX, 100, key_format=self.keyfmt)
        ds.populate()

            

Reported by Pylint.

Variable name "ds" doesn't conform to snake_case naming style
Error

Line: 56 Column: 9

                      uriX = self.type + 'compareX'

        # Build the object.
        ds = self.dataset(self, uri, 100, key_format=self.keyfmt)
        dsX = self.dataset(self, uriX, 100, key_format=self.keyfmt)
        ds.populate()
        dsX.populate()
        if self.type == 'file:':
            ix0_0 = None

            

Reported by Pylint.

Variable name "dsX" doesn't conform to snake_case naming style
Error

Line: 57 Column: 9

              
        # Build the object.
        ds = self.dataset(self, uri, 100, key_format=self.keyfmt)
        dsX = self.dataset(self, uriX, 100, key_format=self.keyfmt)
        ds.populate()
        dsX.populate()
        if self.type == 'file:':
            ix0_0 = None
            ix0_1 = None

            

Reported by Pylint.

src/third_party/scons-3.1.2/scons-local-3.1.2/SCons/Tool/applelink.py
28 issues
Attempted relative import beyond top-level package
Error

Line: 40 Column: 1

              
# Even though the Mac is based on the GNU toolchain, it doesn't understand
# the -rpath option, so we use the "link" tool instead of "gnulink".
from . import link


class AppleLinkInvalidCurrentVersionException(Exception):
    pass


            

Reported by Pylint.

Unused argument 'env'
Error

Line: 50 Column: 36

                  pass


def _applelib_versioned_lib_suffix(env, suffix, version):
    """For suffix='.dylib' and version='0.1.2' it returns '.0.1.2.dylib'"""
    Verbose = False
    if Verbose:
        print("_applelib_versioned_lib_suffix: suffix={!r}".format(suffix))
        print("_applelib_versioned_lib_suffix: version={!r}".format(version))

            

Reported by Pylint.

Access to a protected member _versioned_shlib_name of a client class
Error

Line: 79 Column: 82

                  return soname

def _applelib_versioned_shlib_soname(env, libnode, version, prefix, suffix):
    return _applelib_versioned_lib_soname(env, libnode, version, prefix, suffix, link._versioned_shlib_name)


# User programmatically describes how SHLIBVERSION maps to values for compat/current.
_applelib_max_version_values = (65535, 255, 255)
def _applelib_check_valid_version(version_string):

            

Reported by Pylint.

Unused argument 'for_signature'
Error

Line: 111 Column: 64

                  return True, ""


def _applelib_currentVersionFromSoVersion(source, target, env, for_signature):
    """
    A generator function to create the -Wl,-current_version flag if needed.
    If env['APPLELINK_NO_CURRENT_VERSION'] contains a true value no flag will be generated
    Otherwise if APPLELINK_CURRENT_VERSION is not specified, env['SHLIBVERSION']
    will be used.

            

Reported by Pylint.

Unused argument 'source'
Error

Line: 111 Column: 43

                  return True, ""


def _applelib_currentVersionFromSoVersion(source, target, env, for_signature):
    """
    A generator function to create the -Wl,-current_version flag if needed.
    If env['APPLELINK_NO_CURRENT_VERSION'] contains a true value no flag will be generated
    Otherwise if APPLELINK_CURRENT_VERSION is not specified, env['SHLIBVERSION']
    will be used.

            

Reported by Pylint.

Unused argument 'target'
Error

Line: 111 Column: 51

                  return True, ""


def _applelib_currentVersionFromSoVersion(source, target, env, for_signature):
    """
    A generator function to create the -Wl,-current_version flag if needed.
    If env['APPLELINK_NO_CURRENT_VERSION'] contains a true value no flag will be generated
    Otherwise if APPLELINK_CURRENT_VERSION is not specified, env['SHLIBVERSION']
    will be used.

            

Reported by Pylint.

Unused argument 'target'
Error

Line: 142 Column: 50

                  return "-Wl,-current_version,%s" % version_string


def _applelib_compatVersionFromSoVersion(source, target, env, for_signature):
    """
    A generator function to create the -Wl,-compatibility_version flag if needed.
    If env['APPLELINK_NO_COMPATIBILITY_VERSION'] contains a true value no flag will be generated
    Otherwise if APPLELINK_COMPATIBILITY_VERSION is not specified
    the first two parts of env['SHLIBVERSION'] will be used with a .0 appended.

            

Reported by Pylint.

Unused argument 'source'
Error

Line: 142 Column: 42

                  return "-Wl,-current_version,%s" % version_string


def _applelib_compatVersionFromSoVersion(source, target, env, for_signature):
    """
    A generator function to create the -Wl,-compatibility_version flag if needed.
    If env['APPLELINK_NO_COMPATIBILITY_VERSION'] contains a true value no flag will be generated
    Otherwise if APPLELINK_COMPATIBILITY_VERSION is not specified
    the first two parts of env['SHLIBVERSION'] will be used with a .0 appended.

            

Reported by Pylint.

Unused argument 'for_signature'
Error

Line: 142 Column: 63

                  return "-Wl,-current_version,%s" % version_string


def _applelib_compatVersionFromSoVersion(source, target, env, for_signature):
    """
    A generator function to create the -Wl,-compatibility_version flag if needed.
    If env['APPLELINK_NO_COMPATIBILITY_VERSION'] contains a true value no flag will be generated
    Otherwise if APPLELINK_COMPATIBILITY_VERSION is not specified
    the first two parts of env['SHLIBVERSION'] will be used with a .0 appended.

            

Reported by Pylint.

Access to a protected member _setup_versioned_lib_variables of a client class
Error

Line: 189 Column: 5

              

    # see: http://docstore.mik.ua/orelly/unix3/mac/ch05_04.htm  for proper naming
    link._setup_versioned_lib_variables(env, tool = 'applelink')#, use_soname = use_soname)
    env['LINKCALLBACKS'] = link._versioned_lib_callbacks()
    env['LINKCALLBACKS']['VersionedShLibSuffix'] = _applelib_versioned_lib_suffix
    env['LINKCALLBACKS']['VersionedShLibSoname'] = _applelib_versioned_shlib_soname

    env['_APPLELINK_CURRENT_VERSION'] = _applelib_currentVersionFromSoVersion

            

Reported by Pylint.

src/third_party/scons-3.1.2/scons-local-3.1.2/SCons/Tool/link.py
28 issues
Unused argument 'for_signature'
Error

Line: 54 Column: 37

              issued_mixed_link_warning = False


def smart_link(source, target, env, for_signature):
    has_cplusplus = iscplusplus(source)
    has_fortran = isfortran(env, source)
    has_d = isD(env, source)
    if has_cplusplus and has_fortran and not has_d:
        global issued_mixed_link_warning

            

Reported by Pylint.

Unused argument 'target'
Error

Line: 54 Column: 24

              issued_mixed_link_warning = False


def smart_link(source, target, env, for_signature):
    has_cplusplus = iscplusplus(source)
    has_fortran = isfortran(env, source)
    has_d = isD(env, source)
    if has_cplusplus and has_fortran and not has_d:
        global issued_mixed_link_warning

            

Reported by Pylint.

Using the global statement
Error

Line: 59 Column: 9

                  has_fortran = isfortran(env, source)
    has_d = isD(env, source)
    if has_cplusplus and has_fortran and not has_d:
        global issued_mixed_link_warning
        if not issued_mixed_link_warning:
            msg = "Using $CXX to link Fortran and C++ code together.\n\t" + \
                  "This may generate a buggy executable if the '%s'\n\t" + \
                  "compiler does not know how to deal with Fortran runtimes."
            SCons.Warnings.warn(SCons.Warnings.FortranCxxMixWarning,

            

Reported by Pylint.

Unused argument 'env'
Error

Line: 156 Column: 27

                  return _versioned_lib_name(env, libnode, version, prefix, suffix, prefix_generator, suffix_generator, **kw)


def _versioned_lib_suffix(env, suffix, version):
    """For suffix='.so' and version='0.1.2' it returns '.so.0.1.2'"""
    Verbose = False
    if Verbose:
        print("_versioned_lib_suffix: suffix={!r}".format(suffix))
        print("_versioned_lib_suffix: version={!r}".format(version))

            

Reported by Pylint.

Unused argument 'env'
Error

Line: 353 Column: 12

                  env['LDMODULENOVERSIONSYMLINKS'] = '$SHLIBNOVERSIONSYMLINKS'


def exists(env):
    # This module isn't really a Tool on its own, it's common logic for
    # other linkers.
    return None

# Local Variables:

            

Reported by Pylint.

Line too long (115/100)
Error

Line: 35 Column: 1

              #
from __future__ import print_function

__revision__ = "src/engine/SCons/Tool/link.py bee7caf9defd6e108fc2998a2520ddb36a967691 2019-12-17 02:07:09 bdeegan"

import sys
import re
import os


            

Reported by Pylint.

Constant name "issued_mixed_link_warning" doesn't conform to UPPER_CASE naming style
Error

Line: 51 Column: 1

              
from SCons.Tool.cxx import iscplusplus

issued_mixed_link_warning = False


def smart_link(source, target, env, for_signature):
    has_cplusplus = iscplusplus(source)
    has_fortran = isfortran(env, source)

            

Reported by Pylint.

Missing function or method docstring
Error

Line: 54 Column: 1

              issued_mixed_link_warning = False


def smart_link(source, target, env, for_signature):
    has_cplusplus = iscplusplus(source)
    has_fortran = isfortran(env, source)
    has_d = isD(env, source)
    if has_cplusplus and has_fortran and not has_d:
        global issued_mixed_link_warning

            

Reported by Pylint.

Unnecessary "elif" after "return"
Error

Line: 58 Column: 5

                  has_cplusplus = iscplusplus(source)
    has_fortran = isfortran(env, source)
    has_d = isD(env, source)
    if has_cplusplus and has_fortran and not has_d:
        global issued_mixed_link_warning
        if not issued_mixed_link_warning:
            msg = "Using $CXX to link Fortran and C++ code together.\n\t" + \
                  "This may generate a buggy executable if the '%s'\n\t" + \
                  "compiler does not know how to deal with Fortran runtimes."

            

Reported by Pylint.

Constant name "issued_mixed_link_warning" doesn't conform to UPPER_CASE naming style
Error

Line: 59 Column: 9

                  has_fortran = isfortran(env, source)
    has_d = isD(env, source)
    if has_cplusplus and has_fortran and not has_d:
        global issued_mixed_link_warning
        if not issued_mixed_link_warning:
            msg = "Using $CXX to link Fortran and C++ code together.\n\t" + \
                  "This may generate a buggy executable if the '%s'\n\t" + \
                  "compiler does not know how to deal with Fortran runtimes."
            SCons.Warnings.warn(SCons.Warnings.FortranCxxMixWarning,

            

Reported by Pylint.

src/third_party/wiredtiger/test/suite/test_config02.py
28 issues
Unable to import 'wiredtiger'
Error

Line: 35 Column: 1

              # [END_TAGS]

import os
import wiredtiger, wttest

# test_config02.py
#    The home directory for wiredtiger_open
class test_config02(wttest.WiredTigerTestCase):
    table_name1 = 'test_config02'

            

Reported by Pylint.

Redefining built-in 'dir'
Error

Line: 45 Column: 35

              
    # Each test needs to set up its connection in its own way,
    # so override these methods to do nothing
    def setUpConnectionOpen(self, dir):
        return None

    def setUpSessionOpen(self, conn):
        return None


            

Reported by Pylint.

Unused argument 'dir'
Error

Line: 45 Column: 35

              
    # Each test needs to set up its connection in its own way,
    # so override these methods to do nothing
    def setUpConnectionOpen(self, dir):
        return None

    def setUpSessionOpen(self, conn):
        return None


            

Reported by Pylint.

Parameters differ from overridden 'setUpConnectionOpen' method
Error

Line: 45 Column: 5

              
    # Each test needs to set up its connection in its own way,
    # so override these methods to do nothing
    def setUpConnectionOpen(self, dir):
        return None

    def setUpSessionOpen(self, conn):
        return None


            

Reported by Pylint.

No exception type(s) specified
Error

Line: 85 Column: 9

                      try:
            os.putenv('SOMEVAR', 'somevalue')
            os.unsetenv('SOMEVAR')
        except:
            self.skipTest('putenv and/or unsetenv not support on this OS')
            return
        configarg = 'create'
        if configextra != None:
            configarg += ',' + configextra

            

Reported by Pylint.

Redefining built-in 'dir'
Error

Line: 107 Column: 9

                      self.checkfiles(".")

    def test_home_rel(self):
        dir = 'subdir'
        os.mkdir(dir)
        self.common_test(dir, None, None)
        self.checkfiles(dir)

    def test_home_abs(self):

            

Reported by Pylint.

Redefining built-in 'dir'
Error

Line: 113 Column: 9

                      self.checkfiles(dir)

    def test_home_abs(self):
        dir = os.path.realpath('.') + os.sep + 'subdir'
        os.mkdir(dir)
        self.common_test(dir, None, None)
        self.checkfiles(dir)

    def test_home_and_env(self):

            

Reported by Pylint.

Redefining built-in 'dir'
Error

Line: 156 Column: 9

                      self.checkfiles(".")

    def test_home_does_not_exist(self):
        dir = 'nondir'
        self.assertRaisesWithMessage(wiredtiger.WiredTigerError,
            lambda: self.wiredtiger_open(dir, 'create'),
            '/(No such file or directory|The system cannot find the path specified)/')

    def test_home_not_writeable(self):

            

Reported by Pylint.

Redefining built-in 'dir'
Error

Line: 164 Column: 9

                  def test_home_not_writeable(self):
        if os.name == "nt":
            self.skipTest('Unix specific test skipped on Windows')
        dir = 'subdir'
        os.mkdir(dir)
        os.chmod(dir, 0o555)
        self.assertRaisesWithMessage(wiredtiger.WiredTigerError,
            lambda: self.wiredtiger_open(dir, 'create'),
            '/Permission denied/')

            

Reported by Pylint.

Chmod setting a permissive mask 0o555 on file (dir).
Security

Line: 166
Suggestion: https://bandit.readthedocs.io/en/latest/plugins/b103_set_bad_file_permissions.html

                          self.skipTest('Unix specific test skipped on Windows')
        dir = 'subdir'
        os.mkdir(dir)
        os.chmod(dir, 0o555)
        self.assertRaisesWithMessage(wiredtiger.WiredTigerError,
            lambda: self.wiredtiger_open(dir, 'create'),
            '/Permission denied/')

if __name__ == '__main__':

            

Reported by Bandit.

src/third_party/wiredtiger/test/suite/test_encrypt04.py
28 issues
Unable to import 'wiredtiger'
Error

Line: 34 Column: 1

              #

import os, run, random
import wiredtiger, wttest
from wtscenario import make_scenarios
from suite_subprocess import suite_subprocess

# Test basic encryption with mismatched configuration
class test_encrypt04(wttest.WiredTigerTestCase, suite_subprocess):

            

Reported by Pylint.

Unused import run
Error

Line: 33 Column: 1

              #   Test mismatches error conditions with encryption.
#

import os, run, random
import wiredtiger, wttest
from wtscenario import make_scenarios
from suite_subprocess import suite_subprocess

# Test basic encryption with mismatched configuration

            

Reported by Pylint.

Unused import os
Error

Line: 33 Column: 1

              #   Test mismatches error conditions with encryption.
#

import os, run, random
import wiredtiger, wttest
from wtscenario import make_scenarios
from suite_subprocess import suite_subprocess

# Test basic encryption with mismatched configuration

            

Reported by Pylint.

Unused import wiredtiger
Error

Line: 34 Column: 1

              #

import os, run, random
import wiredtiger, wttest
from wtscenario import make_scenarios
from suite_subprocess import suite_subprocess

# Test basic encryption with mismatched configuration
class test_encrypt04(wttest.WiredTigerTestCase, suite_subprocess):

            

Reported by Pylint.

Redefining built-in 'dir'
Error

Line: 88 Column: 35

                      extlist.extension('encryptors', self.name, extarg)

    # Override WiredTigerTestCase, we have extensions.
    def setUpConnectionOpen(self, dir):
        self.expect_forceerror = False
        if self.part == 1:
            self.name = self.name1
            self.keyid = self.keyid1
            self.secretkey = self.secretkey1

            

Reported by Pylint.

Parameters differ from overridden 'setUpConnectionOpen' method
Error

Line: 88 Column: 5

                      extlist.extension('encryptors', self.name, extarg)

    # Override WiredTigerTestCase, we have extensions.
    def setUpConnectionOpen(self, dir):
        self.expect_forceerror = False
        if self.part == 1:
            self.name = self.name1
            self.keyid = self.keyid1
            self.secretkey = self.secretkey1

            

Reported by Pylint.

Unused variable 'completed'
Error

Line: 113 Column: 9

                      # return a (-1000) error code, which we'll detect here.
        extarg = self.extensionsConfig()
        self.pr('encarg = ' + encarg + ' extarg = ' + extarg)
        completed = False
        try:
            conn = self.wiredtiger_open(dir,
                'create,error_prefix="{0}",{1}{2}'.format(
                 self.shortid(), encarg, extarg))
        except (BaseException) as err:

            

Reported by Pylint.

No exception type(s) specified
Error

Line: 157 Column: 17

                              try:
                    expr()
                    completed = True
                except:
                    pass
                self.assertEqual(False, completed)
        return expect_okay

    # Create a table with encryption values that are in error.

            

Reported by Pylint.

Attribute 'name' defined outside __init__
Error

Line: 180 Column: 9

              
        # Now intentionally expose the test to mismatched configuration
        self.part = 2
        self.name = self.name2
        self.keyid = self.keyid2
        self.secretkey = self.secretkey2

        is_same = (self.name1 == self.name2 and
                   self.keyid1 == self.keyid2 and

            

Reported by Pylint.

Attribute 'keyid' defined outside __init__
Error

Line: 181 Column: 9

                      # Now intentionally expose the test to mismatched configuration
        self.part = 2
        self.name = self.name2
        self.keyid = self.keyid2
        self.secretkey = self.secretkey2

        is_same = (self.name1 == self.name2 and
                   self.keyid1 == self.keyid2 and
                   self.secretkey1 == self.secretkey2)

            

Reported by Pylint.

src/third_party/scons-3.1.2/scons-local-3.1.2/SCons/Tool/packaging/ipk.py
28 issues
Unused argument 'DESCRIPTION'
Error

Line: 37 Column: 62

              
from SCons.Tool.packaging import stripinstallbuilder, putintopackageroot

def package(env, target, source, PACKAGEROOT, NAME, VERSION, DESCRIPTION,
            SUMMARY, X_IPK_PRIORITY, X_IPK_SECTION, SOURCE_URL,
            X_IPK_MAINTAINER, X_IPK_DEPENDS, **kw):
    """ This function prepares the packageroot directory for packaging with the
    ipkg builder.
    """

            

Reported by Pylint.

Unused argument 'X_IPK_PRIORITY'
Error

Line: 38 Column: 22

              from SCons.Tool.packaging import stripinstallbuilder, putintopackageroot

def package(env, target, source, PACKAGEROOT, NAME, VERSION, DESCRIPTION,
            SUMMARY, X_IPK_PRIORITY, X_IPK_SECTION, SOURCE_URL,
            X_IPK_MAINTAINER, X_IPK_DEPENDS, **kw):
    """ This function prepares the packageroot directory for packaging with the
    ipkg builder.
    """
    SCons.Tool.Tool('ipkg').generate(env)

            

Reported by Pylint.

Unused argument 'X_IPK_SECTION'
Error

Line: 38 Column: 38

              from SCons.Tool.packaging import stripinstallbuilder, putintopackageroot

def package(env, target, source, PACKAGEROOT, NAME, VERSION, DESCRIPTION,
            SUMMARY, X_IPK_PRIORITY, X_IPK_SECTION, SOURCE_URL,
            X_IPK_MAINTAINER, X_IPK_DEPENDS, **kw):
    """ This function prepares the packageroot directory for packaging with the
    ipkg builder.
    """
    SCons.Tool.Tool('ipkg').generate(env)

            

Reported by Pylint.

Unused argument 'SOURCE_URL'
Error

Line: 38 Column: 53

              from SCons.Tool.packaging import stripinstallbuilder, putintopackageroot

def package(env, target, source, PACKAGEROOT, NAME, VERSION, DESCRIPTION,
            SUMMARY, X_IPK_PRIORITY, X_IPK_SECTION, SOURCE_URL,
            X_IPK_MAINTAINER, X_IPK_DEPENDS, **kw):
    """ This function prepares the packageroot directory for packaging with the
    ipkg builder.
    """
    SCons.Tool.Tool('ipkg').generate(env)

            

Reported by Pylint.

Unused argument 'SUMMARY'
Error

Line: 38 Column: 13

              from SCons.Tool.packaging import stripinstallbuilder, putintopackageroot

def package(env, target, source, PACKAGEROOT, NAME, VERSION, DESCRIPTION,
            SUMMARY, X_IPK_PRIORITY, X_IPK_SECTION, SOURCE_URL,
            X_IPK_MAINTAINER, X_IPK_DEPENDS, **kw):
    """ This function prepares the packageroot directory for packaging with the
    ipkg builder.
    """
    SCons.Tool.Tool('ipkg').generate(env)

            

Reported by Pylint.

Unused argument 'X_IPK_DEPENDS'
Error

Line: 39 Column: 31

              
def package(env, target, source, PACKAGEROOT, NAME, VERSION, DESCRIPTION,
            SUMMARY, X_IPK_PRIORITY, X_IPK_SECTION, SOURCE_URL,
            X_IPK_MAINTAINER, X_IPK_DEPENDS, **kw):
    """ This function prepares the packageroot directory for packaging with the
    ipkg builder.
    """
    SCons.Tool.Tool('ipkg').generate(env)


            

Reported by Pylint.

Unused argument 'X_IPK_MAINTAINER'
Error

Line: 39 Column: 13

              
def package(env, target, source, PACKAGEROOT, NAME, VERSION, DESCRIPTION,
            SUMMARY, X_IPK_PRIORITY, X_IPK_SECTION, SOURCE_URL,
            X_IPK_MAINTAINER, X_IPK_DEPENDS, **kw):
    """ This function prepares the packageroot directory for packaging with the
    ipkg builder.
    """
    SCons.Tool.Tool('ipkg').generate(env)


            

Reported by Pylint.

Redefining built-in 'str'
Error

Line: 168 Column: 9

                      config.write(f.PACKAGING_INSTALL_LOCATION)
        config.write('\n')

    for str in 'POSTRM PRERM POSTINST PREINST'.split():
        name="PACKAGING_X_IPK_%s"%str
        for f in [x for x in source if name in dir(x)]:
            file = open_file(name)
            file.write(env[str])


            

Reported by Pylint.

Line too long (124/100)
Error

Line: 27 Column: 1

              # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#

__revision__ = "src/engine/SCons/Tool/packaging/ipk.py bee7caf9defd6e108fc2998a2520ddb36a967691 2019-12-17 02:07:09 bdeegan"

import os

import SCons.Builder
import SCons.Node.FS

            

Reported by Pylint.

Too many local variables (19/15)
Error

Line: 37 Column: 1

              
from SCons.Tool.packaging import stripinstallbuilder, putintopackageroot

def package(env, target, source, PACKAGEROOT, NAME, VERSION, DESCRIPTION,
            SUMMARY, X_IPK_PRIORITY, X_IPK_SECTION, SOURCE_URL,
            X_IPK_MAINTAINER, X_IPK_DEPENDS, **kw):
    """ This function prepares the packageroot directory for packaging with the
    ipkg builder.
    """

            

Reported by Pylint.

src/mongo/db/exec/sbe/values/slot.cpp
28 issues
memcpy - Does not check for buffer overflows when copying to destination
Security

Line: 154 Column: 13 CWE codes: 120
Suggestion: Make sure destination can always hold the source data

                      case TypeTags::bsonArray: {
            auto size = buf.peek<LittleEndian<uint32_t>>();
            auto buffer = UniqueBuffer::allocate(size);
            memcpy(buffer.get(), buf.skip(size), size);
            return {tag, bitcastFrom<char*>(buffer.release())};
        }
        case TypeTags::bsonBinData: {
            auto binDataSize = buf.peek<LittleEndian<uint32_t>>();
            auto size = binDataSize + sizeof(uint32_t) + 1;

            

Reported by FlawFinder.

memcpy - Does not check for buffer overflows when copying to destination
Security

Line: 161 Column: 13 CWE codes: 120
Suggestion: Make sure destination can always hold the source data

                          auto binDataSize = buf.peek<LittleEndian<uint32_t>>();
            auto size = binDataSize + sizeof(uint32_t) + 1;
            auto binData = new uint8_t[size];
            memcpy(binData, buf.skip(size), size);
            val = bitcastFrom<uint8_t*>(binData);
            break;
        }
        case TypeTags::ksValue: {
            auto version = static_cast<KeyString::Version>(buf.read<uint8_t>());

            

Reported by FlawFinder.

read - Check buffer boundaries if used in a loop including recursive loops
Security

Line: 40 Column: 42 CWE codes: 120 20

              
namespace mongo::sbe::value {
static std::pair<TypeTags, Value> deserializeValue(BufReader& buf) {
    auto tag = static_cast<TypeTags>(buf.read<uint8_t>());
    Value val;

    switch (tag) {
        case TypeTags::Nothing:
            break;

            

Reported by FlawFinder.

read - Check buffer boundaries if used in a loop including recursive loops
Security

Line: 47 Column: 44 CWE codes: 120 20

                      case TypeTags::Nothing:
            break;
        case TypeTags::NumberInt32:
            val = bitcastFrom<int32_t>(buf.read<LittleEndian<int32_t>>());
            break;
        case TypeTags::RecordId:
        case TypeTags::NumberInt64:
            val = bitcastFrom<int64_t>(buf.read<LittleEndian<int64_t>>());
            break;

            

Reported by FlawFinder.

read - Check buffer boundaries if used in a loop including recursive loops
Security

Line: 51 Column: 44 CWE codes: 120 20

                          break;
        case TypeTags::RecordId:
        case TypeTags::NumberInt64:
            val = bitcastFrom<int64_t>(buf.read<LittleEndian<int64_t>>());
            break;
        case TypeTags::NumberDouble:
            val = bitcastFrom<double>(buf.read<LittleEndian<double>>());
            break;
        case TypeTags::NumberDecimal: {

            

Reported by FlawFinder.

read - Check buffer boundaries if used in a loop including recursive loops
Security

Line: 54 Column: 43 CWE codes: 120 20

                          val = bitcastFrom<int64_t>(buf.read<LittleEndian<int64_t>>());
            break;
        case TypeTags::NumberDouble:
            val = bitcastFrom<double>(buf.read<LittleEndian<double>>());
            break;
        case TypeTags::NumberDecimal: {
            uint64_t low = buf.read<LittleEndian<uint64_t>>();
            uint64_t high = buf.read<LittleEndian<uint64_t>>();
            auto [decTag, decVal] = makeCopyDecimal(Decimal128{Decimal128::Value{low, high}});

            

Reported by FlawFinder.

read - Check buffer boundaries if used in a loop including recursive loops
Security

Line: 57 Column: 32 CWE codes: 120 20

                          val = bitcastFrom<double>(buf.read<LittleEndian<double>>());
            break;
        case TypeTags::NumberDecimal: {
            uint64_t low = buf.read<LittleEndian<uint64_t>>();
            uint64_t high = buf.read<LittleEndian<uint64_t>>();
            auto [decTag, decVal] = makeCopyDecimal(Decimal128{Decimal128::Value{low, high}});
            val = decVal;
            break;
        }

            

Reported by FlawFinder.

read - Check buffer boundaries if used in a loop including recursive loops
Security

Line: 58 Column: 33 CWE codes: 120 20

                          break;
        case TypeTags::NumberDecimal: {
            uint64_t low = buf.read<LittleEndian<uint64_t>>();
            uint64_t high = buf.read<LittleEndian<uint64_t>>();
            auto [decTag, decVal] = makeCopyDecimal(Decimal128{Decimal128::Value{low, high}});
            val = decVal;
            break;
        }
        case TypeTags::Date:

            

Reported by FlawFinder.

read - Check buffer boundaries if used in a loop including recursive loops
Security

Line: 64 Column: 44 CWE codes: 120 20

                          break;
        }
        case TypeTags::Date:
            val = bitcastFrom<int64_t>(buf.read<LittleEndian<int64_t>>());
            break;
        case TypeTags::Timestamp:
            val = bitcastFrom<uint64_t>(buf.read<LittleEndian<uint64_t>>());
            break;
        case TypeTags::Boolean:

            

Reported by FlawFinder.

read - Check buffer boundaries if used in a loop including recursive loops
Security

Line: 67 Column: 45 CWE codes: 120 20

                          val = bitcastFrom<int64_t>(buf.read<LittleEndian<int64_t>>());
            break;
        case TypeTags::Timestamp:
            val = bitcastFrom<uint64_t>(buf.read<LittleEndian<uint64_t>>());
            break;
        case TypeTags::Boolean:
            val = bitcastFrom<bool>(buf.read<char>());
            break;
        case TypeTags::Null:

            

Reported by FlawFinder.