The following issues were found

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

Line: 186 CWE codes: 758

                if (C1.w[1] == 0) {
    if (C1.w[0] >= 0x0020000000000000ull) {     // x >= 2^53
      // split the 64-bit value in two 32-bit halves to avoid rounding errors
      tmp1.d = (double) (C1.w[0] >> 32);      // exact conversion
      x_nr_bits = 33 + ((((unsigned int) (tmp1.ui64 >> 52)) & 0x7ff) - 0x3ff);
    } else {                    // if x < 2^53
      tmp1.d = (double) C1.w[0];        // 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: 187 CWE codes: 758

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

            

Reported by Cppcheck.

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

Line: 190 CWE codes: 758

                    x_nr_bits = 33 + ((((unsigned int) (tmp1.ui64 >> 52)) & 0x7ff) - 0x3ff);
    } else {                    // if x < 2^53
      tmp1.d = (double) C1.w[0];        // exact conversion
      x_nr_bits = 1 + ((((unsigned int) (tmp1.ui64 >> 52)) & 0x7ff) - 0x3ff);
    }
  } else {                      // C1.w[1] != 0 => nr. bits = 64 + nr_bits (C1.w[1])
    tmp1.d = (double) C1.w[1];  // 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: 194 CWE codes: 758

                  }
  } else {                      // C1.w[1] != 0 => nr. bits = 64 + nr_bits (C1.w[1])
    tmp1.d = (double) C1.w[1];  // 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;

            

Reported by Cppcheck.

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

Line: 204 CWE codes: 758

                      || (C1.w[1] == bid_nr_digits[x_nr_bits - 1].threshold_hi && C1.w[0] >= bid_nr_digits[x_nr_bits - 1].threshold_lo))
      q++;
  }
  exp = (x_exp >> 49) - 6176;
  if (exp >= 0) {               // -exp <= 0
    // the argument is an integer already
    res.w[1] = x.w[1];
    res.w[0] = x.w[0];
    BID_RETURN(res);

            

Reported by Cppcheck.

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

Line: 236 CWE codes: 758

                    // kx = 10^(-x) = bid_ten2mk128[ind - 1]
      // C* = (C1 + 1/2 * 10^x) * 10^(-x)
      // the approximation of 10^(-x) was rounded up to 118 bits
      __mul_128x128_to_256(P256, C1, bid_ten2mk128[ind - 1]);
      // determine the value of res and fstar

      if (ind - 1 <= 2) {       // 0 <= ind - 1 <= 2 => shift = 0
        // redundant shift = bid_shiftright128[ind - 1]; // shift = 0
        res.w[1] = P256.w[3];

            

Reported by Cppcheck.

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

Line: 326 CWE codes: 758

                    // kx = 10^(-x) = bid_ten2mk128[ind - 1]
      // C* = (C1 + 1/2 * 10^x) * 10^(-x)
      // the approximation of 10^(-x) was rounded up to 118 bits
      __mul_128x128_to_256(P256, C1, bid_ten2mk128[ind - 1]);
      // the top Ex bits of 10^(-x) are T* = bid_ten2mk128trunc[ind], e.g.
      // if x=1, T*=bid_ten2mk128trunc[0]=0x19999999999999999999999999999999
      // if (0 < f* < 10^(-x)) then the result is a midpoint
      //   if floor(C*) is even then C* = floor(C*) - logical right
      //       shift; C* has p decimal digits, correct by Prop. 1)

            

Reported by Cppcheck.

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

Line: 392 CWE codes: 758

                    // kx = 10^(-x) = bid_ten2mk128[ind - 1]
      // C* = (C1 + 1/2 * 10^x) * 10^(-x)
      // the approximation of 10^(-x) was rounded up to 118 bits
      __mul_128x128_to_256(P256, C1, bid_ten2mk128[ind - 1]);
      if (ind - 1 <= 2) {       // 0 <= ind - 1 <= 2 => shift = 0
        res.w[1] = P256.w[3];
        res.w[0] = P256.w[2];
        // redundant fstar.w[3] = 0;
        // redundant fstar.w[2] = 0;

            

Reported by Cppcheck.

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

Line: 493 CWE codes: 758

                    // kx = 10^(-x) = bid_ten2mk128[ind - 1]
      // C* = C1 * 10^(-x)
      // the approximation of 10^(-x) was rounded up to 118 bits
      __mul_128x128_to_256(P256, C1, bid_ten2mk128[ind - 1]);
      if (ind - 1 <= 2) {       // 0 <= ind - 1 <= 2 => shift = 0
        res.w[1] = P256.w[3];
        res.w[0] = P256.w[2];
        // redundant fstar.w[3] = 0;
        // redundant fstar.w[2] = 0;

            

Reported by Cppcheck.

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

Line: 594 CWE codes: 758

                    // kx = 10^(-x) = bid_ten2mk128[ind - 1]
      // C* = (C1 + 1/2 * 10^x) * 10^(-x)
      // the approximation of 10^(-x) was rounded up to 118 bits
      __mul_128x128_to_256(P256, C1, bid_ten2mk128[ind - 1]);
      if (ind - 1 <= 2) {       // 0 <= ind - 1 <= 2 => shift = 0
        res.w[1] = P256.w[3];
        res.w[0] = P256.w[2];
        // redundant fstar.w[3] = 0;
        // redundant fstar.w[2] = 0;

            

Reported by Cppcheck.

src/third_party/wiredtiger/test/format/salvage.c
10 issues
system - This causes a new program to execute and is difficult to use safely
Security

Line: 96 Column: 16 CWE codes: 78
Suggestion: try using a library call that implements the same functionality if available

                  /*
     * Save a copy of the corrupted file so we can replay the salvage step as necessary.
     */
    if ((ret = system(copycmd)) != 0)
        testutil_die(ret, "salvage corrupt copy step failed");

    return (1);
}


            

Reported by FlawFinder.

system - This causes a new program to execute and is difficult to use safely
Security

Line: 135 Column: 16 CWE codes: 78
Suggestion: try using a library call that implements the same functionality if available

                  len = strlen(g.home) + strlen(SALVAGE_COPY_CMD) + 1;
    cmd = dmalloc(len);
    testutil_check(__wt_snprintf(cmd, len, SALVAGE_COPY_CMD, g.home));
    if ((ret = system(cmd)) != 0)
        testutil_die(ret, "salvage copy (\"%s\"), failed", cmd);
    free(cmd);

    /* Salvage, then verify. */
    wts_open(g.home, &conn, &session, true);

            

Reported by FlawFinder.

char - Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues
Security

Line: 43 Column: 5 CWE codes: 119 120
Suggestion: Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length

                  wt_off_t offset;
    size_t len, nw;
    int fd, ret;
    char copycmd[2 * 1024], path[1024];
    const char *smash;

    /*
     * If it's a single Btree file (not LSM), open the file, and corrupt roughly 2% of the file at a
     * random spot, including the beginning of the file and overlapping the end.

            

Reported by FlawFinder.

open - Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents?
Security

Line: 54 Column: 15 CWE codes: 362

                   * source is a table, we're looking for "wt.wt".
     */
    testutil_check(__wt_snprintf(path, sizeof(path), "%s/%s", g.home, WT_NAME));
    if ((fd = open(path, O_RDWR)) != -1) {
        testutil_check(__wt_snprintf(copycmd, sizeof(copycmd),
          "cp %s/%s %s/SALVAGE.copy/%s.corrupted", g.home, WT_NAME, g.home, WT_NAME));
        goto found;
    }
    testutil_check(__wt_snprintf(path, sizeof(path), "%s/%s.wt", g.home, WT_NAME));

            

Reported by FlawFinder.

open - Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents?
Security

Line: 60 Column: 15 CWE codes: 362

                      goto found;
    }
    testutil_check(__wt_snprintf(path, sizeof(path), "%s/%s.wt", g.home, WT_NAME));
    if ((fd = open(path, O_RDWR)) != -1) {
        testutil_check(__wt_snprintf(copycmd, sizeof(copycmd),
          "cp %s/%s.wt %s/SALVAGE.copy/%s.wt.corrupted", g.home, WT_NAME, g.home, WT_NAME));
        goto found;
    }
    return (0);

            

Reported by FlawFinder.

fopen - Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents?
Security

Line: 74 Column: 15 CWE codes: 362

                  offset = mmrand(NULL, 0, (u_int)sb.st_size);
    len = (size_t)(20 + (sb.st_size / 100) * 2);
    testutil_check(__wt_snprintf(path, sizeof(path), "%s/SALVAGE.corrupt", g.home));
    if ((fp = fopen(path, "w")) == NULL)
        testutil_die(errno, "salvage-corrupt: open: %s", path);
    (void)fprintf(fp, "salvage-corrupt: offset %" PRIuMAX ", length %" WT_SIZET_FMT "\n",
      (uintmax_t)offset, len);
    fclose_and_clear(&fp);


            

Reported by FlawFinder.

strlen - Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected)
Security

Line: 85 Column: 29 CWE codes: 126

              
    smash = "!!! memory corrupted by format to test salvage ";
    for (; len > 0; len -= nw) {
        nw = (size_t)(len > strlen(smash) ? strlen(smash) : len);
        if (write(fd, smash, nw) == -1)
            testutil_die(errno, "salvage-corrupt: write");
    }

    if (close(fd) == -1)

            

Reported by FlawFinder.

strlen - Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected)
Security

Line: 85 Column: 45 CWE codes: 126

              
    smash = "!!! memory corrupted by format to test salvage ";
    for (; len > 0; len -= nw) {
        nw = (size_t)(len > strlen(smash) ? strlen(smash) : len);
        if (write(fd, smash, nw) == -1)
            testutil_die(errno, "salvage-corrupt: write");
    }

    if (close(fd) == -1)

            

Reported by FlawFinder.

strlen - Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected)
Security

Line: 132 Column: 11 CWE codes: 126

                  track("salvage", 0ULL, NULL);

    /* Save a copy of the interesting files so we can replay the salvage step as necessary. */
    len = strlen(g.home) + strlen(SALVAGE_COPY_CMD) + 1;
    cmd = dmalloc(len);
    testutil_check(__wt_snprintf(cmd, len, SALVAGE_COPY_CMD, g.home));
    if ((ret = system(cmd)) != 0)
        testutil_die(ret, "salvage copy (\"%s\"), failed", cmd);
    free(cmd);

            

Reported by FlawFinder.

strlen - Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected)
Security

Line: 132 Column: 28 CWE codes: 126

                  track("salvage", 0ULL, NULL);

    /* Save a copy of the interesting files so we can replay the salvage step as necessary. */
    len = strlen(g.home) + strlen(SALVAGE_COPY_CMD) + 1;
    cmd = dmalloc(len);
    testutil_check(__wt_snprintf(cmd, len, SALVAGE_COPY_CMD, g.home));
    if ((ret = system(cmd)) != 0)
        testutil_die(ret, "salvage copy (\"%s\"), failed", cmd);
    free(cmd);

            

Reported by FlawFinder.

src/third_party/wiredtiger/test/suite/test_hs22.py
10 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 wtscenario import make_scenarios

# test_hs22.py
# Test the case that out of order timestamp
# update is followed by a tombstone.

            

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

# test_hs22.py
# Test the case that out of order timestamp
# update is followed by a tombstone.

            

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 wtscenario import make_scenarios

# test_hs22.py
# Test the case that out of order timestamp
# update is followed by a tombstone.

            

Reported by Pylint.

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

Line: 35 Column: 1

              # test_hs22.py
# Test the case that out of order timestamp
# update is followed by a tombstone.
class test_hs22(wttest.WiredTigerTestCase):
    conn_config = 'cache_size=50MB'
    session_config = 'isolation=snapshot'

    key_format_values = [
        ('column', dict(key_format='r', key1=1, key2=2)),

            

Reported by Pylint.

Missing class docstring
Error

Line: 35 Column: 1

              # test_hs22.py
# Test the case that out of order timestamp
# update is followed by a tombstone.
class test_hs22(wttest.WiredTigerTestCase):
    conn_config = 'cache_size=50MB'
    session_config = 'isolation=snapshot'

    key_format_values = [
        ('column', dict(key_format='r', key1=1, key2=2)),

            

Reported by Pylint.

Missing function or method docstring
Error

Line: 46 Column: 5

              
    scenarios = make_scenarios(key_format_values)

    def test_onpage_out_of_order_timestamp_update(self):
        uri = 'table:test_hs22'
        self.session.create(uri, 'key_format={},value_format=S'.format(self.key_format))
        cursor = self.session.open_cursor(uri)
        self.conn.set_timestamp(
            'oldest_timestamp=' + self.timestamp_str(1) + ',stable_timestamp=' + self.timestamp_str(1))

            

Reported by Pylint.

Line too long (103/100)
Error

Line: 51 Column: 1

                      self.session.create(uri, 'key_format={},value_format=S'.format(self.key_format))
        cursor = self.session.open_cursor(uri)
        self.conn.set_timestamp(
            'oldest_timestamp=' + self.timestamp_str(1) + ',stable_timestamp=' + self.timestamp_str(1))

        key1 = self.key1
        key2 = self.key2

        value1 = 'a'

            

Reported by Pylint.

Missing function or method docstring
Error

Line: 104 Column: 5

                      self.assertEqual(cursor[key1], value2)
        self.session.rollback_transaction()

    def test_out_of_order_timestamp_update_newer_than_tombstone(self):
        uri = 'table:test_hs22'
        self.session.create(uri, 'key_format={},value_format=S'.format(self.key_format))
        cursor = self.session.open_cursor(uri)
        self.conn.set_timestamp(
            'oldest_timestamp=' + self.timestamp_str(1) + ',stable_timestamp=' + self.timestamp_str(1))

            

Reported by Pylint.

Line too long (103/100)
Error

Line: 109 Column: 1

                      self.session.create(uri, 'key_format={},value_format=S'.format(self.key_format))
        cursor = self.session.open_cursor(uri)
        self.conn.set_timestamp(
            'oldest_timestamp=' + self.timestamp_str(1) + ',stable_timestamp=' + self.timestamp_str(1))

        key1 = self.key1
        key2 = self.key2

        value1 = 'a'

            

Reported by Pylint.

src/third_party/wiredtiger/test/suite/test_rollback_to_stable06.py
10 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.

from wiredtiger import stat
from wtdataset import SimpleDataSet
from wtscenario import make_scenarios
from test_rollback_to_stable01 import test_rollback_to_stable_base

# test_rollback_to_stable06.py

            

Reported by Pylint.

An attribute defined in wttest line 401 hides this method
Error

Line: 57 Column: 5

              
    scenarios = make_scenarios(key_format_values, in_memory_values, prepare_values)

    def conn_config(self):
        config = 'cache_size=50MB,statistics=(all)'
        if self.in_memory:
            config += ',in_memory=true'
        else:
            config += ',log=(enabled),in_memory=false'

            

Reported by Pylint.

Undefined variable 'wttest'
Error

Line: 126 Column: 5

                          self.assertGreaterEqual(upd_aborted + hs_removed + keys_removed, nrows * 4)

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

            

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.

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

Line: 37 Column: 1

              # test_rollback_to_stable06.py
# Test that rollback to stable removes all keys when the stable timestamp is earlier than
# all commit timestamps.
class test_rollback_to_stable06(test_rollback_to_stable_base):
    session_config = 'isolation=snapshot'

    key_format_values = [
        ('column', dict(key_format='r')),
        ('integer_row', dict(key_format='i')),

            

Reported by Pylint.

Missing class docstring
Error

Line: 37 Column: 1

              # test_rollback_to_stable06.py
# Test that rollback to stable removes all keys when the stable timestamp is earlier than
# all commit timestamps.
class test_rollback_to_stable06(test_rollback_to_stable_base):
    session_config = 'isolation=snapshot'

    key_format_values = [
        ('column', dict(key_format='r')),
        ('integer_row', dict(key_format='i')),

            

Reported by Pylint.

Missing function or method docstring
Error

Line: 57 Column: 5

              
    scenarios = make_scenarios(key_format_values, in_memory_values, prepare_values)

    def conn_config(self):
        config = 'cache_size=50MB,statistics=(all)'
        if self.in_memory:
            config += ',in_memory=true'
        else:
            config += ',log=(enabled),in_memory=false'

            

Reported by Pylint.

Missing function or method docstring
Error

Line: 65 Column: 5

                          config += ',log=(enabled),in_memory=false'
        return config

    def test_rollback_to_stable(self):
        nrows = 1000

        # Create a table without logging.
        uri = "table:rollback_to_stable06"
        ds = SimpleDataSet(

            

Reported by Pylint.

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

Line: 70 Column: 9

              
        # Create a table without logging.
        uri = "table:rollback_to_stable06"
        ds = SimpleDataSet(
            self, uri, 0, key_format=self.key_format, value_format="S", config='log=(enabled=false)')
        ds.populate()

        # Pin oldest and stable to timestamp 10.
        self.conn.set_timestamp('oldest_timestamp=' + self.timestamp_str(10) +

            

Reported by Pylint.

Line too long (101/100)
Error

Line: 71 Column: 1

                      # Create a table without logging.
        uri = "table:rollback_to_stable06"
        ds = SimpleDataSet(
            self, uri, 0, key_format=self.key_format, value_format="S", config='log=(enabled=false)')
        ds.populate()

        # Pin oldest and stable to timestamp 10.
        self.conn.set_timestamp('oldest_timestamp=' + self.timestamp_str(10) +
            ',stable_timestamp=' + self.timestamp_str(10))

            

Reported by Pylint.

site_scons/site_tools/tapilink.py
10 issues
Unable to import 'SCons'
Error

Line: 23 Column: 1

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

import SCons
import subprocess

# TODO: DRY this with abilink.py by moving duplicated code out to a common
# support module.


            

Reported by Pylint.

Unused import subprocess
Error

Line: 24 Column: 1

              #

import SCons
import subprocess

# TODO: DRY this with abilink.py by moving duplicated code out to a common
# support module.

def _detect(env):

            

Reported by Pylint.

TODO: DRY this with abilink.py by moving duplicated code out to a common
Error

Line: 26 Column: 3

              import SCons
import subprocess

# TODO: DRY this with abilink.py by moving duplicated code out to a common
# support module.

def _detect(env):
    try:
        tapi = env["TAPI"]

            

Reported by Pylint.

Missing module docstring
Error

Line: 1 Column: 1

              # Copyright 2020 MongoDB Inc.
#
# 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
# permit persons to whom the Software is furnished to do so, subject to
# the following conditions:

            

Reported by Pylint.

standard import "import subprocess" should be placed before "import SCons"
Error

Line: 24 Column: 1

              #

import SCons
import subprocess

# TODO: DRY this with abilink.py by moving duplicated code out to a common
# support module.

def _detect(env):

            

Reported by Pylint.

Consider possible security implications associated with subprocess module.
Security blacklist

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

              #

import SCons
import subprocess

# TODO: DRY this with abilink.py by moving duplicated code out to a common
# support module.

def _detect(env):

            

Reported by Bandit.

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

Line: 46 Column: 13

              
    def new_emitter(target, source, env):
        new_targets = []
        for t in target:
            base, ext = SCons.Util.splitext(str(t))
            if not ext == env['SHLIBSUFFIX']:
                continue

            tbd_target = (t.builder.target_factory or env.File)(base + ".tbd")

            

Reported by Pylint.

Missing function or method docstring
Error

Line: 93 Column: 1

                      ]
    )

def exists(env):
    result = _detect(env) != None
    return result


def generate(env):

            

Reported by Pylint.

Comparison '_detect(env) != None' should be '_detect(env) is not None'
Error

Line: 94 Column: 14

                  )

def exists(env):
    result = _detect(env) != None
    return result


def generate(env):


            

Reported by Pylint.

Missing function or method docstring
Error

Line: 98 Column: 1

                  return result


def generate(env):

    if not exists(env):
        return

    builder = env["BUILDERS"]["SharedLibrary"]

            

Reported by Pylint.

src/third_party/wiredtiger/test/suite/test_hs16.py
10 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 time, wiredtiger, wttest
from wtscenario import make_scenarios

# test_hs16.py
# Ensure that we don't panic when inserting an update without timestamp to the history store.
class test_hs16(wttest.WiredTigerTestCase):

            

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

# test_hs16.py
# Ensure that we don't panic when inserting an update without timestamp to the history store.
class test_hs16(wttest.WiredTigerTestCase):

            

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

# test_hs16.py
# Ensure that we don't panic when inserting an update without timestamp to the history store.
class test_hs16(wttest.WiredTigerTestCase):

            

Reported by Pylint.

Unused variable 'cursor2'
Error

Line: 66 Column: 9

              
        # Open anther session to make the next update without timestamp non-globally visible
        session2 = self.setUpSessionOpen(self.conn)
        cursor2 = session2.open_cursor(uri)
        session2.begin_transaction()
        cursor[self.create_key(2)] = 'a'

        # Update an update without timestamp
        self.session.begin_transaction()

            

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 (time, 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 time, wiredtiger, wttest
from wtscenario import make_scenarios

# test_hs16.py
# Ensure that we don't panic when inserting an update without timestamp to the history store.
class test_hs16(wttest.WiredTigerTestCase):

            

Reported by Pylint.

Missing class docstring
Error

Line: 34 Column: 1

              
# test_hs16.py
# Ensure that we don't panic when inserting an update without timestamp to the history store.
class test_hs16(wttest.WiredTigerTestCase):
    conn_config = 'cache_size=5MB'
    session_config = 'isolation=snapshot'
    key_format_values = (
        ('column', dict(key_format='r')),
        ('string-row', dict(key_format='S'))

            

Reported by Pylint.

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

Line: 34 Column: 1

              
# test_hs16.py
# Ensure that we don't panic when inserting an update without timestamp to the history store.
class test_hs16(wttest.WiredTigerTestCase):
    conn_config = 'cache_size=5MB'
    session_config = 'isolation=snapshot'
    key_format_values = (
        ('column', dict(key_format='r')),
        ('string-row', dict(key_format='S'))

            

Reported by Pylint.

Missing function or method docstring
Error

Line: 43 Column: 5

                  )
    scenarios = make_scenarios(key_format_values)

    def create_key(self,i):
        if self.key_format == 'S':
            return str(i)
        return i

    def test_hs16(self):

            

Reported by Pylint.

Missing function or method docstring
Error

Line: 48 Column: 5

                          return str(i)
        return i

    def test_hs16(self):
        uri = 'table:test_hs16'
        create_params = 'key_format={}, value_format=S'.format(self.key_format)
        self.session.create(uri, create_params)
        cursor = self.session.open_cursor(uri)


            

Reported by Pylint.

src/third_party/wiredtiger/test/suite/test_hs13.py
10 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 wtscenario import make_scenarios

# test_hs13.py
# Verify reverse modify traversal after eviction.
class test_hs13(wttest.WiredTigerTestCase):

            

Reported by Pylint.

Unused variable 'value3'
Error

Line: 48 Column: 9

                      create_params = 'value_format=S,key_format={}'.format(self.key_format)
        value1 = 'a' * 10000
        value2 = 'b' * 10000
        value3 = 'e' * 10000

        self.session.create(uri, create_params)
        cursor = self.session.open_cursor(uri)
        session2 = self.setUpSessionOpen(self.conn)
        cursor2 = session2.open_cursor(uri)

            

Reported by Pylint.

Using deprecated method assertEquals()
Error

Line: 70 Column: 9

                      session2.begin_transaction()
        cursor2.set_key(1)
        cursor2.search()
        self.assertEquals(cursor2.get_value(),  'A' + value1)
        session2.commit_transaction()

        # Reset the cursor.
        cursor2.reset()


            

Reported by Pylint.

Using deprecated method assertEquals()
Error

Line: 96 Column: 9

                      # and evict the page.
        evict_cursor = self.session.open_cursor(uri, None, "debug=(release_evict)")
        evict_cursor.set_key(1)
        self.assertEquals(evict_cursor.search(), 0)
        evict_cursor.reset()

        # Try to find the value we saw earlier.
        cursor2.set_key(1)
        cursor2.search()

            

Reported by Pylint.

Using deprecated method assertEquals()
Error

Line: 102 Column: 9

                      # Try to find the value we saw earlier.
        cursor2.set_key(1)
        cursor2.search()
        self.assertEquals(cursor2.get_value(), 'A' + value1)

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

            

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 wtscenario import make_scenarios

# test_hs13.py
# Verify reverse modify traversal after eviction.
class test_hs13(wttest.WiredTigerTestCase):

            

Reported by Pylint.

Missing class docstring
Error

Line: 34 Column: 1

              
# test_hs13.py
# Verify reverse modify traversal after eviction.
class test_hs13(wttest.WiredTigerTestCase):
    conn_config = 'cache_size=2MB,eviction=(threads_max=1)'
    session_config = 'isolation=snapshot'
    key_format_values = [
        ('column', dict(key_format='r')),
        ('integer-row', dict(key_format='i'))

            

Reported by Pylint.

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

Line: 34 Column: 1

              
# test_hs13.py
# Verify reverse modify traversal after eviction.
class test_hs13(wttest.WiredTigerTestCase):
    conn_config = 'cache_size=2MB,eviction=(threads_max=1)'
    session_config = 'isolation=snapshot'
    key_format_values = [
        ('column', dict(key_format='r')),
        ('integer-row', dict(key_format='i'))

            

Reported by Pylint.

Missing function or method docstring
Error

Line: 43 Column: 5

                  ]
    scenarios = make_scenarios(key_format_values)

    def test_reverse_modifies_constructed_after_eviction(self):
        uri = "table:test_hs13"
        create_params = 'value_format=S,key_format={}'.format(self.key_format)
        value1 = 'a' * 10000
        value2 = 'b' * 10000
        value3 = 'e' * 10000

            

Reported by Pylint.

src/third_party/scons-3.1.2/scons-local-3.1.2/SCons/Tool/aixc++.py
10 issues
Unused import SCons from wildcard import
Error

Line: 37 Column: 1

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

#forward proxy to the preffered cxx version
from SCons.Tool.aixcxx import *

# Local Variables:
# tab-width:4
# indent-tabs-mode:nil
# End:

            

Reported by Pylint.

Unused import cplusplus from wildcard import
Error

Line: 37 Column: 1

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

#forward proxy to the preffered cxx version
from SCons.Tool.aixcxx import *

# Local Variables:
# tab-width:4
# indent-tabs-mode:nil
# End:

            

Reported by Pylint.

Wildcard import SCons.Tool.aixcxx
Error

Line: 37 Column: 1

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

#forward proxy to the preffered cxx version
from SCons.Tool.aixcxx import *

# Local Variables:
# tab-width:4
# indent-tabs-mode:nil
# End:

            

Reported by Pylint.

Unused import os from wildcard import
Error

Line: 37 Column: 1

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

#forward proxy to the preffered cxx version
from SCons.Tool.aixcxx import *

# Local Variables:
# tab-width:4
# indent-tabs-mode:nil
# End:

            

Reported by Pylint.

Unused import exists from wildcard import
Error

Line: 37 Column: 1

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

#forward proxy to the preffered cxx version
from SCons.Tool.aixcxx import *

# Local Variables:
# tab-width:4
# indent-tabs-mode:nil
# End:

            

Reported by Pylint.

Unused import generate from wildcard import
Error

Line: 37 Column: 1

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

#forward proxy to the preffered cxx version
from SCons.Tool.aixcxx import *

# Local Variables:
# tab-width:4
# indent-tabs-mode:nil
# End:

            

Reported by Pylint.

Unused import get_xlc from wildcard import
Error

Line: 37 Column: 1

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

#forward proxy to the preffered cxx version
from SCons.Tool.aixcxx import *

# Local Variables:
# tab-width:4
# indent-tabs-mode:nil
# End:

            

Reported by Pylint.

Unused import packages from wildcard import
Error

Line: 37 Column: 1

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

#forward proxy to the preffered cxx version
from SCons.Tool.aixcxx import *

# Local Variables:
# tab-width:4
# indent-tabs-mode:nil
# End:

            

Reported by Pylint.

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

Line: 1 Column: 1

              """SCons.Tool.aixc++

Tool-specific initialization for IBM xlC / Visual Age C++ compiler.

There normally shouldn't be any need to import this module directly.
It will usually be imported through the generic SCons.Tool.Tool()
selection method.

"""

            

Reported by Pylint.

Line too long (117/100)
Error

Line: 34 Column: 1

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

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

#forward proxy to the preffered cxx version
from SCons.Tool.aixcxx import *

# Local Variables:

            

Reported by Pylint.

site_scons/site_tools/jstoh.py
10 issues
Missing module docstring
Error

Line: 1 Column: 1

              # Copyright 2020 MongoDB Inc.
#
# 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
# permit persons to whom the Software is furnished to do so, subject to
# the following conditions:

            

Reported by Pylint.

Function name "jsToHeader" doesn't conform to snake_case naming style
Error

Line: 27 Column: 1

              import sys


def jsToHeader(target, source):

    outFile = target

    h = [
        '#include "mongo/base/string_data.h"',

            

Reported by Pylint.

Missing function or method docstring
Error

Line: 27 Column: 1

              import sys


def jsToHeader(target, source):

    outFile = target

    h = [
        '#include "mongo/base/string_data.h"',

            

Reported by Pylint.

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

Line: 29 Column: 5

              
def jsToHeader(target, source):

    outFile = target

    h = [
        '#include "mongo/base/string_data.h"',
        '#include "mongo/scripting/engine.h"',
        "namespace mongo {",

            

Reported by Pylint.

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

Line: 31 Column: 5

              
    outFile = target

    h = [
        '#include "mongo/base/string_data.h"',
        '#include "mongo/scripting/engine.h"',
        "namespace mongo {",
        "namespace JSFiles{",
    ]

            

Reported by Pylint.

Function name "lineToChars" doesn't conform to snake_case naming style
Error

Line: 38 Column: 5

                      "namespace JSFiles{",
    ]

    def lineToChars(s):
        return ",".join(str(ord(c)) for c in (s.rstrip() + "\n")) + ","

    for s in source:
        filename = str(s)
        objname = os.path.split(filename)[1].split(".")[0]

            

Reported by Pylint.

Argument name "s" doesn't conform to snake_case naming style
Error

Line: 38 Column: 5

                      "namespace JSFiles{",
    ]

    def lineToChars(s):
        return ",".join(str(ord(c)) for c in (s.rstrip() + "\n")) + ","

    for s in source:
        filename = str(s)
        objname = os.path.split(filename)[1].split(".")[0]

            

Reported by Pylint.

Unnecessary parens after 'in' keyword
Error

Line: 39 Column: 1

                  ]

    def lineToChars(s):
        return ",".join(str(ord(c)) for c in (s.rstrip() + "\n")) + ","

    for s in source:
        filename = str(s)
        objname = os.path.split(filename)[1].split(".")[0]
        stringname = "_jscode_raw_" + objname

            

Reported by Pylint.

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

Line: 41 Column: 9

                  def lineToChars(s):
        return ",".join(str(ord(c)) for c in (s.rstrip() + "\n")) + ","

    for s in source:
        filename = str(s)
        objname = os.path.split(filename)[1].split(".")[0]
        stringname = "_jscode_raw_" + objname

        h.append("constexpr char " + stringname + "[] = {")

            

Reported by Pylint.

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

Line: 48 Column: 37

              
        h.append("constexpr char " + stringname + "[] = {")

        with open(filename, "r") as f:
            for line in f:
                h.append(lineToChars(line))

        h.append("0};")
        # symbols aren't exported w/o this

            

Reported by Pylint.

src/third_party/wiredtiger/test/suite/test_checkpoint05.py
10 issues
Unable to import 'wiredtiger'
Error

Line: 35 Column: 1

              # should get deleted as usual.

import time
import wiredtiger, wttest

class test_checkpoint05(wttest.WiredTigerTestCase):
    conn_config = 'create,cache_size=100MB,log=(archive=false,enabled=true,file_max=100K)'

    def count_checkpoints(self):

            

Reported by Pylint.

Unused import wiredtiger
Error

Line: 35 Column: 1

              # should get deleted as usual.

import time
import wiredtiger, wttest

class test_checkpoint05(wttest.WiredTigerTestCase):
    conn_config = 'create,cache_size=100MB,log=(archive=false,enabled=true,file_max=100K)'

    def count_checkpoints(self):

            

Reported by Pylint.

Attribute 'uri' defined outside __init__
Error

Line: 52 Column: 9

                      return nckpt

    def test_checkpoints_during_backup(self):
        self.uri = 'table:ckpt05'
        self.session.create(self.uri, 'key_format=i,value_format=i')

        # Setup: Insert some data and checkpoint it
        cursor = self.session.open_cursor(self.uri, None)
        for i in range(16):

            

Reported by Pylint.

Unused variable 'backup_cursor'
Error

Line: 62 Column: 9

                      self.session.checkpoint(None)

        # Create backup and check how many checkpoints we have.
        backup_cursor = self.session.open_cursor('backup:', None, None)
        initial_count = self.count_checkpoints()

        # Checkpoints created immediately after a backup cursor may get pinned.
        # Pause to avoid this.
        time.sleep(2)

            

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: 35 Column: 1

              # should get deleted as usual.

import time
import wiredtiger, wttest

class test_checkpoint05(wttest.WiredTigerTestCase):
    conn_config = 'create,cache_size=100MB,log=(archive=false,enabled=true,file_max=100K)'

    def count_checkpoints(self):

            

Reported by Pylint.

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

Line: 37 Column: 1

              import time
import wiredtiger, wttest

class test_checkpoint05(wttest.WiredTigerTestCase):
    conn_config = 'create,cache_size=100MB,log=(archive=false,enabled=true,file_max=100K)'

    def count_checkpoints(self):
        metadata_cursor = self.session.open_cursor('metadata:', None, None)


            

Reported by Pylint.

Missing class docstring
Error

Line: 37 Column: 1

              import time
import wiredtiger, wttest

class test_checkpoint05(wttest.WiredTigerTestCase):
    conn_config = 'create,cache_size=100MB,log=(archive=false,enabled=true,file_max=100K)'

    def count_checkpoints(self):
        metadata_cursor = self.session.open_cursor('metadata:', None, None)


            

Reported by Pylint.

Missing function or method docstring
Error

Line: 40 Column: 5

              class test_checkpoint05(wttest.WiredTigerTestCase):
    conn_config = 'create,cache_size=100MB,log=(archive=false,enabled=true,file_max=100K)'

    def count_checkpoints(self):
        metadata_cursor = self.session.open_cursor('metadata:', None, None)

        nckpt = 0
        while metadata_cursor.next() == 0:
            key = metadata_cursor.get_key()

            

Reported by Pylint.

Missing function or method docstring
Error

Line: 51 Column: 5

                      metadata_cursor.close()
        return nckpt

    def test_checkpoints_during_backup(self):
        self.uri = 'table:ckpt05'
        self.session.create(self.uri, 'key_format=i,value_format=i')

        # Setup: Insert some data and checkpoint it
        cursor = self.session.open_cursor(self.uri, None)

            

Reported by Pylint.