The following issues were found

src/third_party/wiredtiger/test/suite/test_prepare08.py
40 issues
Unable to import 'wiredtiger'
Error

Line: 31 Column: 1

              
import fnmatch, os, shutil, time
from helper import copy_wiredtiger_home
import wiredtiger, wttest
from wtdataset import SimpleDataSet
from wtscenario import make_scenarios

# test_prepare08.py
# Test to ensure prepared tombstones are properly aborted/committed even when they are written

            

Reported by Pylint.

Unused import shutil
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 fnmatch, os, shutil, time
from helper import copy_wiredtiger_home
import wiredtiger, wttest
from wtdataset import SimpleDataSet
from wtscenario import make_scenarios


            

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 fnmatch, os, shutil, time
from helper import copy_wiredtiger_home
import wiredtiger, wttest
from wtdataset import SimpleDataSet
from wtscenario import make_scenarios


            

Reported by Pylint.

Unused import fnmatch
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 fnmatch, os, shutil, time
from helper import copy_wiredtiger_home
import wiredtiger, wttest
from wtdataset import SimpleDataSet
from wtscenario import make_scenarios


            

Reported by Pylint.

Unused import time
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 fnmatch, os, shutil, time
from helper import copy_wiredtiger_home
import wiredtiger, wttest
from wtdataset import SimpleDataSet
from wtscenario import make_scenarios


            

Reported by Pylint.

Unused copy_wiredtiger_home imported from helper
Error

Line: 30 Column: 1

              # OTHER DEALINGS IN THE SOFTWARE.

import fnmatch, os, shutil, time
from helper import copy_wiredtiger_home
import wiredtiger, wttest
from wtdataset import SimpleDataSet
from wtscenario import make_scenarios

# test_prepare08.py

            

Reported by Pylint.

Using deprecated method assertEquals()
Error

Line: 55 Column: 13

                      for i in range(1, nrows):
            cursor.set_key(ds.key(i))
            cursor.set_value(value)
            self.assertEquals(cursor.update(), 0)
        self.session.commit_transaction('commit_timestamp=' + self.timestamp_str(ts))
        cursor.close()

    def removes(self, ds, uri, nrows, ts):
        cursor = self.session.open_cursor(uri)

            

Reported by Pylint.

Using deprecated method assertEquals()
Error

Line: 64 Column: 13

                      self.session.begin_transaction('isolation=snapshot')
        for i in range(1, nrows):
            cursor.set_key(ds.key(i))
            self.assertEquals(cursor.remove(), 0)
        self.session.commit_transaction('commit_timestamp=' + self.timestamp_str(ts))
        cursor.close()

    def check(self, ds, uri, nrows, value, ts, release_evict):
        if release_evict:

            

Reported by Pylint.

Using deprecated method assertEquals()
Error

Line: 79 Column: 17

                          if value == None:
                self.assertEqual(cursor.search(), wiredtiger.WT_NOTFOUND)
            else:
                self.assertEquals(cursor.search(), 0)
                self.assertEquals(cursor.get_value(),value)
            cursor.reset()
        self.session.commit_transaction()
        cursor.close()


            

Reported by Pylint.

Using deprecated method assertEquals()
Error

Line: 80 Column: 17

                              self.assertEqual(cursor.search(), wiredtiger.WT_NOTFOUND)
            else:
                self.assertEquals(cursor.search(), 0)
                self.assertEquals(cursor.get_value(),value)
            cursor.reset()
        self.session.commit_transaction()
        cursor.close()

    def test_prepare_delete_rollback(self):

            

Reported by Pylint.

src/third_party/IntelRDFPMathLib20U1/LIBRARY/src/bid_sqrt_macros.h
39 issues
Shifting 32-bit value by 52 bits is undefined behaviour
Error

Line: 174 CWE codes: 758

                ly.d = 1.0 / sqrt (lx);

  MY = (ly.i & 0x000fffffffffffffull) | 0x0010000000000000ull;
  ey = 0x3ff - (ly.i >> 52);

  // A10*RS^2
  __mul_64x128_to_192 (ARS0, MY, A10);
  __mul_64x192_to_256 (ARS, MY, ARS0);


            

Reported by Cppcheck.

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

Line: 174 CWE codes: 758

                ly.d = 1.0 / sqrt (lx);

  MY = (ly.i & 0x000fffffffffffffull) | 0x0010000000000000ull;
  ey = 0x3ff - (ly.i >> 52);

  // A10*RS^2
  __mul_64x128_to_192 (ARS0, MY, A10);
  __mul_64x192_to_256 (ARS, MY, ARS0);


            

Reported by Cppcheck.

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

Line: 174 CWE codes: 758

                ly.d = 1.0 / sqrt (lx);

  MY = (ly.i & 0x000fffffffffffffull) | 0x0010000000000000ull;
  ey = 0x3ff - (ly.i >> 52);

  // A10*RS^2
  __mul_64x128_to_192 (ARS0, MY, A10);
  __mul_64x192_to_256 (ARS, MY, ARS0);


            

Reported by Cppcheck.

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

Line: 177 CWE codes: 758

                ey = 0x3ff - (ly.i >> 52);

  // A10*RS^2
  __mul_64x128_to_192 (ARS0, MY, A10);
  __mul_64x192_to_256 (ARS, MY, ARS0);

  // shr by 2*ey+40, to get a 64-bit value
  k = (ey << 1) + 104 - 64;
  if (k >= 128) {

            

Reported by Cppcheck.

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

Line: 177 CWE codes: 758

                ey = 0x3ff - (ly.i >> 52);

  // A10*RS^2
  __mul_64x128_to_192 (ARS0, MY, A10);
  __mul_64x192_to_256 (ARS, MY, ARS0);

  // shr by 2*ey+40, to get a 64-bit value
  k = (ey << 1) + 104 - 64;
  if (k >= 128) {

            

Reported by Cppcheck.

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

Line: 177 CWE codes: 758

                ey = 0x3ff - (ly.i >> 52);

  // A10*RS^2
  __mul_64x128_to_192 (ARS0, MY, A10);
  __mul_64x192_to_256 (ARS, MY, ARS0);

  // shr by 2*ey+40, to get a 64-bit value
  k = (ey << 1) + 104 - 64;
  if (k >= 128) {

            

Reported by Cppcheck.

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

Line: 178 CWE codes: 758

              
  // A10*RS^2
  __mul_64x128_to_192 (ARS0, MY, A10);
  __mul_64x192_to_256 (ARS, MY, ARS0);

  // shr by 2*ey+40, to get a 64-bit value
  k = (ey << 1) + 104 - 64;
  if (k >= 128) {
    if (k > 128)

            

Reported by Cppcheck.

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

Line: 178 CWE codes: 758

              
  // A10*RS^2
  __mul_64x128_to_192 (ARS0, MY, A10);
  __mul_64x192_to_256 (ARS, MY, ARS0);

  // shr by 2*ey+40, to get a 64-bit value
  k = (ey << 1) + 104 - 64;
  if (k >= 128) {
    if (k > 128)

            

Reported by Cppcheck.

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

Line: 178 CWE codes: 758

              
  // A10*RS^2
  __mul_64x128_to_192 (ARS0, MY, A10);
  __mul_64x192_to_256 (ARS, MY, ARS0);

  // shr by 2*ey+40, to get a 64-bit value
  k = (ey << 1) + 104 - 64;
  if (k >= 128) {
    if (k > 128)

            

Reported by Cppcheck.

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

Line: 205 CWE codes: 758

                  ES = -ES;

    // A*RS*eps (scaled by 2^64)
    __mul_64x192_to_256 (AE0, ES, ARS0);

    AE.w[0] = AE0.w[1];
    AE.w[1] = AE0.w[2];
    AE.w[2] = AE0.w[3];


            

Reported by Cppcheck.

src/third_party/wiredtiger/test/3rdparty/testtools-0.9.34/testtools/matchers/_basic.py
39 issues
Attempted relative import beyond top-level package
Error

Line: 21 Column: 1

              from pprint import pformat
import re

from ..compat import (
    _isbytes,
    istext,
    str_is_unicode,
    text_repr,
    )

            

Reported by Pylint.

Attempted relative import beyond top-level package
Error

Line: 27 Column: 1

                  str_is_unicode,
    text_repr,
    )
from ..helpers import list_subtract
from ._higherorder import (
    MatchesPredicateWithParams,
    PostfixedMismatch,
    )
from ._impl import (

            

Reported by Pylint.

Attempted relative import beyond top-level package
Error

Line: 28 Column: 1

                  text_repr,
    )
from ..helpers import list_subtract
from ._higherorder import (
    MatchesPredicateWithParams,
    PostfixedMismatch,
    )
from ._impl import (
    Matcher,

            

Reported by Pylint.

Attempted relative import beyond top-level package
Error

Line: 32 Column: 1

                  MatchesPredicateWithParams,
    PostfixedMismatch,
    )
from ._impl import (
    Matcher,
    Mismatch,
    )



            

Reported by Pylint.

Instance of '_BinaryComparison' has no 'mismatch_string' member
Error

Line: 60 Column: 47

                  def match(self, other):
        if self.comparator(other, self.expected):
            return None
        return _BinaryMismatch(self.expected, self.mismatch_string, other)

    def comparator(self, expected, other):
        raise NotImplementedError(self.comparator)



            

Reported by Pylint.

Undefined variable 'unicode'
Error

Line: 315 Column: 66

                  def match(self, value):
        if not re.match(self.pattern, value, self.flags):
            pattern = self.pattern
            if not isinstance(pattern, str_is_unicode and str or unicode):
                pattern = pattern.decode("latin1")
            pattern = pattern.encode("unicode_escape").decode("ascii")
            return Mismatch("%r does not match /%s/" % (
                    value, pattern.replace("\\\\", "\\")))


            

Reported by Pylint.

Missing module docstring
Error

Line: 1 Column: 1

              # Copyright (c) 2009-2012 testtools developers. See LICENSE for details.

__all__ = [
    'Contains',
    'EndsWith',
    'Equals',
    'GreaterThan',
    'HasLength',
    'Is',

            

Reported by Pylint.

Class '_BinaryComparison' inherits from object, can be safely removed from bases in python3
Error

Line: 48 Column: 1

                  return pformat(thing)


class _BinaryComparison(object):
    """Matcher that compares an object to another object."""

    def __init__(self, expected):
        self.expected = expected


            

Reported by Pylint.

Missing function or method docstring
Error

Line: 57 Column: 5

                  def __str__(self):
        return "%s(%r)" % (self.__class__.__name__, self.expected)

    def match(self, other):
        if self.comparator(other, self.expected):
            return None
        return _BinaryMismatch(self.expected, self.mismatch_string, other)

    def comparator(self, expected, other):

            

Reported by Pylint.

Missing function or method docstring
Error

Line: 62 Column: 5

                          return None
        return _BinaryMismatch(self.expected, self.mismatch_string, other)

    def comparator(self, expected, other):
        raise NotImplementedError(self.comparator)


class _BinaryMismatch(Mismatch):
    """Two things did not match."""

            

Reported by Pylint.

site_scons/site_tools/auto_install_binaries.py
38 issues
Unable to import 'SCons'
Error

Line: 27 Column: 1

              
from collections import defaultdict, namedtuple

import SCons
from SCons.Tool import install

ALIAS_MAP = "AIB_ALIAS_MAP"
BASE_COMPONENT = "AIB_BASE_COMPONENT"
BASE_ROLE = "AIB_BASE_ROLE"

            

Reported by Pylint.

Unable to import 'SCons.Tool'
Error

Line: 28 Column: 1

              from collections import defaultdict, namedtuple

import SCons
from SCons.Tool import install

ALIAS_MAP = "AIB_ALIAS_MAP"
BASE_COMPONENT = "AIB_BASE_COMPONENT"
BASE_ROLE = "AIB_BASE_ROLE"
COMPONENT = "AIB_COMPONENT"

            

Reported by Pylint.

Undefined variable 'target'
Error

Line: 516 Column: 21

                      if role not in env[ROLE_DECLARATIONS]:
            raise Exception(
                "target {} is not a known role. Available roles are {}".format(
                    target, env[ROLE_DECLARATIONS].keys()
                )
            )

    env[SUFFIX_MAP].update({env.subst(key): value for key, value in suffix.items()})


            

Reported by Pylint.

TODO: Handle chmod state
Error

Line: 23 Column: 3

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

# TODO: Handle chmod state

from collections import defaultdict, namedtuple

import SCons
from SCons.Tool import install

            

Reported by Pylint.

Unused argument 'transitive'
Error

Line: 73 Column: 49

              

class DeclaredRole:
    def __init__(self, name, dependencies=None, transitive=False, silent=False):
        self.name = name

        if dependencies is None:
            self.dependencies = set()
        else:

            

Reported by Pylint.

Unused argument 'env'
Error

Line: 84 Column: 18

                      self.silent = silent


def declare_role(env, **kwargs):
    """Construct a new role declaration"""
    return DeclaredRole(**kwargs)


def declare_roles(env, roles, base_role=None, meta_role=None):

            

Reported by Pylint.

TODO: Check for DAG
Error

Line: 159 Column: 3

                  if meta_role:
        roles[meta_role].dependencies.update(r for r in roles.keys() if r != meta_role)

    # TODO: Check for DAG

    # TODO: What if base_role or meta_role is really None?
    env[BASE_ROLE] = base_role
    env[META_ROLE] = meta_role
    env[ROLE_DECLARATIONS] = roles

            

Reported by Pylint.

TODO: What if base_role or meta_role is really None?
Error

Line: 161 Column: 3

              
    # TODO: Check for DAG

    # TODO: What if base_role or meta_role is really None?
    env[BASE_ROLE] = base_role
    env[META_ROLE] = meta_role
    env[ROLE_DECLARATIONS] = roles



            

Reported by Pylint.

TODO: Find a way to do this without the tools needing to coordinate.
Error

Line: 383 Column: 3

                          # be placed, but need to actually handle the substructure. Currently, this is
            # only used by separate_debug.py.
            #
            # TODO: Find a way to do this without the tools needing to coordinate.
            suffix = getattr(s.attributes, "aib_effective_suffix", s.get_suffix())
            auto_install_mapping = env[SUFFIX_MAP].get(suffix)

            if not auto_install_mapping:
                raise Exception(

            

Reported by Pylint.

Unused argument 'env'
Error

Line: 523 Column: 20

                  env[SUFFIX_MAP].update({env.subst(key): value for key, value in suffix.items()})


def suffix_mapping(env, directory="", default_role=False):
    """Generate a SuffixMap object from source and target."""
    return SuffixMap(directory=directory, default_role=default_role)


def get_auto_installed_files(env, node):

            

Reported by Pylint.

src/third_party/wiredtiger/test/suite/test_prepare07.py
38 issues
Unable to import 'wiredtiger'
Error

Line: 31 Column: 1

              
import fnmatch, os, shutil, time
from helper import copy_wiredtiger_home
import wiredtiger, wttest
from wtdataset import SimpleDataSet
from wtscenario import make_scenarios

# test_prepare07.py
# Test to ensure prepared updates older than oldest timestamp are not visible.

            

Reported by Pylint.

Unused import fnmatch
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 fnmatch, os, shutil, time
from helper import copy_wiredtiger_home
import wiredtiger, wttest
from wtdataset import SimpleDataSet
from wtscenario import make_scenarios


            

Reported by Pylint.

Unused import shutil
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 fnmatch, os, shutil, time
from helper import copy_wiredtiger_home
import wiredtiger, wttest
from wtdataset import SimpleDataSet
from wtscenario import make_scenarios


            

Reported by Pylint.

Unused import time
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 fnmatch, os, shutil, time
from helper import copy_wiredtiger_home
import wiredtiger, wttest
from wtdataset import SimpleDataSet
from wtscenario import make_scenarios


            

Reported by Pylint.

Unused copy_wiredtiger_home imported from helper
Error

Line: 30 Column: 1

              # OTHER DEALINGS IN THE SOFTWARE.

import fnmatch, os, shutil, time
from helper import copy_wiredtiger_home
import wiredtiger, wttest
from wtdataset import SimpleDataSet
from wtscenario import make_scenarios

# test_prepare07.py

            

Reported by Pylint.

Unused import wiredtiger
Error

Line: 31 Column: 1

              
import fnmatch, os, shutil, time
from helper import copy_wiredtiger_home
import wiredtiger, wttest
from wtdataset import SimpleDataSet
from wtscenario import make_scenarios

# test_prepare07.py
# Test to ensure prepared updates older than oldest timestamp are not visible.

            

Reported by Pylint.

Using deprecated method assertEquals()
Error

Line: 62 Column: 9

                      self.session.begin_transaction('isolation=snapshot')
        cursor.set_key(ds.key(nrows + 1))
        cursor.set_value(value_b)
        self.assertEquals(cursor.update(), 0)
        self.session.commit_transaction('commit_timestamp=' + self.timestamp_str(110))
        self.session.begin_transaction('isolation=snapshot')
        cursor.set_key(ds.key(nrows + 2))
        cursor.set_value(value_b)
        self.assertEquals(cursor.update(), 0)

            

Reported by Pylint.

Using deprecated method assertEquals()
Error

Line: 67 Column: 9

                      self.session.begin_transaction('isolation=snapshot')
        cursor.set_key(ds.key(nrows + 2))
        cursor.set_value(value_b)
        self.assertEquals(cursor.update(), 0)
        self.session.commit_transaction('commit_timestamp=' + self.timestamp_str(120))

        # Prepare a transaction and keep it open.
        session_p = self.conn.open_session()
        cursor_p = session_p.open_cursor(uri)

            

Reported by Pylint.

Using deprecated method assertEquals()
Error

Line: 76 Column: 9

                      session_p.begin_transaction('isolation=snapshot')
        cursor_p.set_key(ds.key(nrows + 3))
        cursor_p.set_value(value_b)
        self.assertEquals(cursor_p.update(), 0)
        session_p.prepare_transaction('prepare_timestamp=' + self.timestamp_str(130))

        # Commit some more updates.
        self.session.begin_transaction('isolation=snapshot')
        cursor.set_key(ds.key(nrows + 4))

            

Reported by Pylint.

Using deprecated method assertEquals()
Error

Line: 83 Column: 9

                      self.session.begin_transaction('isolation=snapshot')
        cursor.set_key(ds.key(nrows + 4))
        cursor.set_value(value_b)
        self.assertEquals(cursor.update(), 0)
        self.session.commit_transaction('commit_timestamp=' + self.timestamp_str(140))
        self.session.begin_transaction('isolation=snapshot')
        cursor.set_key(ds.key(nrows + 5))
        cursor.set_value(value_b)
        self.assertEquals(cursor.update(), 0)

            

Reported by Pylint.

src/third_party/scons-3.1.2/scons-local-3.1.2/SCons/Tool/gettext_tool.py
38 issues
Unused argument 'kw'
Error

Line: 29 Column: 1

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

#############################################################################
def generate(env,**kw):
  import sys
  import os
  import SCons.Tool
  from SCons.Platform.mingw import MINGW_DEFAULT_PATHS
  from SCons.Platform.cygwin import CYGWIN_DEFAULT_PATHS

            

Reported by Pylint.

No exception type(s) specified
Error

Line: 58 Column: 3

                try:
    return _xgettext_exists(env) and _msginit_exists(env) \
       and _msgmerge_exists(env) and _msgfmt_exists(env)
  except:
    return False
#############################################################################

            

Reported by Pylint.

Trailing whitespace
Error

Line: 6 Column: 2

              

# Copyright (c) 2001 - 2019 The SCons Foundation
# 
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, publish,
# distribute, sublicense, and/or sell copies of the Software, and to

            

Reported by Pylint.

Trailing whitespace
Error

Line: 14 Column: 2

              # distribute, sublicense, and/or sell copies of the Software, and to
# permit persons to whom the Software is furnished to do so, subject to
# the following conditions:
# 
# The above copyright notice and this permission notice shall be included
# in all copies or substantial portions of the Software.
# 
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY
# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE

            

Reported by Pylint.

Trailing whitespace
Error

Line: 17 Column: 2

              # 
# The above copyright notice and this permission notice shall be included
# in all copies or substantial portions of the Software.
# 
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY
# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION

            

Reported by Pylint.

Line too long (123/100)
Error

Line: 26 Column: 1

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

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

#############################################################################
def generate(env,**kw):
  import sys
  import os

            

Reported by Pylint.

Missing function or method docstring
Error

Line: 29 Column: 1

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

#############################################################################
def generate(env,**kw):
  import sys
  import os
  import SCons.Tool
  from SCons.Platform.mingw import MINGW_DEFAULT_PATHS
  from SCons.Platform.cygwin import CYGWIN_DEFAULT_PATHS

            

Reported by Pylint.

Import outside toplevel (sys)
Error

Line: 30 Column: 3

              
#############################################################################
def generate(env,**kw):
  import sys
  import os
  import SCons.Tool
  from SCons.Platform.mingw import MINGW_DEFAULT_PATHS
  from SCons.Platform.cygwin import CYGWIN_DEFAULT_PATHS


            

Reported by Pylint.

Bad indentation. Found 2 spaces, expected 4
Style

Line: 30 Column: 1

              
#############################################################################
def generate(env,**kw):
  import sys
  import os
  import SCons.Tool
  from SCons.Platform.mingw import MINGW_DEFAULT_PATHS
  from SCons.Platform.cygwin import CYGWIN_DEFAULT_PATHS


            

Reported by Pylint.

Import outside toplevel (os)
Error

Line: 31 Column: 3

              #############################################################################
def generate(env,**kw):
  import sys
  import os
  import SCons.Tool
  from SCons.Platform.mingw import MINGW_DEFAULT_PATHS
  from SCons.Platform.cygwin import CYGWIN_DEFAULT_PATHS

  from SCons.Tool.GettextCommon \

            

Reported by Pylint.

src/third_party/scons-3.1.2/scons-local-3.1.2/SCons/Scanner/LaTeX.py
38 issues
Redefining built-in 'dir'
Error

Line: 87 Column: 29

                  """
    def __init__(self, variable):
        self.variable = variable
    def __call__(self, env, dir=None, target=None, source=None, argument=None):
        import SCons.PathList
        try:
            path = env['ENV'][self.variable]
        except KeyError:
            return ()

            

Reported by Pylint.

Redefining name 'SCons' from outer scope (line 35)
Error

Line: 88 Column: 9

                  def __init__(self, variable):
        self.variable = variable
    def __call__(self, env, dir=None, target=None, source=None, argument=None):
        import SCons.PathList
        try:
            path = env['ENV'][self.variable]
        except KeyError:
            return ()


            

Reported by Pylint.

Unused argument 'env'
Error

Line: 208 Column: 25

              
        self.graphics_extensions = graphics_extensions

        def _scan(node, env, path=(), self=self):
            node = node.rfile()
            if not node.exists():
                return []
            return self.scan_recurse(node, path)


            

Reported by Pylint.

Redefining built-in 'dir'
Error

Line: 231 Column: 37

                                  self.dictionary[k] = ( SCons.Scanner.FindPathDirs(n),
                                           FindENVPathDirs(n) )

            def __call__(self, env, dir=None, target=None, source=None,
                                    argument=None):
                di = {}
                for k,(c,cENV)  in self.dictionary.items():
                    di[k] = ( c(env, dir=None, target=None, source=None,
                                   argument=None) ,

            

Reported by Pylint.

Unused variable 'base'
Error

Line: 265 Column: 13

              
    def _latex_names(self, include_type, filename):
        if include_type == 'input':
            base, ext = os.path.splitext( filename )
            if ext == "":
                return [filename + '.tex']
        if include_type in ('include', 'import', 'subimport',
                            'includefrom', 'subincludefrom',
                            'inputfrom', 'subinputfrom'):

            

Reported by Pylint.

Access to a protected member _my_normcase of a client class
Error

Line: 294 Column: 16

                      return [filename]

    def sort_key(self, include):
        return SCons.Node.FS._my_normcase(str(include))

    def find_include(self, include, source_dir, path):
        inc_type, inc_subdir, inc_filename = include
        try:
            sub_paths = path[inc_type]

            

Reported by Pylint.

TODO: what about the comment in the original Classic scanner:
Error

Line: 389 Column: 3

                      # This is a hand-coded DSU (decorate-sort-undecorate, or
        # Schwartzian transform) pattern.  The sort key is the raw name
        # of the file as specifed on the \include, \input, etc. line.
        # TODO: what about the comment in the original Classic scanner:
        # """which lets
        # us keep the sort order constant regardless of whether the file
        # is actually found in a Repository or locally."""
        nodes = []
        source_dir = node.get_dir()

            

Reported by Pylint.

Module name "LaTeX" doesn't conform to snake_case naming style
Error

Line: 1 Column: 1

              """SCons.Scanner.LaTeX

This module implements the dependency scanner for LaTeX code.

"""

#
# Copyright (c) 2001 - 2019 The SCons Foundation
#

            

Reported by Pylint.

Line too long (119/100)
Error

Line: 30 Column: 1

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

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

import os.path
import re

import SCons.Scanner

            

Reported by Pylint.

Too few public methods (0/2)
Error

Line: 45 Column: 1

              

# Used as a return value of modify_env_var if the variable is not set.
class _Null(object):
    pass
_null = _Null

# The user specifies the paths in env[variable], similar to other builders.
# They may be relative and must be converted to absolute, as expected

            

Reported by Pylint.

src/third_party/wiredtiger/test/3rdparty/testtools-0.9.34/testtools/matchers/_higherorder.py
38 issues
Attempted relative import beyond top-level package
Error

Line: 15 Column: 1

              
import types

from ._impl import (
    Matcher,
    Mismatch,
    MismatchDecorator,
    )


            

Reported by Pylint.

Missing module docstring
Error

Line: 1 Column: 1

              # Copyright (c) 2009-2012 testtools developers. See LICENSE for details.

__all__ = [
    'AfterPreprocessing',
    'AllMatch',
    'Annotate',
    'AnyMatch',
    'MatchesAny',
    'MatchesAll',

            

Reported by Pylint.

Class 'MatchesAny' inherits from object, can be safely removed from bases in python3
Error

Line: 22 Column: 1

                  )


class MatchesAny(object):
    """Matches if any of the matchers it is created with match."""

    def __init__(self, *matchers):
        self.matchers = matchers


            

Reported by Pylint.

Missing function or method docstring
Error

Line: 28 Column: 5

                  def __init__(self, *matchers):
        self.matchers = matchers

    def match(self, matchee):
        results = []
        for matcher in self.matchers:
            mismatch = matcher.match(matchee)
            if mismatch is None:
                return None

            

Reported by Pylint.

Class 'MatchesAll' inherits from object, can be safely removed from bases in python3
Error

Line: 42 Column: 1

                          str(matcher) for matcher in self.matchers])


class MatchesAll(object):
    """Matches if all of the matchers it is created with match."""

    def __init__(self, *matchers, **options):
        """Construct a MatchesAll matcher.


            

Reported by Pylint.

Missing function or method docstring
Error

Line: 59 Column: 5

                  def __str__(self):
        return 'MatchesAll(%s)' % ', '.join(map(str, self.matchers))

    def match(self, matchee):
        results = []
        for matcher in self.matchers:
            mismatch = matcher.match(matchee)
            if mismatch is not None:
                if self.first_only:

            

Reported by Pylint.

Unnecessary "else" after "return"
Error

Line: 67 Column: 9

                              if self.first_only:
                    return mismatch
                results.append(mismatch)
        if results:
            return MismatchesAll(results)
        else:
            return None



            

Reported by Pylint.

Too few public methods (1/2)
Error

Line: 73 Column: 1

                          return None


class MismatchesAll(Mismatch):
    """A mismatch with many child mismatches."""

    def __init__(self, mismatches, wrap=True):
        self.mismatches = mismatches
        self._wrap = wrap

            

Reported by Pylint.

Missing function or method docstring
Error

Line: 80 Column: 5

                      self.mismatches = mismatches
        self._wrap = wrap

    def describe(self):
        descriptions = []
        if self._wrap:
            descriptions = ["Differences: ["]
        for mismatch in self.mismatches:
            descriptions.append(mismatch.describe())

            

Reported by Pylint.

Class 'Not' inherits from object, can be safely removed from bases in python3
Error

Line: 91 Column: 1

                      return '\n'.join(descriptions)


class Not(object):
    """Inverts a matcher."""

    def __init__(self, matcher):
        self.matcher = matcher


            

Reported by Pylint.

src/third_party/scons-3.1.2/scons-local-3.1.2/SCons/Tool/packaging/rpm.py
38 issues
Unused import os
Error

Line: 30 Column: 1

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

import os

import SCons.Builder
import SCons.Tool.rpmutils

from SCons.Environment import OverrideEnvironment

            

Reported by Pylint.

Unused argument 'PACKAGEROOT'
Error

Line: 39 Column: 34

              from SCons.Tool.packaging import stripinstallbuilder, src_targz
from SCons.Errors import UserError

def package(env, target, source, PACKAGEROOT, NAME, VERSION,
            PACKAGEVERSION, DESCRIPTION, SUMMARY, X_RPM_GROUP, LICENSE,
            **kw):
    # initialize the rpm tool
    SCons.Tool.Tool('rpm').generate(env)


            

Reported by Pylint.

Unused argument 'DESCRIPTION'
Error

Line: 40 Column: 29

              from SCons.Errors import UserError

def package(env, target, source, PACKAGEROOT, NAME, VERSION,
            PACKAGEVERSION, DESCRIPTION, SUMMARY, X_RPM_GROUP, LICENSE,
            **kw):
    # initialize the rpm tool
    SCons.Tool.Tool('rpm').generate(env)

    bld = env['BUILDERS']['Rpm']

            

Reported by Pylint.

Unused argument 'LICENSE'
Error

Line: 40 Column: 64

              from SCons.Errors import UserError

def package(env, target, source, PACKAGEROOT, NAME, VERSION,
            PACKAGEVERSION, DESCRIPTION, SUMMARY, X_RPM_GROUP, LICENSE,
            **kw):
    # initialize the rpm tool
    SCons.Tool.Tool('rpm').generate(env)

    bld = env['BUILDERS']['Rpm']

            

Reported by Pylint.

Unused argument 'X_RPM_GROUP'
Error

Line: 40 Column: 51

              from SCons.Errors import UserError

def package(env, target, source, PACKAGEROOT, NAME, VERSION,
            PACKAGEVERSION, DESCRIPTION, SUMMARY, X_RPM_GROUP, LICENSE,
            **kw):
    # initialize the rpm tool
    SCons.Tool.Tool('rpm').generate(env)

    bld = env['BUILDERS']['Rpm']

            

Reported by Pylint.

Unused argument 'SUMMARY'
Error

Line: 40 Column: 42

              from SCons.Errors import UserError

def package(env, target, source, PACKAGEROOT, NAME, VERSION,
            PACKAGEVERSION, DESCRIPTION, SUMMARY, X_RPM_GROUP, LICENSE,
            **kw):
    # initialize the rpm tool
    SCons.Tool.Tool('rpm').generate(env)

    bld = env['BUILDERS']['Rpm']

            

Reported by Pylint.

Redefining built-in 'str'
Error

Line: 148 Column: 5

              def build_specfile_sections(spec):
    """ Builds the sections of a rpm specfile.
    """
    str = ""

    mandatory_sections = {
        'DESCRIPTION'  : '\n%%description\n%s\n\n', }

    str = str + SimpleTagCompiler(mandatory_sections).compile( spec )

            

Reported by Pylint.

TODO: optimize those build steps, to not compile the project a second time
Error

Line: 172 Column: 3

                      }

    # Default prep, build, install and clean rules
    # TODO: optimize those build steps, to not compile the project a second time
    if 'X_RPM_PREP' not in spec:
        spec['X_RPM_PREP'] = '[ -n "$RPM_BUILD_ROOT" -a "$RPM_BUILD_ROOT" != / ] && rm -rf "$RPM_BUILD_ROOT"' + '\n%setup -q'

    if 'X_RPM_BUILD' not in spec:
        spec['X_RPM_BUILD'] = '[ ! -e "$RPM_BUILD_ROOT" -a "$RPM_BUILD_ROOT" != / ] && mkdir "$RPM_BUILD_ROOT"'

            

Reported by Pylint.

Redefining built-in 'str'
Error

Line: 192 Column: 5

              def build_specfile_header(spec):
    """ Builds all sections but the %file of a rpm specfile
    """
    str = ""

    # first the mandatory sections
    mandatory_header_fields = {
        'NAME'           : '%%define name %s\nName: %%{name}\n',
        'VERSION'        : '%%define version %s\nVersion: %%{version}\n',

            

Reported by Pylint.

Redefining built-in 'str'
Error

Line: 266 Column: 5

              def build_specfile_filesection(spec, files):
    """ builds the %file section of the specfile
    """
    str  = '%files\n'

    if 'X_RPM_DEFATTR' not in spec:
        spec['X_RPM_DEFATTR'] = '(-,root,root)'

    str = str + '%%defattr %s\n' % spec['X_RPM_DEFATTR']

            

Reported by Pylint.

src/third_party/mozjs-60/extract/js/src/jit/x86/MacroAssembler-x86.cpp
38 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: 600 Column: 56 CWE codes: 362/367!
Suggestion: Set up the correct permissions (e.g., using setuid()) and try to open the file directly

              // wasm specific methods, used in both the wasm baseline compiler and ion.

void
MacroAssembler::wasmLoad(const wasm::MemoryAccessDesc& access, Operand srcAddr, AnyRegister out)
{
    MOZ_ASSERT(srcAddr.kind() == Operand::MEM_REG_DISP || srcAddr.kind() == Operand::MEM_SCALE);

    memoryBarrierBefore(access.sync());


            

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

              {
    MOZ_ASSERT(srcAddr.kind() == Operand::MEM_REG_DISP || srcAddr.kind() == Operand::MEM_SCALE);

    memoryBarrierBefore(access.sync());

    size_t loadOffset = size();
    switch (access.type()) {
      case Scalar::Int8:
        movsbl(srcAddr, out.gpr());

            

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

                  memoryBarrierBefore(access.sync());

    size_t loadOffset = size();
    switch (access.type()) {
      case Scalar::Int8:
        movsbl(srcAddr, out.gpr());
        break;
      case Scalar::Uint8:
        movzbl(srcAddr, out.gpr());

            

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

                      vmovsd(srcAddr, out.fpu());
        break;
      case Scalar::Float32x4:
        switch (access.numSimdElems()) {
          // In memory-to-register mode, movss zeroes out the high lanes.
          case 1: vmovss(srcAddr, out.fpu()); break;
          // See comment above, which also applies to movsd.
          case 2: vmovsd(srcAddr, out.fpu()); break;
          case 4: vmovups(srcAddr, out.fpu()); break;

            

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

                      }
        break;
      case Scalar::Int32x4:
        switch (access.numSimdElems()) {
          // In memory-to-register mode, movd zeroes out the high lanes.
          case 1: vmovd(srcAddr, out.fpu()); break;
          // See comment above, which also applies to movq.
          case 2: vmovq(srcAddr, out.fpu()); break;
          case 4: vmovdqu(srcAddr, out.fpu()); break;

            

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

                      }
        break;
      case Scalar::Int8x16:
        MOZ_ASSERT(access.numSimdElems() == 16, "unexpected partial load");
        vmovdqu(srcAddr, out.fpu());
        break;
      case Scalar::Int16x8:
        MOZ_ASSERT(access.numSimdElems() == 8, "unexpected partial load");
        vmovdqu(srcAddr, out.fpu());

            

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

                      vmovdqu(srcAddr, out.fpu());
        break;
      case Scalar::Int16x8:
        MOZ_ASSERT(access.numSimdElems() == 8, "unexpected partial load");
        vmovdqu(srcAddr, out.fpu());
        break;
      case Scalar::Int64:
      case Scalar::Uint8Clamped:
      case Scalar::MaxTypedArrayViewType:

            

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

                    case Scalar::MaxTypedArrayViewType:
        MOZ_CRASH("unexpected type");
    }
    append(access, loadOffset, framePushed());

    memoryBarrierAfter(access.sync());
}

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

                  }
    append(access, loadOffset, framePushed());

    memoryBarrierAfter(access.sync());
}

void
MacroAssembler::wasmLoadI64(const wasm::MemoryAccessDesc& access, Operand srcAddr, Register64 out)
{

            

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

              }

void
MacroAssembler::wasmLoadI64(const wasm::MemoryAccessDesc& access, Operand srcAddr, Register64 out)
{
    // Atomic i64 load must use lock_cmpxchg8b.
    MOZ_ASSERT_IF(access.isAtomic(), access.byteSize() <= 4);
    MOZ_ASSERT(!access.isSimd());
    MOZ_ASSERT(srcAddr.kind() == Operand::MEM_REG_DISP || srcAddr.kind() == Operand::MEM_SCALE);

            

Reported by FlawFinder.