The following issues were found

src/third_party/wiredtiger/test/suite/test_alter02.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 sys, wiredtiger, wttest
from wtscenario import make_scenarios

# test_alter02.py
#    Smoke-test the session alter operations.
class test_alter02(wttest.WiredTigerTestCase):

            

Reported by Pylint.

Unused import sys
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 sys, wiredtiger, wttest
from wtscenario import make_scenarios

# test_alter02.py
#    Smoke-test the session alter operations.
class test_alter02(wttest.WiredTigerTestCase):

            

Reported by Pylint.

Unused argument 'dir'
Error

Line: 69 Column: 35

                  scenarios = make_scenarios(conn_log, types, tables, reopen)

    # This test varies the log setting.  Override the standard methods.
    def setUpConnectionOpen(self, dir):
        return None
    def setUpSessionOpen(self, conn):
        return None
    def ConnectionOpen(self):
        self.home = '.'

            

Reported by Pylint.

Parameters differ from overridden 'setUpConnectionOpen' method
Error

Line: 69 Column: 5

                  scenarios = make_scenarios(conn_log, types, tables, reopen)

    # This test varies the log setting.  Override the standard methods.
    def setUpConnectionOpen(self, dir):
        return None
    def setUpSessionOpen(self, conn):
        return None
    def ConnectionOpen(self):
        self.home = '.'

            

Reported by Pylint.

Redefining built-in 'dir'
Error

Line: 69 Column: 35

                  scenarios = make_scenarios(conn_log, types, tables, reopen)

    # This test varies the log setting.  Override the standard methods.
    def setUpConnectionOpen(self, dir):
        return None
    def setUpSessionOpen(self, conn):
        return None
    def ConnectionOpen(self):
        self.home = '.'

            

Reported by Pylint.

Attribute 'home' defined outside __init__
Error

Line: 74 Column: 9

                  def setUpSessionOpen(self, conn):
        return None
    def ConnectionOpen(self):
        self.home = '.'

        conn_params = 'create,log=(archive=false,file_max=100K,%s)' % self.uselog

        try:
            self.conn = wiredtiger.wiredtiger_open(self.home, conn_params)

            

Reported by Pylint.

Unused variable 'e'
Error

Line: 80 Column: 9

              
        try:
            self.conn = wiredtiger.wiredtiger_open(self.home, conn_params)
        except wiredtiger.WiredTigerError as e:
            print("Failed conn at '%s' with config '%s'" % (dir, conn_params))
        self.session = self.conn.open_session()

    # Verify the metadata string for this URI and that its setting in the
    # metadata file is correct.

            

Reported by Pylint.

Unused variable 'keys'
Error

Line: 116 Column: 13

                      count = 0
        while c.next() == 0:
            # lsn.file, lsn.offset, opcount
            keys = c.get_key()
            # txnid, rectype, optype, fileid, logrec_key, logrec_value
            values = c.get_value()
            if self.value.encode() in values[5]:     # logrec_value
                count += 1
            self.assertFalse(self.value2.encode() in values[5])

            

Reported by Pylint.

Attribute 'uselog' defined outside __init__
Error

Line: 138 Column: 13

              
        # Set up logging for the connection.
        if self.conncreate:
            self.uselog = 'enabled=true'
            conn_logged = 1
        else:
            self.uselog = 'enabled=false'
            conn_logged = 0
        self.ConnectionOpen()

            

Reported by Pylint.

Attribute 'uselog' defined outside __init__
Error

Line: 141 Column: 13

                          self.uselog = 'enabled=true'
            conn_logged = 1
        else:
            self.uselog = 'enabled=false'
            conn_logged = 0
        self.ConnectionOpen()

        # Set up logging for the table.
        if self.logcreate:

            

Reported by Pylint.

src/third_party/IntelRDFPMathLib20U1/LIBRARY/src/bid128_noncomp.c
29 issues
Shifting 32-bit value by 32 bits is undefined behaviour
Error

Line: 119 CWE codes: 758

                if (C1_hi == 0) {
    if (C1_lo >= 0x0020000000000000ull) {	// x >= 2^53
      // split the 64-bit value in two 32-bit halves to avoid rounding errors
	tmp1.d = (double) (C1_lo >> 32);	// exact conversion
	x_nr_bits =
	  33 + ((((unsigned int) (tmp1.ui64 >> 52)) & 0x7ff) - 0x3ff);
    } else {	// if x < 2^53
      tmp1.d = (double) C1_lo;	// exact conversion
      x_nr_bits =

            

Reported by Cppcheck.

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

Line: 121 CWE codes: 758

                    // split the 64-bit value in two 32-bit halves to avoid rounding errors
	tmp1.d = (double) (C1_lo >> 32);	// exact conversion
	x_nr_bits =
	  33 + ((((unsigned int) (tmp1.ui64 >> 52)) & 0x7ff) - 0x3ff);
    } else {	// if x < 2^53
      tmp1.d = (double) C1_lo;	// exact conversion
      x_nr_bits =
	1 + ((((unsigned int) (tmp1.ui64 >> 52)) & 0x7ff) - 0x3ff);
    }

            

Reported by Cppcheck.

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

Line: 125 CWE codes: 758

                  } else {	// if x < 2^53
      tmp1.d = (double) C1_lo;	// exact conversion
      x_nr_bits =
	1 + ((((unsigned int) (tmp1.ui64 >> 52)) & 0x7ff) - 0x3ff);
    }
  } else {	// C1_hi != 0 => nr. bits = 64 + nr_bits (C1_hi)
    tmp1.d = (double) C1_hi;	// exact conversion
    x_nr_bits =
      65 + ((((unsigned int) (tmp1.ui64 >> 52)) & 0x7ff) - 0x3ff);

            

Reported by Cppcheck.

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

Line: 130 CWE codes: 758

                } else {	// C1_hi != 0 => nr. bits = 64 + nr_bits (C1_hi)
    tmp1.d = (double) C1_hi;	// exact conversion
    x_nr_bits =
      65 + ((((unsigned int) (tmp1.ui64 >> 52)) & 0x7ff) - 0x3ff);
  }
  q = bid_nr_digits[x_nr_bits - 1].digits;
  if (q == 0) {
    q = bid_nr_digits[x_nr_bits - 1].digits1;
    if (C1_hi > bid_nr_digits[x_nr_bits - 1].threshold_hi ||

            

Reported by Cppcheck.

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

Line: 140 CWE codes: 758

              	 C1_lo >= bid_nr_digits[x_nr_bits - 1].threshold_lo))
      q++;
  }
  exp = (int) (x_exp >> 49) - 6176;
  // test for subnormal values of x
  if (exp + q <= -6143) {
    res = 0;
    BID_RETURN (res);
  } else {

            

Reported by Cppcheck.

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

Line: 199 CWE codes: 758

                if (C1_hi == 0) {
    if (C1_lo >= 0x0020000000000000ull) {	// x >= 2^53
      // split the 64-bit value in two 32-bit halves to avoid rounding errors
	tmp1.d = (double) (C1_lo >> 32);	// exact conversion
	x_nr_bits =
	  33 + ((((unsigned int) (tmp1.ui64 >> 52)) & 0x7ff) - 0x3ff);
    } else {	// if x < 2^53
      tmp1.d = (double) C1_lo;	// exact conversion
      x_nr_bits =

            

Reported by Cppcheck.

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

Line: 201 CWE codes: 758

                    // split the 64-bit value in two 32-bit halves to avoid rounding errors
	tmp1.d = (double) (C1_lo >> 32);	// exact conversion
	x_nr_bits =
	  33 + ((((unsigned int) (tmp1.ui64 >> 52)) & 0x7ff) - 0x3ff);
    } else {	// if x < 2^53
      tmp1.d = (double) C1_lo;	// exact conversion
      x_nr_bits =
	1 + ((((unsigned int) (tmp1.ui64 >> 52)) & 0x7ff) - 0x3ff);
    }

            

Reported by Cppcheck.

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

Line: 205 CWE codes: 758

                  } else {	// if x < 2^53
      tmp1.d = (double) C1_lo;	// exact conversion
      x_nr_bits =
	1 + ((((unsigned int) (tmp1.ui64 >> 52)) & 0x7ff) - 0x3ff);
    }
  } else {	// C1_hi != 0 => nr. bits = 64 + nr_bits (C1_hi)
    tmp1.d = (double) C1_hi;	// exact conversion
    x_nr_bits =
      65 + ((((unsigned int) (tmp1.ui64 >> 52)) & 0x7ff) - 0x3ff);

            

Reported by Cppcheck.

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

Line: 210 CWE codes: 758

                } else {	// C1_hi != 0 => nr. bits = 64 + nr_bits (C1_hi)
    tmp1.d = (double) C1_hi;	// exact conversion
    x_nr_bits =
      65 + ((((unsigned int) (tmp1.ui64 >> 52)) & 0x7ff) - 0x3ff);
  }
  q = bid_nr_digits[x_nr_bits - 1].digits;
  if (q == 0) {
    q = bid_nr_digits[x_nr_bits - 1].digits1;
    if (C1_hi > bid_nr_digits[x_nr_bits - 1].threshold_hi ||

            

Reported by Cppcheck.

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

Line: 220 CWE codes: 758

              	 C1_lo >= bid_nr_digits[x_nr_bits - 1].threshold_lo))
      q++;
  }
  exp = (int) (x_exp >> 49) - 6176;
  // test for subnormal values of x
  if (exp + q <= -6143) {
    res = 1;
  } else {
    res = 0;

            

Reported by Cppcheck.

src/third_party/variant-1.4.0/support/vs.py
29 issues
Instance of 'dict' has no 'itervalues' member
Error

Line: 51 Column: 31

                  os.chdir('..')

pprint.pprint(result)
exit(any(status != 0 for d in result.itervalues() for status in d.itervalues()))

            

Reported by Pylint.

Missing module docstring
Error

Line: 1 Column: 1

              # MPark.Variant
#
# Copyright Michael Park, 2015-2017
#
# Distributed under the Boost Software License, Version 1.0.
# (See accompanying file LICENSE.md or copy at http://boost.org/LICENSE_1_0.txt)

import os
import pprint

            

Reported by Pylint.

Consider possible security implications associated with subprocess module.
Security blacklist

Line: 10
Suggestion: https://bandit.readthedocs.io/en/latest/blacklists/blacklist_imports.html#b404-import-subprocess

              
import os
import pprint
import subprocess

result = {}

std_flags = os.getenv('STDFLAGS')
for std_flag in std_flags.split() if std_flags is not None else ['']:

            

Reported by Bandit.

Bad indentation. Found 2 spaces, expected 4
Style

Line: 16 Column: 1

              
std_flags = os.getenv('STDFLAGS')
for std_flag in std_flags.split() if std_flags is not None else ['']:
  os.environ['CXXFLAGS'] = std_flag
  for exceptions in ['OFF', 'ON']:
    config = '{}-{}'.format(filter(str.isalnum, std_flag), exceptions)
    build_dir = 'build-{}'.format(config)
    os.mkdir(build_dir)
    os.chdir(build_dir)

            

Reported by Pylint.

Bad indentation. Found 2 spaces, expected 4
Style

Line: 17 Column: 1

              std_flags = os.getenv('STDFLAGS')
for std_flag in std_flags.split() if std_flags is not None else ['']:
  os.environ['CXXFLAGS'] = std_flag
  for exceptions in ['OFF', 'ON']:
    config = '{}-{}'.format(filter(str.isalnum, std_flag), exceptions)
    build_dir = 'build-{}'.format(config)
    os.mkdir(build_dir)
    os.chdir(build_dir)
    result[config] = {

            

Reported by Pylint.

Bad indentation. Found 4 spaces, expected 8
Style

Line: 18 Column: 1

              for std_flag in std_flags.split() if std_flags is not None else ['']:
  os.environ['CXXFLAGS'] = std_flag
  for exceptions in ['OFF', 'ON']:
    config = '{}-{}'.format(filter(str.isalnum, std_flag), exceptions)
    build_dir = 'build-{}'.format(config)
    os.mkdir(build_dir)
    os.chdir(build_dir)
    result[config] = {
        'Configure': None,

            

Reported by Pylint.

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

Line: 18 Column: 5

              for std_flag in std_flags.split() if std_flags is not None else ['']:
  os.environ['CXXFLAGS'] = std_flag
  for exceptions in ['OFF', 'ON']:
    config = '{}-{}'.format(filter(str.isalnum, std_flag), exceptions)
    build_dir = 'build-{}'.format(config)
    os.mkdir(build_dir)
    os.chdir(build_dir)
    result[config] = {
        'Configure': None,

            

Reported by Pylint.

Bad indentation. Found 4 spaces, expected 8
Style

Line: 19 Column: 1

                os.environ['CXXFLAGS'] = std_flag
  for exceptions in ['OFF', 'ON']:
    config = '{}-{}'.format(filter(str.isalnum, std_flag), exceptions)
    build_dir = 'build-{}'.format(config)
    os.mkdir(build_dir)
    os.chdir(build_dir)
    result[config] = {
        'Configure': None,
        'Build-Debug': None,

            

Reported by Pylint.

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

Line: 19 Column: 5

                os.environ['CXXFLAGS'] = std_flag
  for exceptions in ['OFF', 'ON']:
    config = '{}-{}'.format(filter(str.isalnum, std_flag), exceptions)
    build_dir = 'build-{}'.format(config)
    os.mkdir(build_dir)
    os.chdir(build_dir)
    result[config] = {
        'Configure': None,
        'Build-Debug': None,

            

Reported by Pylint.

Bad indentation. Found 4 spaces, expected 8
Style

Line: 20 Column: 1

                for exceptions in ['OFF', 'ON']:
    config = '{}-{}'.format(filter(str.isalnum, std_flag), exceptions)
    build_dir = 'build-{}'.format(config)
    os.mkdir(build_dir)
    os.chdir(build_dir)
    result[config] = {
        'Configure': None,
        'Build-Debug': None,
        'Build-Release': None,

            

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/boost/boost/asio/impl/read.hpp
29 issues
read - Check buffer boundaries if used in a loop including recursive loops
Security

Line: 67 Column: 13 CWE codes: 120 20

              
template <typename SyncReadStream, typename MutableBufferSequence,
    typename CompletionCondition>
std::size_t read(SyncReadStream& s, const MutableBufferSequence& buffers,
    CompletionCondition completion_condition, boost::system::error_code& ec,
    typename constraint<
      is_mutable_buffer_sequence<MutableBufferSequence>::value
    >::type)
{

            

Reported by FlawFinder.

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

Line: 79 Column: 20 CWE codes: 120 20

              }

template <typename SyncReadStream, typename MutableBufferSequence>
inline std::size_t read(SyncReadStream& s, const MutableBufferSequence& buffers,
    typename constraint<
      is_mutable_buffer_sequence<MutableBufferSequence>::value
    >::type)
{
  boost::system::error_code ec;

            

Reported by FlawFinder.

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

Line: 85 Column: 35 CWE codes: 120 20

                  >::type)
{
  boost::system::error_code ec;
  std::size_t bytes_transferred = read(s, buffers, transfer_all(), ec);
  boost::asio::detail::throw_error(ec, "read");
  return bytes_transferred;
}

template <typename SyncReadStream, typename MutableBufferSequence>

            

Reported by FlawFinder.

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

Line: 91 Column: 20 CWE codes: 120 20

              }

template <typename SyncReadStream, typename MutableBufferSequence>
inline std::size_t read(SyncReadStream& s, const MutableBufferSequence& buffers,
    boost::system::error_code& ec,
    typename constraint<
      is_mutable_buffer_sequence<MutableBufferSequence>::value
    >::type)
{

            

Reported by FlawFinder.

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

Line: 97 Column: 10 CWE codes: 120 20

                    is_mutable_buffer_sequence<MutableBufferSequence>::value
    >::type)
{
  return read(s, buffers, transfer_all(), ec);
}

template <typename SyncReadStream, typename MutableBufferSequence,
    typename CompletionCondition>
inline std::size_t read(SyncReadStream& s, const MutableBufferSequence& buffers,

            

Reported by FlawFinder.

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

Line: 102 Column: 20 CWE codes: 120 20

              
template <typename SyncReadStream, typename MutableBufferSequence,
    typename CompletionCondition>
inline std::size_t read(SyncReadStream& s, const MutableBufferSequence& buffers,
    CompletionCondition completion_condition,
    typename constraint<
      is_mutable_buffer_sequence<MutableBufferSequence>::value
    >::type)
{

            

Reported by FlawFinder.

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

Line: 109 Column: 35 CWE codes: 120 20

                  >::type)
{
  boost::system::error_code ec;
  std::size_t bytes_transferred = read(s, buffers,
      BOOST_ASIO_MOVE_CAST(CompletionCondition)(completion_condition), ec);
  boost::asio::detail::throw_error(ec, "read");
  return bytes_transferred;
}


            

Reported by FlawFinder.

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

Line: 119 Column: 13 CWE codes: 120 20

              
template <typename SyncReadStream, typename DynamicBuffer_v1,
    typename CompletionCondition>
std::size_t read(SyncReadStream& s,
    BOOST_ASIO_MOVE_ARG(DynamicBuffer_v1) buffers,
    CompletionCondition completion_condition, boost::system::error_code& ec,
    typename constraint<
      is_dynamic_buffer_v1<typename decay<DynamicBuffer_v1>::type>::value
    >::type,

            

Reported by FlawFinder.

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

Line: 154 Column: 20 CWE codes: 120 20

              }

template <typename SyncReadStream, typename DynamicBuffer_v1>
inline std::size_t read(SyncReadStream& s,
    BOOST_ASIO_MOVE_ARG(DynamicBuffer_v1) buffers,
    typename constraint<
      is_dynamic_buffer_v1<typename decay<DynamicBuffer_v1>::type>::value
    >::type,
    typename constraint<

            

Reported by FlawFinder.

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

Line: 164 Column: 35 CWE codes: 120 20

                  >::type)
{
  boost::system::error_code ec;
  std::size_t bytes_transferred = read(s,
      BOOST_ASIO_MOVE_CAST(DynamicBuffer_v1)(buffers), transfer_all(), ec);
  boost::asio::detail::throw_error(ec, "read");
  return bytes_transferred;
}


            

Reported by FlawFinder.

src/third_party/variant-1.4.0/support/ninja.py
29 issues
Instance of 'dict' has no 'itervalues' member
Error

Line: 46 Column: 31

                    os.chdir('..')

pprint.pprint(result)
exit(any(status != 0 for d in result.itervalues() for status in d.itervalues()))

            

Reported by Pylint.

Missing module docstring
Error

Line: 1 Column: 1

              # MPark.Variant
#
# Copyright Michael Park, 2015-2017
#
# Distributed under the Boost Software License, Version 1.0.
# (See accompanying file LICENSE.md or copy at http://boost.org/LICENSE_1_0.txt)

import os
import pprint

            

Reported by Pylint.

Consider possible security implications associated with subprocess module.
Security blacklist

Line: 10
Suggestion: https://bandit.readthedocs.io/en/latest/blacklists/blacklist_imports.html#b404-import-subprocess

              
import os
import pprint
import subprocess

result = {}

std_flags = os.getenv('STDFLAGS')
for std_flag in std_flags.split() if std_flags is not None else ['']:

            

Reported by Bandit.

Bad indentation. Found 2 spaces, expected 4
Style

Line: 16 Column: 1

              
std_flags = os.getenv('STDFLAGS')
for std_flag in std_flags.split() if std_flags is not None else ['']:
  os.environ['CXXFLAGS'] = std_flag
  for exceptions in ['OFF', 'ON']:
    for build_type in ['Debug', 'Release']:
      config = '{}-{}-{}'.format(
          filter(str.isalnum, std_flag), exceptions, build_type)
      build_dir = 'build-{}'.format(config)

            

Reported by Pylint.

Bad indentation. Found 2 spaces, expected 4
Style

Line: 17 Column: 1

              std_flags = os.getenv('STDFLAGS')
for std_flag in std_flags.split() if std_flags is not None else ['']:
  os.environ['CXXFLAGS'] = std_flag
  for exceptions in ['OFF', 'ON']:
    for build_type in ['Debug', 'Release']:
      config = '{}-{}-{}'.format(
          filter(str.isalnum, std_flag), exceptions, build_type)
      build_dir = 'build-{}'.format(config)
      os.mkdir(build_dir)

            

Reported by Pylint.

Bad indentation. Found 4 spaces, expected 8
Style

Line: 18 Column: 1

              for std_flag in std_flags.split() if std_flags is not None else ['']:
  os.environ['CXXFLAGS'] = std_flag
  for exceptions in ['OFF', 'ON']:
    for build_type in ['Debug', 'Release']:
      config = '{}-{}-{}'.format(
          filter(str.isalnum, std_flag), exceptions, build_type)
      build_dir = 'build-{}'.format(config)
      os.mkdir(build_dir)
      os.chdir(build_dir)

            

Reported by Pylint.

Bad indentation. Found 6 spaces, expected 12
Style

Line: 19 Column: 1

                os.environ['CXXFLAGS'] = std_flag
  for exceptions in ['OFF', 'ON']:
    for build_type in ['Debug', 'Release']:
      config = '{}-{}-{}'.format(
          filter(str.isalnum, std_flag), exceptions, build_type)
      build_dir = 'build-{}'.format(config)
      os.mkdir(build_dir)
      os.chdir(build_dir)
      result[config] = { 'Configure': None, 'Build': None, 'Test': None }

            

Reported by Pylint.

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

Line: 19 Column: 7

                os.environ['CXXFLAGS'] = std_flag
  for exceptions in ['OFF', 'ON']:
    for build_type in ['Debug', 'Release']:
      config = '{}-{}-{}'.format(
          filter(str.isalnum, std_flag), exceptions, build_type)
      build_dir = 'build-{}'.format(config)
      os.mkdir(build_dir)
      os.chdir(build_dir)
      result[config] = { 'Configure': None, 'Build': None, 'Test': None }

            

Reported by Pylint.

Bad indentation. Found 6 spaces, expected 12
Style

Line: 21 Column: 1

                  for build_type in ['Debug', 'Release']:
      config = '{}-{}-{}'.format(
          filter(str.isalnum, std_flag), exceptions, build_type)
      build_dir = 'build-{}'.format(config)
      os.mkdir(build_dir)
      os.chdir(build_dir)
      result[config] = { 'Configure': None, 'Build': None, 'Test': None }

      tests = os.environ['TESTS'].split()

            

Reported by Pylint.

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

Line: 21 Column: 7

                  for build_type in ['Debug', 'Release']:
      config = '{}-{}-{}'.format(
          filter(str.isalnum, std_flag), exceptions, build_type)
      build_dir = 'build-{}'.format(config)
      os.mkdir(build_dir)
      os.chdir(build_dir)
      result[config] = { 'Configure': None, 'Build': None, 'Test': None }

      tests = os.environ['TESTS'].split()

            

Reported by Pylint.

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

Line: 34 Column: 1

              #

from suite_subprocess import suite_subprocess
import wiredtiger, wttest
from wtscenario import make_scenarios

class test_timestamp11(wttest.WiredTigerTestCase, suite_subprocess):
    session_config = 'isolation=snapshot'


            

Reported by Pylint.

Unused import wiredtiger
Error

Line: 34 Column: 1

              #

from suite_subprocess import suite_subprocess
import wiredtiger, wttest
from wtscenario import make_scenarios

class test_timestamp11(wttest.WiredTigerTestCase, suite_subprocess):
    session_config = 'isolation=snapshot'


            

Reported by Pylint.

Using deprecated method assertEquals()
Error

Line: 98 Column: 9

              
        c = self.session.open_cursor(uri)
        self.session.begin_transaction()
        self.assertEquals(c[key], 'value2')
        self.assertEquals(c[key2], 'valueNOTS')
        self.session.commit_transaction()
        c.close()

        c = self.session.open_cursor(uri)

            

Reported by Pylint.

Using deprecated method assertEquals()
Error

Line: 99 Column: 9

                      c = self.session.open_cursor(uri)
        self.session.begin_transaction()
        self.assertEquals(c[key], 'value2')
        self.assertEquals(c[key2], 'valueNOTS')
        self.session.commit_transaction()
        c.close()

        c = self.session.open_cursor(uri)
        self.session.begin_transaction('read_timestamp=' + stable_ts)

            

Reported by Pylint.

Using deprecated method assertEquals()
Error

Line: 105 Column: 9

              
        c = self.session.open_cursor(uri)
        self.session.begin_transaction('read_timestamp=' + stable_ts)
        self.assertEquals(c[key], 'value2')
        self.assertEquals(c[key2], 'valueNOTS')
        self.session.commit_transaction()
        c.close()

        #

            

Reported by Pylint.

Using deprecated method assertEquals()
Error

Line: 106 Column: 9

                      c = self.session.open_cursor(uri)
        self.session.begin_transaction('read_timestamp=' + stable_ts)
        self.assertEquals(c[key], 'value2')
        self.assertEquals(c[key2], 'valueNOTS')
        self.session.commit_transaction()
        c.close()

        #
        # Repeat but swapping the keys using or not using timestamps.

            

Reported by Pylint.

Using deprecated method assertEquals()
Error

Line: 132 Column: 9

                      # Without a timestamp. We should see the latest value for each.
        c = self.session.open_cursor(uri)
        self.session.begin_transaction()
        self.assertEquals(c[key], 'valueNOTS')
        self.assertEquals(c[key2], 'value5')
        self.session.commit_transaction()
        c.close()

        # With timestamp 2. Both non-timestamped values override the original

            

Reported by Pylint.

Using deprecated method assertEquals()
Error

Line: 133 Column: 9

                      c = self.session.open_cursor(uri)
        self.session.begin_transaction()
        self.assertEquals(c[key], 'valueNOTS')
        self.assertEquals(c[key2], 'value5')
        self.session.commit_transaction()
        c.close()

        # With timestamp 2. Both non-timestamped values override the original
        # value at timestamp 2.

            

Reported by Pylint.

Using deprecated method assertEquals()
Error

Line: 141 Column: 9

                      # value at timestamp 2.
        c = self.session.open_cursor(uri)
        self.session.begin_transaction('read_timestamp=' + stable_ts)
        self.assertEquals(c[key], 'valueNOTS')
        self.assertEquals(c[key2], 'valueNOTS')
        self.session.commit_transaction()
        c.close()

        # With timestamp 5. We rolled back the first one and never re-inserted

            

Reported by Pylint.

Using deprecated method assertEquals()
Error

Line: 142 Column: 9

                      c = self.session.open_cursor(uri)
        self.session.begin_transaction('read_timestamp=' + stable_ts)
        self.assertEquals(c[key], 'valueNOTS')
        self.assertEquals(c[key2], 'valueNOTS')
        self.session.commit_transaction()
        c.close()

        # With timestamp 5. We rolled back the first one and never re-inserted
        # one at that timestamp and inserted without a timestamp. For the second

            

Reported by Pylint.

src/third_party/wiredtiger/test/suite/test_backup14.py
29 issues
Starting a process with a shell, possible injection detected, security issue.
Security injection

Line: 129
Suggestion: https://bandit.readthedocs.io/en/latest/plugins/b605_start_process_with_a_shell.html

                      table_list = 'tablelist.txt'
        # Assert if the dropped table (table:main) exists in the incremental folder.
        self.runWt(['-R', '-h', self.home, 'list'], outfilename=table_list)
        ret = os.system("grep " + self.uri + " " + table_list)
        self.assertNotEqual(ret, 0, self.uri + " dropped, but table exists in " + self.home)
        self.setup_directories(self.home_incr, self.home_full)

    #
    # This function will create previously dropped table uri (table:main) and add different content to

            

Reported by Bandit.

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
import os, shutil
from wtbackup import backup_base
from wtdataset import simple_key
from wtscenario import make_scenarios
import glob

            

Reported by Pylint.

Undefined variable 'wttest'
Error

Line: 195 Column: 5

                      self.insert_bulk_data()

if __name__ == '__main__':
    wttest.run()

            

Reported by Pylint.

Unused 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
import os, shutil
from wtbackup import backup_base
from wtdataset import simple_key
from wtscenario import make_scenarios
import glob

            

Reported by Pylint.

Unused import shutil
Error

Line: 30 Column: 1

              # OTHER DEALINGS IN THE SOFTWARE.

import wiredtiger
import os, shutil
from wtbackup import backup_base
from wtdataset import simple_key
from wtscenario import make_scenarios
import glob


            

Reported by Pylint.

Unused simple_key imported from wtdataset
Error

Line: 32 Column: 1

              import wiredtiger
import os, shutil
from wtbackup import backup_base
from wtdataset import simple_key
from wtscenario import make_scenarios
import glob

# test_backup14.py
# Test cursor backup with a block-based incremental cursor.

            

Reported by Pylint.

Unused make_scenarios imported from wtscenario
Error

Line: 33 Column: 1

              import os, shutil
from wtbackup import backup_base
from wtdataset import simple_key
from wtscenario import make_scenarios
import glob

# test_backup14.py
# Test cursor backup with a block-based incremental cursor.
class test_backup14(backup_base):

            

Reported by Pylint.

Unused import glob
Error

Line: 34 Column: 1

              from wtbackup import backup_base
from wtdataset import simple_key
from wtscenario import make_scenarios
import glob

# test_backup14.py
# Test cursor backup with a block-based incremental cursor.
class test_backup14(backup_base):
    conn_config='cache_size=1G,log=(enabled,file_max=100K)'

            

Reported by Pylint.

Using deprecated method assertEquals()
Error

Line: 74 Column: 17

                              num = j + (i * self.nops)
                key = self.bigkey + str(num)
                c.set_key(key)
                self.assertEquals(c.remove(), 0)
        c.close()
        # Increase the counter so that later backups have unique ids.
        self.bkup_id += 1

    #

            

Reported by Pylint.

Attribute 'home' defined outside __init__
Error

Line: 173 Column: 9

              
    def test_backup14(self):
        os.mkdir(self.bkp_home)
        self.home = self.bkp_home
        self.session.create(self.uri, "key_format=S,value_format=S")

        self.setup_directories(self.home_incr, self.home_full)

        self.pr('*** Add data, checkpoint, take backups and validate ***')

            

Reported by Pylint.

src/third_party/scons-3.1.2/scons-local-3.1.2/SCons/Platform/__init__.py
29 issues
Module 'os' has no '_osType' member
Error

Line: 69 Column: 18

                  """
    osname = os.name
    if osname == 'java':
        osname = os._osType
    if osname == 'posix':
        if sys.platform == 'cygwin':
            return 'cygwin'
        elif sys.platform.find('irix') != -1:
            return 'irix'

            

Reported by Pylint.

Module 'zipimport' has no 'zipimporter' member
Error

Line: 109 Column: 32

                          except ImportError:
                try:
                    import zipimport
                    importer = zipimport.zipimporter( sys.modules['SCons.Platform'].__path__[0] )
                    mod = importer.load_module(full_name)
                except ImportError:
                    raise SCons.Errors.UserError("No platform named '%s'" % name)
            setattr(SCons.Platform, name, mod)
    return sys.modules[full_name]

            

Reported by Pylint.

Access to a protected member _osType of a client class
Error

Line: 69 Column: 18

                  """
    osname = os.name
    if osname == 'java':
        osname = os._osType
    if osname == 'posix':
        if sys.platform == 'cygwin':
            return 'cygwin'
        elif sys.platform.find('irix') != -1:
            return 'irix'

            

Reported by Pylint.

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

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

                  full_name = 'SCons.Platform.' + name
    if full_name not in sys.modules:
        if os.name == 'java':
            eval(full_name)
        else:
            try:
                # the specific platform module is a relative import
                mod = importlib.import_module("." + name, __name__)
            except ImportError:

            

Reported by Bandit.

Use of eval
Error

Line: 101 Column: 13

                  full_name = 'SCons.Platform.' + name
    if full_name not in sys.modules:
        if os.name == 'java':
            eval(full_name)
        else:
            try:
                # the specific platform module is a relative import
                mod = importlib.import_module("." + name, __name__)
            except ImportError:

            

Reported by Pylint.

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

Line: 112 Column: 21

                                  importer = zipimport.zipimporter( sys.modules['SCons.Platform'].__path__[0] )
                    mod = importer.load_module(full_name)
                except ImportError:
                    raise SCons.Errors.UserError("No platform named '%s'" % name)
            setattr(SCons.Platform, name, mod)
    return sys.modules[full_name]


def DefaultToolList(platform, env):

            

Reported by Pylint.

XXX Using the SCons.Action.print_actions value directly
Error

Line: 233 Column: 3

                      os.write(fd, bytearray(join_char.join(args) + "\n",'utf-8'))
        os.close(fd)

        # XXX Using the SCons.Action.print_actions value directly
        # like this is bogus, but expedient.  This class should
        # really be rewritten as an Action that defines the
        # __call__() and strfunction() methods and lets the
        # normal action-execution logic handle whether or not to
        # print/execute the action.  The problem, though, is all

            

Reported by Pylint.

Access to a protected member _ActionAction of a client class
Error

Line: 279 Column: 22

              
        # use the default action cmd line print if user did not supply one
        if not print_func:
            action = SCons.Action._ActionAction()
            action.print_cmd_line(cmdstr, target, source, env)
        else:
            print_func(cmdstr, target, source, env)



            

Reported by Pylint.

Line too long (123/100)
Error

Line: 46 Column: 1

              #
from __future__ import print_function

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

import SCons.compat

import importlib
import os

            

Reported by Pylint.

standard import "import importlib" should be placed before "import SCons.compat"
Error

Line: 50 Column: 1

              
import SCons.compat

import importlib
import os
import sys
import tempfile

import SCons.Errors

            

Reported by Pylint.

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

Line: 36 Column: 1

              import SCons.Errors
import SCons.Util

from . import common

debug = common.debug

# SDK Checks. This is of course a mess as everything else on MS platforms. Here
# is what we do to detect the SDK:

            

Reported by Pylint.

Instance of 'SDKDefinition' has no 'hkey_data' member
Error

Line: 78 Column: 32

                          debug('find_sdk_dir(): can not read registry')
            return None

        hkey = self.HKEY_FMT % self.hkey_data
        debug('find_sdk_dir(): checking registry:{}'.format(hkey))

        try:
            sdk_dir = common.read_reg(hkey)
        except SCons.Util.WinError as e:

            

Reported by Pylint.

Instance of 'SDKDefinition' has no 'HKEY_FMT' member
Error

Line: 78 Column: 16

                          debug('find_sdk_dir(): can not read registry')
            return None

        hkey = self.HKEY_FMT % self.hkey_data
        debug('find_sdk_dir(): checking registry:{}'.format(hkey))

        try:
            sdk_dir = common.read_reg(hkey)
        except SCons.Util.WinError as e:

            

Reported by Pylint.

Instance of 'SDKDefinition' has no 'sanity_check_file' member
Error

Line: 93 Column: 37

                          debug('find_sdk_dir():  {} not on file system'.format(sdk_dir))
            return None

        ftc = os.path.join(sdk_dir, self.sanity_check_file)
        if not os.path.exists(ftc):
            debug("find_sdk_dir(): sanity check {} not found".format(ftc))
            return None

        return sdk_dir

            

Reported by Pylint.

Instance of 'SDKDefinition' has no 'vc_setup_scripts' member
Error

Line: 124 Column: 14

                      debug("get_sdk_vc_script():arch_string:%s host_arch:%s target_arch:%s"%(arch_string,
                                                           host_arch,
                                                           target_arch))
        file=self.vc_setup_scripts.get(arch_string,None)
        debug("get_sdk_vc_script():file:%s"%file)
        return file

class WindowsSDK(SDKDefinition):
    """

            

Reported by Pylint.

Instance of 'PlatformSDK' has no 'uuid' member
Error

Line: 144 Column: 26

                  HKEY_FMT = r'Software\Microsoft\MicrosoftSDK\InstalledSDKS\%s\Install Dir'
    def __init__(self, *args, **kw):
        SDKDefinition.__init__(self, *args, **kw)
        self.hkey_data = self.uuid

#
# The list of VC initialization scripts installed by the SDK
# These should be tried if the vcvarsall.bat TARGET_ARCH fails
preSDK61VCSetupScripts = { 'x86'      : r'bin\vcvars32.bat',

            

Reported by Pylint.

Attempted relative import beyond top-level package
Error

Line: 375 Column: 9

                          debug('mssdk_setup_env thinks msvs_version is None')
            return
        msvs_version = env.subst(msvs_version)
        from . import vs
        msvs = vs.get_vs_by_version(msvs_version)
        debug('mssdk_setup_env:msvs is :%s'%msvs)
        if not msvs:
            debug('mssdk_setup_env: no VS version detected, bailingout:%s'%msvs)
            return

            

Reported by Pylint.

Unused variable 'e'
Error

Line: 83 Column: 9

              
        try:
            sdk_dir = common.read_reg(hkey)
        except SCons.Util.WinError as e:
            debug('find_sdk_dir(): no SDK registry key {}'.format(repr(hkey)))
            return None

        debug('find_sdk_dir(): Trying SDK Dir: {}'.format(sdk_dir))


            

Reported by Pylint.

Attribute '_sdk_dir' defined outside __init__
Error

Line: 106 Column: 13

                          return self._sdk_dir
        except AttributeError:
            sdk_dir = self.find_sdk_dir()
            self._sdk_dir = sdk_dir
            return sdk_dir

    def get_sdk_vc_script(self,host_arch, target_arch):
        """ Return the script to initialize the VC compiler installed by SDK
        """

            

Reported by Pylint.

Using the global statement
Error

Line: 287 Column: 5

              InstalledSDKMap = None

def get_installed_sdks():
    global InstalledSDKList
    global InstalledSDKMap
    debug('get_installed_sdks()')
    if InstalledSDKList is None:
        InstalledSDKList = []
        InstalledSDKMap = {}

            

Reported by Pylint.