The following issues were found

src/third_party/scons-3.1.2/scons-local-3.1.2/SCons/Tool/JavaCommon.py
120 issues
Attribute 'classState' defined outside __init__
Error

Line: 125 Column: 17

                              return self.classState
            except AttributeError:
                ret = ClassState(self)
                self.classState = ret
                return ret

        def __getPackageState(self):
            try:
                return self.packageState

            

Reported by Pylint.

Attribute 'packageState' defined outside __init__
Error

Line: 133 Column: 17

                              return self.packageState
            except AttributeError:
                ret = PackageState(self)
                self.packageState = ret
                return ret

        def __getAnonClassState(self):
            try:
                return self.anonState

            

Reported by Pylint.

Attribute 'outer_state' defined outside __init__
Error

Line: 140 Column: 17

                          try:
                return self.anonState
            except AttributeError:
                self.outer_state = self
                ret = SkipState(1, AnonClassState(self))
                self.anonState = ret
                return ret

        def __getSkipState(self):

            

Reported by Pylint.

Attribute 'anonState' defined outside __init__
Error

Line: 142 Column: 17

                          except AttributeError:
                self.outer_state = self
                ret = SkipState(1, AnonClassState(self))
                self.anonState = ret
                return ret

        def __getSkipState(self):
            try:
                return self.skipState

            

Reported by Pylint.

Attribute 'skipState' defined outside __init__
Error

Line: 150 Column: 17

                              return self.skipState
            except AttributeError:
                ret = SkipState(1, self)
                self.skipState = ret
                return ret

        def _getAnonStack(self):
            return self.anonStacksStack[-1]


            

Reported by Pylint.

Attribute 'classState' defined outside __init__
Error

Line: 241 Column: 17

                              return self.classState
            except AttributeError:
                ret = ClassState(self)
                self.classState = ret
                return ret

        def __getAnonClassState(self):
            try:
                return self.anonState

            

Reported by Pylint.

Attribute 'anonState' defined outside __init__
Error

Line: 249 Column: 17

                              return self.anonState
            except AttributeError:
                ret = SkipState(1, AnonClassState(self))
                self.anonState = ret
                return ret

        def __getSkipState(self):
            try:
                return self.skipState

            

Reported by Pylint.

Attribute 'skipState' defined outside __init__
Error

Line: 257 Column: 17

                              return self.skipState
            except AttributeError:
                ret = SkipState(1, self)
                self.skipState = ret
                return ret

        def openBracket(self):
            self.brackets = self.brackets + 1


            

Reported by Pylint.

Access to a protected member _getAnonStack of a client class
Error

Line: 278 Column: 21

                          elif token == '}':
                self.closeBracket()
                if self.brackets == 0:
                    self.outer_state._getAnonStack().pop()
                    return self.old_state
            elif token in ['"', "'"]:
                return IgnoreState(token, self)
            elif token == "new":
                # anonymous inner class

            

Reported by Pylint.

Unused argument 'token'
Error

Line: 341 Column: 30

                          self.tokens_to_skip = tokens_to_skip
            self.old_state = old_state

        def parseToken(self, token):
            self.tokens_to_skip = self.tokens_to_skip - 1
            if self.tokens_to_skip < 1:
                return self.old_state
            return self


            

Reported by Pylint.

src/third_party/wiredtiger/test/3rdparty/python-subunit-0.0.16/python/subunit/v2.py
116 issues
Unable to import 'extras'
Error

Line: 26 Column: 1

              import struct
import zlib

from extras import safe_hasattr, try_imports
builtins = try_imports(['__builtin__', 'builtins'])

import subunit
import subunit.iso8601 as iso8601


            

Reported by Pylint.

Unused UnsupportedOperation imported from io
Error

Line: 20 Column: 1

              import codecs
utf_8_decode = codecs.utf_8_decode
import datetime
from io import UnsupportedOperation
import os
import select
import struct
import zlib


            

Reported by Pylint.

Unused import os
Error

Line: 21 Column: 1

              utf_8_decode = codecs.utf_8_decode
import datetime
from io import UnsupportedOperation
import os
import select
import struct
import zlib

from extras import safe_hasattr, try_imports

            

Reported by Pylint.

TODO: chunk the packet automatically?
Error

Line: 202 Column: 3

                          length_length = 3
        else:
            # Longer than policy:
            # TODO: chunk the packet automatically?
            # - strip all but file data
            # - do 4M chunks of that till done
            # - include original data in final chunk.
            raise ValueError("Length too long: %r" % base_length)
        packet[2:3] = self._encode_number(base_length + length_length)

            

Reported by Pylint.

No exception type(s) specified
Error

Line: 300 Column: 17

                          while len(buffered[-1]):
                try:
                    self.source.fileno()
                except:
                    # Won't be able to select, fallback to
                    # one-byte-at-a-time.
                    break
                # Note: this has a very low timeout because with stdin, the
                # BufferedIO layer typically has all the content available

            

Reported by Pylint.

Consider explicitly re-raising using the 'from' keyword
Error

Line: 494 Column: 13

                                  pos-2, length - decoded_bytes))
            return utf8, length+pos
        except UnicodeDecodeError:
            raise ParseError('UTF8 string at offset %d is not UTF8' % (pos-2,))


            

Reported by Pylint.

Missing module docstring
Error

Line: 1 Column: 1

              #
#  subunit: extensions to Python unittest to get test results from subprocesses.
#  Copyright (C) 2013  Robert Collins <robertc@robertcollins.net>
#
#  Licensed under either the Apache License, Version 2.0 or the BSD 3-clause
#  license at the users choice. A copy of both licenses are available in the
#  project source as Apache-2.0 and BSD. You may not use this file except in
#  compliance with one of these two licences.
#

            

Reported by Pylint.

Import "import datetime" should be placed at the top of the module
Error

Line: 19 Column: 1

              
import codecs
utf_8_decode = codecs.utf_8_decode
import datetime
from io import UnsupportedOperation
import os
import select
import struct
import zlib

            

Reported by Pylint.

Import "from io import UnsupportedOperation" should be placed at the top of the module
Error

Line: 20 Column: 1

              import codecs
utf_8_decode = codecs.utf_8_decode
import datetime
from io import UnsupportedOperation
import os
import select
import struct
import zlib


            

Reported by Pylint.

Import "import os" should be placed at the top of the module
Error

Line: 21 Column: 1

              utf_8_decode = codecs.utf_8_decode
import datetime
from io import UnsupportedOperation
import os
import select
import struct
import zlib

from extras import safe_hasattr, try_imports

            

Reported by Pylint.

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

Line: 51 Column: 1

              import SCons.Warnings
from SCons.Tool import find_program_path

from . import common

debug = common.debug

from . import sdk


            

Reported by Pylint.

Attempted relative import beyond top-level package
Error

Line: 55 Column: 1

              
debug = common.debug

from . import sdk

get_installed_sdks = sdk.get_installed_sdks


class VisualCException(Exception):

            

Reported by Pylint.

Undefined variable 'basestring'
Error

Line: 639 Column: 37

                      # keys & values will be unicode. don't detect, just convert.
        if sys.version_info[0] == 2:
            def convert(data):
                if isinstance(data, basestring):
                    return str(data)
                elif isinstance(data, collections.Mapping):
                    return dict(map(convert, data.iteritems()))
                elif isinstance(data, collections.Iterable):
                    return type(data)(map(convert, data))

            

Reported by Pylint.

TODO:
Error

Line: 24 Column: 3

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

# TODO:
#   * supported arch for versions: for old versions of batch file without
#     argument, giving bogus argument cannot be detected, so we have to hardcode
#     this here
#   * print warning when msvc version specified but not found
#   * find out why warning do not print

            

Reported by Pylint.

Consider explicitly re-raising using the 'from' keyword
Error

Line: 185 Column: 9

                      host = _ARCH_TO_CANONICAL[host_platform.lower()]
    except KeyError:
        msg = "Unrecognized host architecture %s"
        raise MSVCUnsupportedHostArch(msg % repr(host_platform))

    try:
        target = _ARCH_TO_CANONICAL[target_platform.lower()]
    except KeyError:
        all_archs = str(list(_ARCH_TO_CANONICAL.keys()))

            

Reported by Pylint.

Consider explicitly re-raising using the 'from' keyword
Error

Line: 191 Column: 9

                      target = _ARCH_TO_CANONICAL[target_platform.lower()]
    except KeyError:
        all_archs = str(list(_ARCH_TO_CANONICAL.keys()))
        raise MSVCUnsupportedTargetArch("Unrecognized target architecture %s\n\tValid architectures: %s" % (target_platform, all_archs))

    return (host, target,req_target_platform)

# If you update this, update SupportedVSList in Tool/MSCommon/vs.py, and the
# MSVC_VERSION documentation in Tool/msvc.xml.

            

Reported by Pylint.

Redefining built-in 'min'
Error

Line: 264 Column: 9

                      raise ValueError("Unrecognized version %s (%s)" % (msvc_version,msvc_version_numeric))
    try:
        maj = int(t[0])
        min = int(t[1])
        return maj, min
    except ValueError as e:
        raise ValueError("Unrecognized version %s (%s)" % (msvc_version,msvc_version_numeric))

def is_host_target_supported(host_target, msvc_version):

            

Reported by Pylint.

Unused variable 'e'
Error

Line: 266 Column: 5

                      maj = int(t[0])
        min = int(t[1])
        return maj, min
    except ValueError as e:
        raise ValueError("Unrecognized version %s (%s)" % (msvc_version,msvc_version_numeric))

def is_host_target_supported(host_target, msvc_version):
    """Check if (host, target) pair is supported for a VC version.


            

Reported by Pylint.

Consider explicitly re-raising using the 'from' keyword
Error

Line: 267 Column: 9

                      min = int(t[1])
        return maj, min
    except ValueError as e:
        raise ValueError("Unrecognized version %s (%s)" % (msvc_version,msvc_version_numeric))

def is_host_target_supported(host_target, msvc_version):
    """Check if (host, target) pair is supported for a VC version.

    :note: only checks whether a given version *may* support the given (host,

            

Reported by Pylint.

Unused variable 'min'
Error

Line: 281 Column: 14

                  """
    # We assume that any Visual Studio version supports x86 as a target
    if host_target[1] != "x86":
        maj, min = msvc_version_to_maj_min(msvc_version)
        if maj < 8:
            return False
    return True



            

Reported by Pylint.

src/third_party/icu4c-57.1/source/common/unicode/localpointer.h
108 issues
There is an unknown macro here somewhere. Configuration is required. If U_NAMESPACE_BEGIN is a macro then please configure it.
Error

Line: 43

              
#if U_SHOW_CPLUSPLUS_API

U_NAMESPACE_BEGIN

/**
 * "Smart pointer" base class; do not use directly: use LocalPointer etc.
 *
 * Base class for smart pointer classes that do not throw exceptions.

            

Reported by Cppcheck.

There is an unknown macro here somewhere. Configuration is required. If U_NAMESPACE_BEGIN is a macro then please configure it.
Error

Line: 43

              
#if U_SHOW_CPLUSPLUS_API

U_NAMESPACE_BEGIN

/**
 * "Smart pointer" base class; do not use directly: use LocalPointer etc.
 *
 * Base class for smart pointer classes that do not throw exceptions.

            

Reported by Cppcheck.

There is an unknown macro here somewhere. Configuration is required. If U_NAMESPACE_BEGIN is a macro then please configure it.
Error

Line: 43

              
#if U_SHOW_CPLUSPLUS_API

U_NAMESPACE_BEGIN

/**
 * "Smart pointer" base class; do not use directly: use LocalPointer etc.
 *
 * Base class for smart pointer classes that do not throw exceptions.

            

Reported by Cppcheck.

There is an unknown macro here somewhere. Configuration is required. If U_NAMESPACE_BEGIN is a macro then please configure it.
Error

Line: 43

              
#if U_SHOW_CPLUSPLUS_API

U_NAMESPACE_BEGIN

/**
 * "Smart pointer" base class; do not use directly: use LocalPointer etc.
 *
 * Base class for smart pointer classes that do not throw exceptions.

            

Reported by Cppcheck.

There is an unknown macro here somewhere. Configuration is required. If U_NAMESPACE_BEGIN is a macro then please configure it.
Error

Line: 43

              
#if U_SHOW_CPLUSPLUS_API

U_NAMESPACE_BEGIN

/**
 * "Smart pointer" base class; do not use directly: use LocalPointer etc.
 *
 * Base class for smart pointer classes that do not throw exceptions.

            

Reported by Cppcheck.

There is an unknown macro here somewhere. Configuration is required. If U_NAMESPACE_BEGIN is a macro then please configure it.
Error

Line: 43

              
#if U_SHOW_CPLUSPLUS_API

U_NAMESPACE_BEGIN

/**
 * "Smart pointer" base class; do not use directly: use LocalPointer etc.
 *
 * Base class for smart pointer classes that do not throw exceptions.

            

Reported by Cppcheck.

There is an unknown macro here somewhere. Configuration is required. If U_NAMESPACE_BEGIN is a macro then please configure it.
Error

Line: 43

              
#if U_SHOW_CPLUSPLUS_API

U_NAMESPACE_BEGIN

/**
 * "Smart pointer" base class; do not use directly: use LocalPointer etc.
 *
 * Base class for smart pointer classes that do not throw exceptions.

            

Reported by Cppcheck.

There is an unknown macro here somewhere. Configuration is required. If U_NAMESPACE_BEGIN is a macro then please configure it.
Error

Line: 43

              
#if U_SHOW_CPLUSPLUS_API

U_NAMESPACE_BEGIN

/**
 * "Smart pointer" base class; do not use directly: use LocalPointer etc.
 *
 * Base class for smart pointer classes that do not throw exceptions.

            

Reported by Cppcheck.

There is an unknown macro here somewhere. Configuration is required. If U_NAMESPACE_BEGIN is a macro then please configure it.
Error

Line: 43

              
#if U_SHOW_CPLUSPLUS_API

U_NAMESPACE_BEGIN

/**
 * "Smart pointer" base class; do not use directly: use LocalPointer etc.
 *
 * Base class for smart pointer classes that do not throw exceptions.

            

Reported by Cppcheck.

There is an unknown macro here somewhere. Configuration is required. If U_NAMESPACE_BEGIN is a macro then please configure it.
Error

Line: 43

              
#if U_SHOW_CPLUSPLUS_API

U_NAMESPACE_BEGIN

/**
 * "Smart pointer" base class; do not use directly: use LocalPointer etc.
 *
 * Base class for smart pointer classes that do not throw exceptions.

            

Reported by Cppcheck.

site_scons/libdeps.py
108 issues
Unable to import 'SCons.Errors'
Error

Line: 73 Column: 1

              except ImportError:
    pass

import SCons.Errors
import SCons.Scanner
import SCons.Util
import SCons
from SCons.Script import COMMAND_LINE_TARGETS


            

Reported by Pylint.

Unable to import 'SCons.Scanner'
Error

Line: 74 Column: 1

                  pass

import SCons.Errors
import SCons.Scanner
import SCons.Util
import SCons
from SCons.Script import COMMAND_LINE_TARGETS



            

Reported by Pylint.

Unable to import 'SCons.Util'
Error

Line: 75 Column: 1

              
import SCons.Errors
import SCons.Scanner
import SCons.Util
import SCons
from SCons.Script import COMMAND_LINE_TARGETS




            

Reported by Pylint.

Unable to import 'SCons'
Error

Line: 76 Column: 1

              import SCons.Errors
import SCons.Scanner
import SCons.Util
import SCons
from SCons.Script import COMMAND_LINE_TARGETS



class Constants:

            

Reported by Pylint.

Unable to import 'SCons.Script'
Error

Line: 77 Column: 1

              import SCons.Scanner
import SCons.Util
import SCons
from SCons.Script import COMMAND_LINE_TARGETS



class Constants:
    Libdeps = "LIBDEPS"

            

Reported by Pylint.

Value 'self.value' is unsubscriptable
Error

Line: 106 Column: 20

              
    def __lt__(self, other):
        if self.__class__ is other.__class__:
            return self.value[0] < other.value[0]
        return NotImplemented

    def __str__(self):
        return self.value[1]


            

Reported by Pylint.

Value 'self.value' is unsubscriptable
Error

Line: 110 Column: 16

                      return NotImplemented

    def __str__(self):
        return self.value[1]

    def __int__(self):
        return self.value[0]



            

Reported by Pylint.

Value 'self.value' is unsubscriptable
Error

Line: 113 Column: 16

                      return self.value[1]

    def __int__(self):
        return self.value[0]


class dependency:
    def __init__(self, value, deptype, listed_name):
        self.target_node = value

            

Reported by Pylint.

Reimport 'json' (imported line 58)
Error

Line: 64 Column: 1

              import glob
import textwrap
import hashlib
import json
import fileinput

try:
    import networkx
    from buildscripts.libdeps.libdeps.graph import EdgeProps, NodeProps, LibdepsGraph

            

Reported by Pylint.

Redefining name 'deptype' from outer scope (line 98)
Error

Line: 117 Column: 31

              

class dependency:
    def __init__(self, value, deptype, listed_name):
        self.target_node = value
        self.dependency_type = deptype
        self.listed_name = listed_name

    def __str__(self):

            

Reported by Pylint.

src/third_party/mozjs-60/extract/js/src/wasm/WasmBaselineCompile.cpp
105 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: 3930 Column: 42 CWE codes: 362/367!
Suggestion: Set up the correct permissions (e.g., using setuid()) and try to open the file directly

                  //
    // Heap access.

    void bceCheckLocal(MemoryAccessDesc* access, AccessCheck* check, uint32_t local) {
        if (local >= sizeof(BCESet)*8)
            return;

        if ((bceSafe_ & (BCESet(1) << local)) && access->offset() < wasm::OffsetGuardLimit)
            check->omitBoundsCheck = true;

            

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: 3948 Column: 48 CWE codes: 362/367!
Suggestion: Set up the correct permissions (e.g., using setuid()) and try to open the file directly

                      bceSafe_ &= ~(BCESet(1) << local);
    }

    void prepareMemoryAccess(MemoryAccessDesc* access, AccessCheck* check, RegI32 tls, RegI32 ptr) {

        // Fold offset if necessary for further computations.

        if (access->offset() >= OffsetGuardLimit ||
            (access->isAtomic() && !check->omitAlignmentCheck && !check->onlyPointerAlignment))

            

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: 3995 Column: 59 CWE codes: 362/367!
Suggestion: Set up the correct permissions (e.g., using setuid()) and try to open the file directly

              
#if defined(JS_CODEGEN_X64) || defined(JS_CODEGEN_ARM) || \
    defined(JS_CODEGEN_MIPS32) || defined(JS_CODEGEN_MIPS64)
    BaseIndex prepareAtomicMemoryAccess(MemoryAccessDesc* access, AccessCheck* check, RegI32 tls,
                                        RegI32 ptr)
    {
        MOZ_ASSERT(needTlsForAccess(*check) == tls.isValid());
        prepareMemoryAccess(access, check, tls, ptr);
        return BaseIndex(HeapReg, ptr, TimesOne, access->offset());

            

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: 3999 Column: 29 CWE codes: 362/367!
Suggestion: Set up the correct permissions (e.g., using setuid()) and try to open the file directly

                                                      RegI32 ptr)
    {
        MOZ_ASSERT(needTlsForAccess(*check) == tls.isValid());
        prepareMemoryAccess(access, check, tls, ptr);
        return BaseIndex(HeapReg, ptr, TimesOne, access->offset());
    }
#elif defined(JS_CODEGEN_X86)
    // Some consumers depend on the address not retaining tls, as tls may be the
    // scratch register.

            

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: 4006 Column: 57 CWE codes: 362/367!
Suggestion: Set up the correct permissions (e.g., using setuid()) and try to open the file directly

                  // Some consumers depend on the address not retaining tls, as tls may be the
    // scratch register.

    Address prepareAtomicMemoryAccess(MemoryAccessDesc* access, AccessCheck* check, RegI32 tls,
                                      RegI32 ptr)
    {
        MOZ_ASSERT(needTlsForAccess(*check) == tls.isValid());
        prepareMemoryAccess(access, check, tls, ptr);
        masm.addPtr(Address(tls, offsetof(TlsData, memoryBase)), 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: 4010 Column: 29 CWE codes: 362/367!
Suggestion: Set up the correct permissions (e.g., using setuid()) and try to open the file directly

                                                    RegI32 ptr)
    {
        MOZ_ASSERT(needTlsForAccess(*check) == tls.isValid());
        prepareMemoryAccess(access, check, tls, ptr);
        masm.addPtr(Address(tls, offsetof(TlsData, memoryBase)), ptr);
        return Address(ptr, access->offset());
    }
#else
    Address prepareAtomicMemoryAccess(MemoryAccessDesc* access, AccessCheck* check, RegI32 tls,

            

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: 4015 Column: 57 CWE codes: 362/367!
Suggestion: Set up the correct permissions (e.g., using setuid()) and try to open the file directly

                      return Address(ptr, access->offset());
    }
#else
    Address prepareAtomicMemoryAccess(MemoryAccessDesc* access, AccessCheck* check, RegI32 tls,
                                      RegI32 ptr)
    {
        MOZ_CRASH("BaseCompiler platform hook: prepareAtomicMemoryAccess");
    }
#endif

            

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: 4022 Column: 48 CWE codes: 362/367!
Suggestion: Set up the correct permissions (e.g., using setuid()) and try to open the file directly

                  }
#endif

    void needLoadTemps(const MemoryAccessDesc& access, RegI32* temp1, RegI32* temp2,
                       RegI32* temp3)
    {
#if defined(JS_CODEGEN_ARM)
        if (IsUnaligned(access)) {
            switch (access.type()) {

            

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: 4026 Column: 25 CWE codes: 362/367!
Suggestion: Set up the correct permissions (e.g., using setuid()) and try to open the file directly

                                     RegI32* temp3)
    {
#if defined(JS_CODEGEN_ARM)
        if (IsUnaligned(access)) {
            switch (access.type()) {
              case Scalar::Float64:
                *temp3 = needI32();
                MOZ_FALLTHROUGH;
              case Scalar::Float32:

            

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: 4027 Column: 21 CWE codes: 362/367!
Suggestion: Set up the correct permissions (e.g., using setuid()) and try to open the file directly

                  {
#if defined(JS_CODEGEN_ARM)
        if (IsUnaligned(access)) {
            switch (access.type()) {
              case Scalar::Float64:
                *temp3 = needI32();
                MOZ_FALLTHROUGH;
              case Scalar::Float32:
                *temp2 = needI32();

            

Reported by FlawFinder.

src/third_party/IntelRDFPMathLib20U1/LIBRARY/src/bid128_compare.c
104 issues
Shifting 32-bit value by 49 bits is undefined behaviour
Error

Line: 79 CWE codes: 758

                // CONVERT X
sig_x.w[1] = x.w[1] & 0x0001ffffffffffffull;
sig_x.w[0] = x.w[0];
exp_x = (x.w[1] >> 49) & 0x000000000003fffull;

  // CHECK IF X IS CANONICAL
  // 9999999999999999999999999999999999(decimal) = 
  //   1ed09_bead87c0_378d8e63_ffffffff(hexadecimal)
  // [0, 10^34) is the 754 supported canonical range.  

            

Reported by Cppcheck.

Shifting 32-bit value by 49 bits is undefined behaviour
Error

Line: 95 CWE codes: 758

                non_canon_x = 0;

  // CONVERT Y
exp_y = (y.w[1] >> 49) & 0x0000000000003fffull;
sig_y.w[1] = y.w[1] & 0x0001ffffffffffffull;
sig_y.w[0] = y.w[0];

  // CHECK IF Y IS CANONICAL
  // 9999999999999999999999999999999999(decimal) = 

            

Reported by Cppcheck.

Shifting 32-bit value by 32 bits is undefined behaviour
Error

Line: 152 CWE codes: 758

              
if (exp_y - exp_x > 19) {
  // recalculate y's significand upwards
  __mul_128x128_to_256 (sig_n_prime256, sig_y,
			bid_ten2k128[exp_y - exp_x - 20]);
  {
    res = ((sig_n_prime256.w[3] == 0) && (sig_n_prime256.w[2] == 0)
	   && (sig_n_prime256.w[1] == sig_x.w[1])
	   && (sig_n_prime256.w[0] == sig_x.w[0]));

            

Reported by Cppcheck.

Shifting 32-bit value by 32 bits is undefined behaviour
Error

Line: 164 CWE codes: 758

              }
  //else{
  // recalculate y's significand upwards
__mul_64x128_to_192 (sig_n_prime192, bid_ten2k64[exp_y - exp_x], sig_y);
{
  res = ((sig_n_prime192.w[2] == 0)
	 && (sig_n_prime192.w[1] == sig_x.w[1])
	 && (sig_n_prime192.w[0] == sig_x.w[0]));
  BID_RETURN_VAL (res);

            

Reported by Cppcheck.

Shifting 32-bit value by 49 bits is undefined behaviour
Error

Line: 229 CWE codes: 758

                // CONVERT X
sig_x.w[1] = x.w[1] & 0x0001ffffffffffffull;
sig_x.w[0] = x.w[0];
exp_x = (x.w[1] >> 49) & 0x000000000003fffull;

  // CHECK IF X IS CANONICAL
  // 9999999999999999999999999999999999(decimal) = 
  //   1ed09_bead87c0_378d8e63_ffffffff(hexadecimal)
  // [0, 10^34) is the 754 supported canonical range.  

            

Reported by Cppcheck.

Shifting 32-bit value by 49 bits is undefined behaviour
Error

Line: 245 CWE codes: 758

                non_canon_x = 0;

  // CONVERT Y
exp_y = (y.w[1] >> 49) & 0x0000000000003fffull;
sig_y.w[1] = y.w[1] & 0x0001ffffffffffffull;
sig_y.w[0] = y.w[0];

  // CHECK IF Y IS CANONICAL
  // 9999999999999999999999999999999999(decimal) = 

            

Reported by Cppcheck.

Shifting 32-bit value by 32 bits is undefined behaviour
Error

Line: 336 CWE codes: 758

                }	// difference cannot be greater than 10^33

  if (diff > 19) {	//128 by 128 bit multiply -> 256 bits
    __mul_128x128_to_256 (sig_n_prime256, sig_x, bid_ten2k128[diff - 20]);

    // if postitive, return whichever significand is larger 
    // (converse if negative)
    if (sig_n_prime256.w[3] == 0 && (sig_n_prime256.w[2] == 0)
	&& sig_n_prime256.w[1] == sig_y.w[1]

            

Reported by Cppcheck.

Shifting 32-bit value by 32 bits is undefined behaviour
Error

Line: 356 CWE codes: 758

                  }
  }
  //else { //128 by 64 bit multiply -> 192 bits
  __mul_64x128_to_192 (sig_n_prime192, bid_ten2k64[diff], sig_x);

  // if postitive, return whichever significand is larger 
  // (converse if negative)
  if ((sig_n_prime192.w[2] == 0) && sig_n_prime192.w[1] == sig_y.w[1]
      && (sig_n_prime192.w[0] == sig_y.w[0])) {

            

Reported by Cppcheck.

Shifting 32-bit value by 32 bits is undefined behaviour
Error

Line: 385 CWE codes: 758

              
if (diff > 19) {	//128 by 128 bit multiply -> 256 bits
  // adjust the y significand upwards
  __mul_128x128_to_256 (sig_n_prime256, sig_y, bid_ten2k128[diff - 20]);

  // if postitive, return whichever significand is larger 
  // (converse if negative)
  if (sig_n_prime256.w[3] == 0 && (sig_n_prime256.w[2] == 0)
      && sig_n_prime256.w[1] == sig_x.w[1]

            

Reported by Cppcheck.

Shifting 32-bit value by 32 bits is undefined behaviour
Error

Line: 406 CWE codes: 758

              }
  //else { //128 by 64 bit multiply -> 192 bits
  // adjust the y significand upwards
__mul_64x128_to_192 (sig_n_prime192, bid_ten2k64[diff], sig_y);

  // if postitive, return whichever significand is larger 
  // (converse if negative)
if ((sig_n_prime192.w[2] == 0) && sig_n_prime192.w[1] == sig_x.w[1]
    && (sig_n_prime192.w[0] == sig_x.w[0])) {

            

Reported by Cppcheck.

src/third_party/wiredtiger/test/suite/test_cursor13.py
104 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, time
from wiredtiger import stat
from wtscenario import make_scenarios
import test_cursor01, test_cursor02, test_cursor03
import test_checkpoint01, test_checkpoint02
from wtdataset import SimpleDataSet, ComplexDataSet, ComplexLSMDataSet

            

Reported by Pylint.

Unable to import 'wiredtiger'
Error

Line: 30 Column: 1

              # OTHER DEALINGS IN THE SOFTWARE.

import wiredtiger, wttest, time
from wiredtiger import stat
from wtscenario import make_scenarios
import test_cursor01, test_cursor02, test_cursor03
import test_checkpoint01, test_checkpoint02
from wtdataset import SimpleDataSet, ComplexDataSet, ComplexLSMDataSet
from helper import confirm_does_not_exist

            

Reported by Pylint.

An attribute defined in wttest line 401 hides this method
Error

Line: 172 Column: 5

                  ]
    scenarios = make_scenarios(types, connoptions, sessoptions)

    def conn_config(self):
        return self.connoption + ',statistics=(fast)'

    def session_config(self):
        return self.sessoption


            

Reported by Pylint.

Unused ComplexLSMDataSet imported from wtdataset
Error

Line: 34 Column: 1

              from wtscenario import make_scenarios
import test_cursor01, test_cursor02, test_cursor03
import test_checkpoint01, test_checkpoint02
from wtdataset import SimpleDataSet, ComplexDataSet, ComplexLSMDataSet
from helper import confirm_does_not_exist
from suite_random import suite_random

# Cursor caching tests
class test_cursor13_base(wttest.WiredTigerTestCase):

            

Reported by Pylint.

Unused variable 'loop'
Error

Line: 269 Column: 17

                          self.session.reconfigure('cache_cursors=true')
            ds = self.dstype(self, self.uri, 100)
            ds.populate()
            for loop in range(10):
                # We need an extra cursor open to test all code paths in
                # this loop.  After the verify (the second or more time through
                # the loop), the data handle referred to by both cached
                # cursors will no longer be open.
                #

            

Reported by Pylint.

Unused variable 'i'
Error

Line: 294 Column: 13

              
class test_cursor13_drops(test_cursor13_base):
    def open_and_drop(self, uri, cursor_session, drop_session, nopens, ntrials):
        for i in range(0, ntrials):
            cursor_session.create(uri, 'key_format=S,value_format=S')
            for i in range(0, nopens):
                c = cursor_session.open_cursor(uri)
                c.close()
            # The cursor cache is unaffected by the drop, and nothing

            

Reported by Pylint.

Redefining name 'i' from outer scope (line 294)
Error

Line: 296 Column: 13

                  def open_and_drop(self, uri, cursor_session, drop_session, nopens, ntrials):
        for i in range(0, ntrials):
            cursor_session.create(uri, 'key_format=S,value_format=S')
            for i in range(0, nopens):
                c = cursor_session.open_cursor(uri)
                c.close()
            # The cursor cache is unaffected by the drop, and nothing
            # in the cache should prevent the drop from occurring.
            drop_session.drop(uri)

            

Reported by Pylint.

TODO: try with session that DOES have cache_cursors and another
Error

Line: 335 Column: 3

                      confirm_does_not_exist(self, uri)

        # Same test for indices, but with cursor held by another session.
        # TODO: try with session that DOES have cache_cursors and another
        # that does not.
        session2 = self.conn.open_session(None)
        ds = ComplexDataSet(self, uri, 100)
        ds.create()
        indexname = ds.index_name(0)

            

Reported by Pylint.

Unused variable 'i'
Error

Line: 355 Column: 13

                      idxuri = 'index:test_cursor13_drops:index1'
        config = 'key_format=S,value_format=S,columns=(k,v1)'

        for i in range(0, 2):
            session.create(uri, config)
            session.drop(uri)

        for i in range(0, 2):
            session.create(uri, config)

            

Reported by Pylint.

Unused argument 'baseuri'
Error

Line: 403 Column: 30

              
    # Create a large number (self.nuris) of uris, and for each one,
    # create some number (self.deep) of cached cursors.
    def create_uri_map(self, baseuri):
        uri_map = {}
        for i in range(0, self.nuris):
            uri = self.uriname(i)
            cursors = []
            self.session.create(uri, None)

            

Reported by Pylint.

src/third_party/mozjs-60/extract/js/src/builtin/embedjs.py
103 issues
Unable to import 'which'
Error

Line: 42 Column: 1

              from __future__ import with_statement
import re, sys, os, subprocess
import shlex
import which
import buildconfig

def ToCAsciiArray(lines):
  result = []
  for chr in lines:

            

Reported by Pylint.

Unable to import 'buildconfig'
Error

Line: 43 Column: 1

              import re, sys, os, subprocess
import shlex
import which
import buildconfig

def ToCAsciiArray(lines):
  result = []
  for chr in lines:
    value = ord(chr)

            

Reported by Pylint.

Redefining built-in 'chr'
Error

Line: 47 Column: 7

              
def ToCAsciiArray(lines):
  result = []
  for chr in lines:
    value = ord(chr)
    assert value < 128
    result.append(str(value))
  return ", ".join(result)


            

Reported by Pylint.

Redefining built-in 'chr'
Error

Line: 55 Column: 7

              
def ToCArray(lines):
  result = []
  for chr in lines:
    result.append(str(ord(chr)))
  return ", ".join(result)

HEADER_TEMPLATE = """\
/* This Source Code Form is subject to the terms of the Mozilla Public

            

Reported by Pylint.

Dangerous default value [] as argument
Error

Line: 101 Column: 1

                  'namespace': namespace
  })

def preprocess(cxx, preprocessorOption, source, args = []):
  if (not os.path.exists(cxx[0])):
    cxx[0] = which.which(cxx[0])
  # Clang seems to complain and not output anything if the extension of the
  # input is not something it recognizes, so just fake a .cpp here.
  tmpIn = 'self-hosting-cpp-input.cpp';

            

Reported by Pylint.

Unnecessary semicolon
Error

Line: 106 Column: 1

                  cxx[0] = which.which(cxx[0])
  # Clang seems to complain and not output anything if the extension of the
  # input is not something it recognizes, so just fake a .cpp here.
  tmpIn = 'self-hosting-cpp-input.cpp';
  tmpOut = 'self-hosting-preprocessed.pp';
  outputArg = shlex.split(preprocessorOption + tmpOut)

  with open(tmpIn, 'wb') as input:
    input.write(source)

            

Reported by Pylint.

Unnecessary semicolon
Error

Line: 107 Column: 1

                # Clang seems to complain and not output anything if the extension of the
  # input is not something it recognizes, so just fake a .cpp here.
  tmpIn = 'self-hosting-cpp-input.cpp';
  tmpOut = 'self-hosting-preprocessed.pp';
  outputArg = shlex.split(preprocessorOption + tmpOut)

  with open(tmpIn, 'wb') as input:
    input.write(source)
  print(' '.join(cxx + outputArg + args + [tmpIn]))

            

Reported by Pylint.

Redefining built-in 'input'
Error

Line: 110 Column: 29

                tmpOut = 'self-hosting-preprocessed.pp';
  outputArg = shlex.split(preprocessorOption + tmpOut)

  with open(tmpIn, 'wb') as input:
    input.write(source)
  print(' '.join(cxx + outputArg + args + [tmpIn]))
  result = subprocess.Popen(cxx + outputArg + args + [tmpIn]).wait()
  if (result != 0):
    sys.exit(result);

            

Reported by Pylint.

Unnecessary semicolon
Error

Line: 115 Column: 1

                print(' '.join(cxx + outputArg + args + [tmpIn]))
  result = subprocess.Popen(cxx + outputArg + args + [tmpIn]).wait()
  if (result != 0):
    sys.exit(result);
  with open(tmpOut, 'r') as output:
    processed = output.read();
  os.remove(tmpIn)
  os.remove(tmpOut)
  return processed

            

Reported by Pylint.

Unnecessary semicolon
Error

Line: 117 Column: 1

                if (result != 0):
    sys.exit(result);
  with open(tmpOut, 'r') as output:
    processed = output.read();
  os.remove(tmpIn)
  os.remove(tmpOut)
  return processed

def messages(jsmsg):

            

Reported by Pylint.

src/third_party/scons-3.1.2/scons-local-3.1.2/SCons/cpp.py
102 issues
An attribute defined in cpp line 259 hides this method
Error

Line: 509 Column: 5

                      # XXX finish this -- maybe borrow/share logic from do_include()...?
        pass

    def do_include(self, t):
        """
        Default handling of a #include line.
        """
        t = self.resolve_include(t)
        include_file = self.find_include_file(t)

            

Reported by Pylint.

Unused import SCons.compat
Error

Line: 29 Column: 1

              __doc__ = """
SCons C Pre-Processor module
"""
import SCons.compat

import os
import re

#

            

Reported by Pylint.

Using possibly undefined loop variable 'op_list'
Error

Line: 83 Column: 5

                      Table[op] = e
del e
del op
del op_list

# Create a list of the expressions we'll use to match all of the
# preprocessor directives.  These are the same as the directives
# themselves *except* that we must use a negative lookahead assertion
# when matching "if" so it doesn't match the "if" in "ifdef" or "ifndef".

            

Reported by Pylint.

Lambda may not be necessary
Error

Line: 135 Column: 53

              # re module, as late as version 2.2.2, empirically matches the
# "!" in "!=" first, instead of finding the longest match.
# What's up with that?
l = sorted(list(CPP_to_Python_Ops_Dict.keys()), key=lambda a: len(a), reverse=True)

# Turn the list of keys into one regular expression that will allow us
# to substitute all of the operators at once.
expr = '|'.join(map(re.escape, l))


            

Reported by Pylint.

Redefining name 'expr' from outer scope (line 77)
Error

Line: 167 Column: 9

                  Python expression that can be evaluated.
    """
    s = CPP_to_Python_Ops_Expression.sub(CPP_to_Python_Ops_Sub, s)
    for expr, repl in CPP_to_Python_Eval_List:
        s = re.sub(expr, repl, s)
    return s




            

Reported by Pylint.

Redefining built-in 'locals'
Error

Line: 207 Column: 9

                      # corresponding values in this "call."  We'll use this when we
        # eval() the expansion so that arguments will get expanded to
        # the right values.
        locals = {}
        for k, v in zip(self.args, values):
            locals[k] = v

        parts = []
        for s in self.expansion:

            

Reported by Pylint.

Use of possibly insecure function - consider using safer ast.literal_eval.
Security blacklist

Line: 218
Suggestion: https://bandit.readthedocs.io/en/latest/blacklists/blacklist_calls.html#b307-eval

                          parts.append(s)
        statement = ' + '.join(parts)

        return eval(statement, globals(), locals)



# Find line continuations.
line_continuations = re.compile('\\\\\r?\n')

            

Reported by Bandit.

Use of eval
Error

Line: 218 Column: 16

                          parts.append(s)
        statement = ' + '.join(parts)

        return eval(statement, globals(), locals)



# Find line continuations.
line_continuations = re.compile('\\\\\r?\n')

            

Reported by Pylint.

Redefining built-in 'dict'
Error

Line: 240 Column: 55

                  """
    The main workhorse class for handling C pre-processing.
    """
    def __init__(self, current=os.curdir, cpppath=(), dict={}, all=0):
        global Table

        cpppath = tuple(cpppath)

        self.searchpath = {

            

Reported by Pylint.

Redefining built-in 'all'
Error

Line: 240 Column: 64

                  """
    The main workhorse class for handling C pre-processing.
    """
    def __init__(self, current=os.curdir, cpppath=(), dict={}, all=0):
        global Table

        cpppath = tuple(cpppath)

        self.searchpath = {

            

Reported by Pylint.