The following issues were found

jstests/ssl/tls_enumerator.py
9 issues
Catching too general exception Exception
Error

Line: 31 Column: 24

                          with context.wrap_socket(sock, server_hostname=host) as conn:
                try:
                    conn.connect((host, port))
                except Exception as e:
                    continue
                accepted_ciphers.append(cipher_name)

    return sorted(accepted_ciphers)


            

Reported by Pylint.

Unused variable 'e'
Error

Line: 31 Column: 17

                          with context.wrap_socket(sock, server_hostname=host) as conn:
                try:
                    conn.connect((host, port))
                except Exception as e:
                    continue
                accepted_ciphers.append(cipher_name)

    return sorted(accepted_ciphers)


            

Reported by Pylint.

Missing module docstring
Error

Line: 1 Column: 1

              import ssl
import socket
import json
import argparse

exception_ciphers = {}

def enumerate_tls_ciphers(protocol_options, host, port, cert, cafile):
    root_context = ssl.SSLContext(ssl.PROTOCOL_TLS)

            

Reported by Pylint.

Missing function or method docstring
Error

Line: 8 Column: 1

              
exception_ciphers = {}

def enumerate_tls_ciphers(protocol_options, host, port, cert, cafile):
    root_context = ssl.SSLContext(ssl.PROTOCOL_TLS)
    root_context.options |= protocol_options
    root_context.set_ciphers('ALL:COMPLEMENTOFALL:-PSK:-SRP')

    ciphers = {cipher['name'] for cipher in root_context.get_ciphers()}

            

Reported by Pylint.

Try, Except, Continue detected.
Security

Line: 31
Suggestion: https://bandit.readthedocs.io/en/latest/plugins/b112_try_except_continue.html

                          with context.wrap_socket(sock, server_hostname=host) as conn:
                try:
                    conn.connect((host, port))
                except Exception as e:
                    continue
                accepted_ciphers.append(cipher_name)

    return sorted(accepted_ciphers)


            

Reported by Bandit.

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

Line: 31 Column: 17

                          with context.wrap_socket(sock, server_hostname=host) as conn:
                try:
                    conn.connect((host, port))
                except Exception as e:
                    continue
                accepted_ciphers.append(cipher_name)

    return sorted(accepted_ciphers)


            

Reported by Pylint.

Line too long (120/100)
Error

Line: 48 Column: 1

                  parser.add_argument('--cert', type=str, help='Path to client certificate')
    args = parser.parse_args()

    # MacOS version of the toolchain does not have python linked with OpenSSL 1.1.1 yet, so we monkey patch this in here
    if not hasattr(ssl, 'OP_NO_TLSv1_3'):
        ssl.OP_NO_TLSv1_3 = 0

    exclude_ops = {
        ssl.OP_NO_SSLv2,

            

Reported by Pylint.

Missing function or method docstring
Error

Line: 61 Column: 5

                      ssl.OP_NO_TLSv1_3,
    }

    def exclude_except(op):
        option = 0
        for other_op in exclude_ops - {op}:
            option |= other_op
        return option


            

Reported by Pylint.

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

Line: 61 Column: 5

                      ssl.OP_NO_TLSv1_3,
    }

    def exclude_except(op):
        option = 0
        for other_op in exclude_ops - {op}:
            option |= other_op
        return option


            

Reported by Pylint.

src/third_party/wiredtiger/test/3rdparty/testtools-0.9.34/testtools/tests/matchers/test_doctest.py
9 issues
Undefined variable 'unicode'
Error

Line: 77 Column: 25

                      matcher = DocTestMatches(header, doctest.ELLIPSIS)
        mismatch = matcher.match(_b("GIF89a\1\0\1\0\0\0\0;"))
        # Must be treatable as unicode text, the exact output matters less
        self.assertTrue(unicode(mismatch.describe()))


def test_suite():
    from unittest import TestLoader
    return TestLoader().loadTestsFromName(__name__)

            

Reported by Pylint.

Missing module docstring
Error

Line: 1 Column: 1

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

import doctest

from testtools import TestCase
from testtools.compat import (
    str_is_unicode,
    _b,
    _u,

            

Reported by Pylint.

Missing class docstring
Error

Line: 17 Column: 1

              


class TestDocTestMatchesInterface(TestCase, TestMatchersInterface):

    matches_matcher = DocTestMatches("Ran 1 test in ...s", doctest.ELLIPSIS)
    matches_matches = ["Ran 1 test in 0.000s", "Ran 1 test in 1.234s"]
    matches_mismatches = ["Ran 1 tests in 0.000s", "Ran 2 test in 0.000s"]


            

Reported by Pylint.

Missing class docstring
Error

Line: 33 Column: 1

                      DocTestMatches("Ran 1 tests in ...s", doctest.ELLIPSIS))]


class TestDocTestMatchesInterfaceUnicode(TestCase, TestMatchersInterface):

    matches_matcher = DocTestMatches(_u("\xa7..."), doctest.ELLIPSIS)
    matches_matches = [_u("\xa7"), _u("\xa7 more\n")]
    matches_mismatches = ["\\xa7", _u("more \xa7"), _u("\n\xa7")]


            

Reported by Pylint.

Missing class docstring
Error

Line: 49 Column: 1

                      DocTestMatches(_u("\xa7"), doctest.ELLIPSIS))]


class TestDocTestMatchesSpecific(TestCase):

    run_tests_with = FullStackRunTest

    def test___init__simple(self):
        matcher = DocTestMatches("foo")

            

Reported by Pylint.

Missing function or method docstring
Error

Line: 53 Column: 5

              
    run_tests_with = FullStackRunTest

    def test___init__simple(self):
        matcher = DocTestMatches("foo")
        self.assertEqual("foo\n", matcher.want)

    def test___init__flags(self):
        matcher = DocTestMatches("bar\n", doctest.ELLIPSIS)

            

Reported by Pylint.

Missing function or method docstring
Error

Line: 57 Column: 5

                      matcher = DocTestMatches("foo")
        self.assertEqual("foo\n", matcher.want)

    def test___init__flags(self):
        matcher = DocTestMatches("bar\n", doctest.ELLIPSIS)
        self.assertEqual("bar\n", matcher.want)
        self.assertEqual(doctest.ELLIPSIS, matcher.flags)

    def test_describe_non_ascii_bytes(self):

            

Reported by Pylint.

Missing function or method docstring
Error

Line: 80 Column: 1

                      self.assertTrue(unicode(mismatch.describe()))


def test_suite():
    from unittest import TestLoader
    return TestLoader().loadTestsFromName(__name__)

            

Reported by Pylint.

Import outside toplevel (unittest.TestLoader)
Error

Line: 81 Column: 5

              

def test_suite():
    from unittest import TestLoader
    return TestLoader().loadTestsFromName(__name__)

            

Reported by Pylint.

src/third_party/boost/boost/random/ranlux.hpp
9 issues
random - This function is not sufficiently random for security-related functions such as key and nonce creation
Security

Line: 25 Column: 11 CWE codes: 327
Suggestion: Use a more secure technique for acquiring random values

              
namespace boost {

namespace random {

namespace detail {
/**
 * The ranlux family of generators are described in
 *

            

Reported by FlawFinder.

random - This function is not sufficiently random for security-related functions such as key and nonce creation
Security

Line: 86 Column: 7 CWE codes: 327
Suggestion: Use a more secure technique for acquiring random values

              #endif
}

using random::ranlux3;
using random::ranlux4;
using random::ranlux3_01;
using random::ranlux4_01;
using random::ranlux64_3_01;
using random::ranlux64_4_01;

            

Reported by FlawFinder.

random - This function is not sufficiently random for security-related functions such as key and nonce creation
Security

Line: 87 Column: 7 CWE codes: 327
Suggestion: Use a more secure technique for acquiring random values

              }

using random::ranlux3;
using random::ranlux4;
using random::ranlux3_01;
using random::ranlux4_01;
using random::ranlux64_3_01;
using random::ranlux64_4_01;
#if !defined(BOOST_NO_INT64_T) && !defined(BOOST_NO_INTEGRAL_INT64_T)

            

Reported by FlawFinder.

random - This function is not sufficiently random for security-related functions such as key and nonce creation
Security

Line: 88 Column: 7 CWE codes: 327
Suggestion: Use a more secure technique for acquiring random values

              
using random::ranlux3;
using random::ranlux4;
using random::ranlux3_01;
using random::ranlux4_01;
using random::ranlux64_3_01;
using random::ranlux64_4_01;
#if !defined(BOOST_NO_INT64_T) && !defined(BOOST_NO_INTEGRAL_INT64_T)
using random::ranlux64_3;

            

Reported by FlawFinder.

random - This function is not sufficiently random for security-related functions such as key and nonce creation
Security

Line: 89 Column: 7 CWE codes: 327
Suggestion: Use a more secure technique for acquiring random values

              using random::ranlux3;
using random::ranlux4;
using random::ranlux3_01;
using random::ranlux4_01;
using random::ranlux64_3_01;
using random::ranlux64_4_01;
#if !defined(BOOST_NO_INT64_T) && !defined(BOOST_NO_INTEGRAL_INT64_T)
using random::ranlux64_3;
using random::ranlux64_4;

            

Reported by FlawFinder.

random - This function is not sufficiently random for security-related functions such as key and nonce creation
Security

Line: 90 Column: 7 CWE codes: 327
Suggestion: Use a more secure technique for acquiring random values

              using random::ranlux4;
using random::ranlux3_01;
using random::ranlux4_01;
using random::ranlux64_3_01;
using random::ranlux64_4_01;
#if !defined(BOOST_NO_INT64_T) && !defined(BOOST_NO_INTEGRAL_INT64_T)
using random::ranlux64_3;
using random::ranlux64_4;
#endif

            

Reported by FlawFinder.

random - This function is not sufficiently random for security-related functions such as key and nonce creation
Security

Line: 91 Column: 7 CWE codes: 327
Suggestion: Use a more secure technique for acquiring random values

              using random::ranlux3_01;
using random::ranlux4_01;
using random::ranlux64_3_01;
using random::ranlux64_4_01;
#if !defined(BOOST_NO_INT64_T) && !defined(BOOST_NO_INTEGRAL_INT64_T)
using random::ranlux64_3;
using random::ranlux64_4;
#endif


            

Reported by FlawFinder.

random - This function is not sufficiently random for security-related functions such as key and nonce creation
Security

Line: 93 Column: 7 CWE codes: 327
Suggestion: Use a more secure technique for acquiring random values

              using random::ranlux64_3_01;
using random::ranlux64_4_01;
#if !defined(BOOST_NO_INT64_T) && !defined(BOOST_NO_INTEGRAL_INT64_T)
using random::ranlux64_3;
using random::ranlux64_4;
#endif

} // namespace boost


            

Reported by FlawFinder.

random - This function is not sufficiently random for security-related functions such as key and nonce creation
Security

Line: 94 Column: 7 CWE codes: 327
Suggestion: Use a more secure technique for acquiring random values

              using random::ranlux64_4_01;
#if !defined(BOOST_NO_INT64_T) && !defined(BOOST_NO_INTEGRAL_INT64_T)
using random::ranlux64_3;
using random::ranlux64_4;
#endif

} // namespace boost

#endif // BOOST_RANDOM_LINEAR_CONGRUENTIAL_HPP

            

Reported by FlawFinder.

src/third_party/wiredtiger/test/suite/test_hs15.py
9 issues
Unable to import 'wiredtiger'
Error

Line: 34 Column: 1

              # [END_TAGS]
#

import time, wiredtiger, wttest
from wtscenario import make_scenarios

# test_hs15.py
# Ensure eviction doesn't clear the history store again after checkpoint has done so because of the same update without timestamp.
class test_hs15(wttest.WiredTigerTestCase):

            

Reported by Pylint.

Unused import time
Error

Line: 34 Column: 1

              # [END_TAGS]
#

import time, wiredtiger, wttest
from wtscenario import make_scenarios

# test_hs15.py
# Ensure eviction doesn't clear the history store again after checkpoint has done so because of the same update without timestamp.
class test_hs15(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 (time, wiredtiger, wttest)
Error

Line: 34 Column: 1

              # [END_TAGS]
#

import time, wiredtiger, wttest
from wtscenario import make_scenarios

# test_hs15.py
# Ensure eviction doesn't clear the history store again after checkpoint has done so because of the same update without timestamp.
class test_hs15(wttest.WiredTigerTestCase):

            

Reported by Pylint.

Line too long (130/100)
Error

Line: 38 Column: 1

              from wtscenario import make_scenarios

# test_hs15.py
# Ensure eviction doesn't clear the history store again after checkpoint has done so because of the same update without timestamp.
class test_hs15(wttest.WiredTigerTestCase):
    conn_config = 'cache_size=5MB'
    session_config = 'isolation=snapshot'
    key_format_values = [
        ('column', dict(key_format='r')),

            

Reported by Pylint.

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

Line: 39 Column: 1

              
# test_hs15.py
# Ensure eviction doesn't clear the history store again after checkpoint has done so because of the same update without timestamp.
class test_hs15(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 class docstring
Error

Line: 39 Column: 1

              
# test_hs15.py
# Ensure eviction doesn't clear the history store again after checkpoint has done so because of the same update without timestamp.
class test_hs15(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: 48 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_hs15(self):

            

Reported by Pylint.

Missing function or method docstring
Error

Line: 53 Column: 5

                          return str(i)
        return i

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

        value1 = 'a' * 500

            

Reported by Pylint.

src/third_party/unwind/dist/src/dwarf/Gfind_proc_info-lsb.c
9 issues
Uninitialized variable: table_size
Error

Line: 825 CWE codes: 908

                             unw_word_t table, size_t table_size, int32_t rel_ip,
               struct table_entry *e, int32_t *last_ip_offset, void *arg)
{
  unsigned long table_len = table_size / sizeof (struct table_entry);
  unw_accessors_t *a = unw_get_accessors_int (as);
  unsigned long lo, hi, mid;
  unw_word_t e_addr = 0;
  int32_t start = 0;
  int ret;

            

Reported by Cppcheck.

Uninitialized variable: table_len
Error

Line: 934 CWE codes: 908

              #ifndef UNW_LOCAL_ONLY
      int32_t last_ip_offset = di->end_ip - ip_base;
      segbase = di->u.rti.segbase;
      if ((ret = remote_lookup (as, (uintptr_t) table, table_len,
                                ip - ip_base, &ent, &last_ip_offset, arg)) < 0)
        return ret;
      if (ret)
	{
	  e = &ent;

            

Reported by Cppcheck.

Uninitialized variable: table
Error

Line: 934 CWE codes: 908

              #ifndef UNW_LOCAL_ONLY
      int32_t last_ip_offset = di->end_ip - ip_base;
      segbase = di->u.rti.segbase;
      if ((ret = remote_lookup (as, (uintptr_t) table, table_len,
                                ip - ip_base, &ent, &last_ip_offset, arg)) < 0)
        return ret;
      if (ret)
	{
	  e = &ent;

            

Reported by Cppcheck.

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

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

                    *bufsize = shdr->sh_size;
      GET_MEMORY(*buf, *bufsize);

      memcpy(*buf, shdr->sh_offset + ei.image, *bufsize);

      Debug (4, "read %zd bytes of .debug_frame from offset %zd\n",
	     *bufsize, shdr->sh_offset);
#if defined(SHF_COMPRESSED)
    }

            

Reported by FlawFinder.

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

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

              
        if (len + 1 <= name_size)
          {
            memcpy (name, mi.path, len + 1);
            found = 1;
          }
        break;
      }
  maps_close (&mi);

            

Reported by FlawFinder.

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

Line: 223 Column: 3 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

                                 unw_word_t start, unw_word_t end)
{
  struct unw_debug_frame_list *w, *fdesc = 0;
  char path[PATH_MAX];
  char *name = path;
  int err;
  char *buf;
  size_t bufsize;


            

Reported by FlawFinder.

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

Line: 484 Column: 3 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

                Elf_W (Addr) eh_frame = 0;
  Elf_W (Shdr)* shdr;
  const char *file = info->dlpi_name;
  char exepath[PATH_MAX];

  if (strlen(file) == 0)
    {
      tdep_get_exe_image_path(exepath);
      file = exepath;

            

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: 199 Column: 22 CWE codes: 126

                while (maps_next (&mi, &segbase, &hi, &mapoff))
    if (ip >= segbase && ip < hi)
      {
        size_t len = strlen (mi.path);

        if (len + 1 <= name_size)
          {
            memcpy (name, mi.path, len + 1);
            found = 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: 486 Column: 7 CWE codes: 126

                const char *file = info->dlpi_name;
  char exepath[PATH_MAX];

  if (strlen(file) == 0)
    {
      tdep_get_exe_image_path(exepath);
      file = exepath;
    }


            

Reported by FlawFinder.

src/third_party/timelib-2021.06/timelib.c
9 issues
char - Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues
Security

Line: 38 Column: 7 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

              
#define TIMELIB_LLABS(y) (y < 0 ? (y * -1) : y)

const char *timelib_error_messages[10] = {
	"No error",
	"Can not allocate buffer for parsing",
	"Corrupt tzfile: The transitions in the file don't always increase",
	"Corrupt tzfile: The expected 64-bit preamble is missing",
	"Corrupt tzfile: No abbreviation could be found for a transition",

            

Reported by FlawFinder.

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

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

              timelib_time* timelib_time_clone(timelib_time *orig)
{
	timelib_time *tmp = timelib_time_ctor();
	memcpy(tmp, orig, sizeof(timelib_time));
	if (orig->tz_abbr) {
		tmp->tz_abbr = timelib_strdup(orig->tz_abbr);
	}
	if (orig->tz_info) {
		tmp->tz_info = orig->tz_info;

            

Reported by FlawFinder.

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

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

              timelib_rel_time* timelib_rel_time_clone(timelib_rel_time *rel)
{
	timelib_rel_time *tmp = timelib_rel_time_ctor();
	memcpy(tmp, rel, sizeof(timelib_rel_time));
	return tmp;
}

void timelib_time_tz_abbr_update(timelib_time* tm, const char* tz_abbr)
{

            

Reported by FlawFinder.

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

Line: 215 Column: 23 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

              	return (h * SECS_PER_HOUR) + (m * 60) + s;
}

static const unsigned char timelib_tolower_map[256] = {
	0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f,
	0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f,
	0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f,
	0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f,
	0x40, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f,

            

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: 124 Column: 23 CWE codes: 126

              void timelib_time_tz_abbr_update(timelib_time* tm, const char* tz_abbr)
{
	unsigned int i;
	size_t tz_abbr_len = strlen(tz_abbr);

	TIMELIB_TIME_FREE(tm->tz_abbr);
	tm->tz_abbr = timelib_strdup(tz_abbr);
	for (i = 0; i < tz_abbr_len; i++) {
		tm->tz_abbr[i] = toupper(tz_abbr[i]);

            

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: 243 Column: 16 CWE codes: 126

              int timelib_strcasecmp(const char *s1, const char *s2)
{
	size_t len;
	size_t len1 = strlen(s1);
	size_t len2 = strlen(s2);
	int c1, c2;

	if (s1 == s2) {
		return 0;

            

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: 244 Column: 16 CWE codes: 126

              {
	size_t len;
	size_t len1 = strlen(s1);
	size_t len2 = strlen(s2);
	int c1, c2;

	if (s1 == s2) {
		return 0;
	}

            

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: 266 Column: 16 CWE codes: 126

              int timelib_strncasecmp(const char *s1, const char *s2, size_t length)
{
	size_t len;
	size_t len1 = strlen(s1);
	size_t len2 = strlen(s2);
	int c1, c2;

	if (s1 == s2) {
		return 0;

            

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: 267 Column: 16 CWE codes: 126

              {
	size_t len;
	size_t len1 = strlen(s1);
	size_t len2 = strlen(s2);
	int c1, c2;

	if (s1 == s2) {
		return 0;
	}

            

Reported by FlawFinder.

src/third_party/wiredtiger/test/3rdparty/testtools-0.9.34/testtools/matchers/_impl.py
9 issues
method already defined line 125
Error

Line: 144 Column: 9

              
        __unicode__ = __str__

        def __str__(self):
            return self.__unicode__().encode("ascii", "backslashreplace")


class MismatchDecorator(object):
    """Decorate a ``Mismatch``.

            

Reported by Pylint.

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

Line: 83 Column: 13

                      try:
            return self._description
        except AttributeError:
            raise NotImplementedError(self.describe)

    def get_details(self):
        """Get extra details about the mismatch.

        This allows the mismatch to provide extra information beyond the basic

            

Reported by Pylint.

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

Line: 28 Column: 1

                  )


class Matcher(object):
    """A pattern matcher.

    A Matcher must implement match and __str__ to be used by
    testtools.TestCase.assertThat. Matcher.match(thing) returns None when
    thing is completely matched, and a Mismatch object otherwise.

            

Reported by Pylint.

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

Line: 56 Column: 1

                      raise NotImplementedError(self.__str__)


class Mismatch(object):
    """An object describing a mismatch detected by a Matcher."""

    def __init__(self, description=None, details=None):
        """Construct a `Mismatch`.


            

Reported by Pylint.

Unnecessary "else" after "return"
Error

Line: 127 Column: 9

              
    def __str__(self):
        difference = self.mismatch.describe()
        if self.verbose:
            # GZ 2011-08-24: Smelly API? Better to take any object and special
            #                case text inside?
            if istext(self.matchee) or _isbytes(self.matchee):
                matchee = text_repr(self.matchee, multiline=False)
            else:

            

Reported by Pylint.

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

Line: 148 Column: 1

                          return self.__unicode__().encode("ascii", "backslashreplace")


class MismatchDecorator(object):
    """Decorate a ``Mismatch``.

    Forwards all messages to the original mismatch object.  Probably the best
    way to use this is inherit from this class and then provide your own
    custom decoration logic.

            

Reported by Pylint.

Missing function or method docstring
Error

Line: 166 Column: 5

                  def __repr__(self):
        return '<testtools.matchers.MismatchDecorator(%r)>' % (self.original,)

    def describe(self):
        return self.original.describe()

    def get_details(self):
        return self.original.get_details()


            

Reported by Pylint.

Missing function or method docstring
Error

Line: 169 Column: 5

                  def describe(self):
        return self.original.describe()

    def get_details(self):
        return self.original.get_details()


# Signal that this is part of the testing framework, and that code from this
# should not normally appear in tracebacks.

            

Reported by Pylint.

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

Line: 175 Column: 1

              
# Signal that this is part of the testing framework, and that code from this
# should not normally appear in tracebacks.
__unittest = True

            

Reported by Pylint.

src/third_party/wiredtiger/test/suite/test_prepare_conflict.py
9 issues
Unable to import 'wiredtiger'
Error

Line: 33 Column: 1

              #   Evict a page while in the fast-truncate state.
#

import wiredtiger, wttest
from wtdataset import simple_key, simple_value
from wtscenario import make_scenarios

class test_prepare_conflict(wttest.WiredTigerTestCase):
    key_format_values = [

            

Reported by Pylint.

Unused import wiredtiger
Error

Line: 33 Column: 1

              #   Evict a page while in the fast-truncate state.
#

import wiredtiger, wttest
from wtdataset import simple_key, simple_value
from wtscenario import make_scenarios

class test_prepare_conflict(wttest.WiredTigerTestCase):
    key_format_values = [

            

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

              #   Evict a page while in the fast-truncate state.
#

import wiredtiger, wttest
from wtdataset import simple_key, simple_value
from wtscenario import make_scenarios

class test_prepare_conflict(wttest.WiredTigerTestCase):
    key_format_values = [

            

Reported by Pylint.

Missing class docstring
Error

Line: 37 Column: 1

              from wtdataset import simple_key, simple_value
from wtscenario import make_scenarios

class test_prepare_conflict(wttest.WiredTigerTestCase):
    key_format_values = [
        ('column', dict(key_format='r')),
        ('integer_row', dict(key_format='i')),
    ]


            

Reported by Pylint.

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

Line: 37 Column: 1

              from wtdataset import simple_key, simple_value
from wtscenario import make_scenarios

class test_prepare_conflict(wttest.WiredTigerTestCase):
    key_format_values = [
        ('column', dict(key_format='r')),
        ('integer_row', dict(key_format='i')),
    ]


            

Reported by Pylint.

Missing function or method docstring
Error

Line: 45 Column: 5

              
    scenarios = make_scenarios(key_format_values)

    def test_prepare(self):
        # Create a large table with lots of pages.
        uri = "table:test_prepare_conflict"
        key_format = 'key_format=' + self.key_format
        config = 'allocation_size=512,leaf_page_max=512,{},value_format=S'.format(key_format)
        self.session.create(uri, config)

            

Reported by Pylint.

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

Line: 63 Column: 9

                      self.session.begin_transaction('isolation=snapshot')

        # Truncate the middle chunk.
        c1 = self.session.open_cursor(uri, None)
        c1.set_key(simple_key(c1, 10000))
        c2 = self.session.open_cursor(uri, None)
        c2.set_key(simple_key(c1, 70000))
        self.session.truncate(None, c1, c2, None)
        c1.close()

            

Reported by Pylint.

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

Line: 65 Column: 9

                      # Truncate the middle chunk.
        c1 = self.session.open_cursor(uri, None)
        c1.set_key(simple_key(c1, 10000))
        c2 = self.session.open_cursor(uri, None)
        c2.set_key(simple_key(c1, 70000))
        self.session.truncate(None, c1, c2, None)
        c1.close()
        c2.close()


            

Reported by Pylint.

src/third_party/wiredtiger/test/suite/test_hs04.py
9 issues
Unable to import 'wiredtiger'
Error

Line: 33 Column: 1

              #   Test file_max configuration and reconfiguration for the history store table.
#

import wiredtiger, wttest
from wtscenario import make_scenarios

# Taken from src/include/misc.h.
WT_MB = 1048576


            

Reported by Pylint.

An attribute defined in wttest line 401 hides this method
Error

Line: 60 Column: 5

                  scenarios = make_scenarios(init_file_max_values, reconfig_file_max_values,
                               in_memory_values)

    def conn_config(self):
        config = 'statistics=(fast)'
        if self.init_file_max is not None:
            config += ',history_store=(file_max={})'.format(self.init_file_max)
        if self.in_memory is not None:
            config += ',in_memory=' + ('true' if self.in_memory else 'false')

            

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

              #   Test file_max configuration and reconfiguration for the history store table.
#

import wiredtiger, wttest
from wtscenario import make_scenarios

# Taken from src/include/misc.h.
WT_MB = 1048576


            

Reported by Pylint.

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

Line: 39 Column: 1

              # Taken from src/include/misc.h.
WT_MB = 1048576

class test_hs04(wttest.WiredTigerTestCase):
    uri = 'table:hs_04'
    in_memory_values = [
        ('false', dict(in_memory=False)),
        ('none', dict(in_memory=None)),
        ('true', dict(in_memory=True))

            

Reported by Pylint.

Missing class docstring
Error

Line: 39 Column: 1

              # Taken from src/include/misc.h.
WT_MB = 1048576

class test_hs04(wttest.WiredTigerTestCase):
    uri = 'table:hs_04'
    in_memory_values = [
        ('false', dict(in_memory=False)),
        ('none', dict(in_memory=None)),
        ('true', dict(in_memory=True))

            

Reported by Pylint.

Missing function or method docstring
Error

Line: 60 Column: 5

                  scenarios = make_scenarios(init_file_max_values, reconfig_file_max_values,
                               in_memory_values)

    def conn_config(self):
        config = 'statistics=(fast)'
        if self.init_file_max is not None:
            config += ',history_store=(file_max={})'.format(self.init_file_max)
        if self.in_memory is not None:
            config += ',in_memory=' + ('true' if self.in_memory else 'false')

            

Reported by Pylint.

Missing function or method docstring
Error

Line: 68 Column: 5

                          config += ',in_memory=' + ('true' if self.in_memory else 'false')
        return config

    def get_stat(self, stat):
        stat_cursor = self.session.open_cursor('statistics:')
        val = stat_cursor[stat][2]
        stat_cursor.close()
        return val


            

Reported by Pylint.

Missing function or method docstring
Error

Line: 74 Column: 5

                      stat_cursor.close()
        return val

    def test_hs(self):
        self.session.create(self.uri, 'key_format=S,value_format=S')

        if self.in_memory:
            # For in-memory configurations, we simply ignore any history store
            # related configuration.

            

Reported by Pylint.

src/third_party/wiredtiger/test/suite/test_timestamp16.py
9 issues
Unable to import 'wiredtiger'
Error

Line: 36 Column: 1

              
import random
from suite_subprocess import suite_subprocess
import wiredtiger, wttest

class test_timestamp16(wttest.WiredTigerTestCase, suite_subprocess):
    tablename = 'test_timestamp16'
    uri = 'table:' + tablename
    session_config = 'isolation=snapshot'

            

Reported by Pylint.

Unused import random
Error

Line: 34 Column: 1

              #   end of a txn.
#

import random
from suite_subprocess import suite_subprocess
import wiredtiger, wttest

class test_timestamp16(wttest.WiredTigerTestCase, suite_subprocess):
    tablename = 'test_timestamp16'

            

Reported by Pylint.

Unused import wiredtiger
Error

Line: 36 Column: 1

              
import random
from suite_subprocess import suite_subprocess
import wiredtiger, wttest

class test_timestamp16(wttest.WiredTigerTestCase, suite_subprocess):
    tablename = 'test_timestamp16'
    uri = 'table:' + tablename
    session_config = 'isolation=snapshot'

            

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.

third party import "import wiredtiger, wttest" should be placed before "from suite_subprocess import suite_subprocess"
Error

Line: 36 Column: 1

              
import random
from suite_subprocess import suite_subprocess
import wiredtiger, wttest

class test_timestamp16(wttest.WiredTigerTestCase, suite_subprocess):
    tablename = 'test_timestamp16'
    uri = 'table:' + tablename
    session_config = 'isolation=snapshot'

            

Reported by Pylint.

Multiple imports on one line (wiredtiger, wttest)
Error

Line: 36 Column: 1

              
import random
from suite_subprocess import suite_subprocess
import wiredtiger, wttest

class test_timestamp16(wttest.WiredTigerTestCase, suite_subprocess):
    tablename = 'test_timestamp16'
    uri = 'table:' + tablename
    session_config = 'isolation=snapshot'

            

Reported by Pylint.

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

Line: 38 Column: 1

              from suite_subprocess import suite_subprocess
import wiredtiger, wttest

class test_timestamp16(wttest.WiredTigerTestCase, suite_subprocess):
    tablename = 'test_timestamp16'
    uri = 'table:' + tablename
    session_config = 'isolation=snapshot'

    def test_read_timestamp_cleared(self):

            

Reported by Pylint.

Missing class docstring
Error

Line: 38 Column: 1

              from suite_subprocess import suite_subprocess
import wiredtiger, wttest

class test_timestamp16(wttest.WiredTigerTestCase, suite_subprocess):
    tablename = 'test_timestamp16'
    uri = 'table:' + tablename
    session_config = 'isolation=snapshot'

    def test_read_timestamp_cleared(self):

            

Reported by Pylint.

Missing function or method docstring
Error

Line: 43 Column: 5

                  uri = 'table:' + tablename
    session_config = 'isolation=snapshot'

    def test_read_timestamp_cleared(self):
        # Ensure that the read timestamp doesn't move our checkpoint.
        self.session.create(self.uri, 'key_format=i,value_format=i')
        self.session.begin_transaction('read_timestamp=100')
        self.session.rollback_transaction()
        self.session.checkpoint('use_timestamp=true')

            

Reported by Pylint.