The following issues were found

src/third_party/wiredtiger/test/suite/test_prepare06.py
14 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_prepare06(wttest.WiredTigerTestCase, suite_subprocess):
    tablename = 'test_prepare06'
    uri = 'table:' + tablename

            

Reported by Pylint.

Unused variable 'c'
Error

Line: 51 Column: 9

              
    def test_timestamp_api(self):
        self.session.create(self.uri, 'key_format={},value_format=i'.format(self.key_format))
        c = self.session.open_cursor(self.uri)

        # It is illegal to set the prepare timestamp older than the oldest
        # timestamp.
        self.conn.set_timestamp('oldest_timestamp=' + self.timestamp_str(20))
        self.conn.set_timestamp('stable_timestamp=' + self.timestamp_str(30))

            

Reported by Pylint.

String statement has no effect
Error

Line: 72 Column: 9

                      self.session.timestamp_transaction('durable_timestamp=' + self.timestamp_str(35))
        self.session.commit_transaction()

        '''
        Commented out for now: the system panics if we fail after preparing a transaction.

        # Check setting a prepared transaction timestamps earlier than the
        # oldest timestamp is invalid, if durable timestamp is less than the
        # stable timestamp.

            

Reported by Pylint.

String statement has no effect
Error

Line: 107 Column: 9

                          self.assertEqual(self.session.prepare_transaction('prepare_timestamp=' + self.timestamp_str(40)), 0)
            self.session.rollback_transaction()

        '''
        Commented out for now: the system panics if we fail after preparing a transaction.

        # It is illegal to set a commit timestamp less than the prepare
        # timestamp of a transaction.
        self.session.begin_transaction()

            

Reported by Pylint.

String statement has no effect
Error

Line: 121 Column: 9

                          "/less than the prepare timestamp/")
        '''

        '''
        Commented out for now: the system panics if we fail after preparing a transaction.

        # It is legal to set a commit timestamp older than prepare timestamp of
        # a transaction with roundup_timestamps settings.
        self.session.begin_transaction('roundup_timestamps=(prepared=true)')

            

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

              #

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

class test_prepare06(wttest.WiredTigerTestCase, suite_subprocess):
    tablename = 'test_prepare06'
    uri = 'table:' + tablename

            

Reported by Pylint.

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

Line: 34 Column: 1

              #

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

class test_prepare06(wttest.WiredTigerTestCase, suite_subprocess):
    tablename = 'test_prepare06'
    uri = 'table:' + tablename

            

Reported by Pylint.

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

Line: 37 Column: 1

              import wiredtiger, wttest
from wtscenario import make_scenarios

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

    key_format_values = [

            

Reported by Pylint.

Missing class docstring
Error

Line: 37 Column: 1

              import wiredtiger, wttest
from wtscenario import make_scenarios

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

    key_format_values = [

            

Reported by Pylint.

src/third_party/wiredtiger/test/suite/test_cursor04.py
14 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_base04.py
#     Cursor operations
class test_cursor04(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 wtscenario import make_scenarios

# test_base04.py
#     Cursor operations
class test_cursor04(wttest.WiredTigerTestCase):

            

Reported by Pylint.

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

Line: 34 Column: 1

              
# test_base04.py
#     Cursor operations
class test_cursor04(wttest.WiredTigerTestCase):
    """
    Test cursor search and search_near
    """
    table_name1 = 'test_cursor04'
    nentries = 20

            

Reported by Pylint.

Method could be a function
Error

Line: 48 Column: 5

                      ('fix', dict(tablekind='fix', uri='table'))
    ])

    def config_string(self):
        """
        Return any additional configuration.
        This method may be overridden.
        """
        return ''

            

Reported by Pylint.

Missing function or method docstring
Error

Line: 65 Column: 5

                          print('**** ERROR in session.create("' + name + '","' + args + '") ***** ')
            raise

    def create_session_and_cursor(self):
        tablearg = self.uri + ":" + self.table_name1
        if self.tablekind == 'row':
            keyformat = 'key_format=S'
        else:
            keyformat = 'key_format=r'  # record format

            

Reported by Pylint.

Missing function or method docstring
Error

Line: 81 Column: 5

                      self.pr('creating cursor')
        return self.session.open_cursor(tablearg, None, None)

    def genkey(self, i):
        if self.tablekind == 'row':
            return 'key' + str(i).zfill(5)  # return key00001, key00002, etc.
        else:
            return self.recno(i+1)


            

Reported by Pylint.

Unnecessary "else" after "return"
Error

Line: 82 Column: 9

                      return self.session.open_cursor(tablearg, None, None)

    def genkey(self, i):
        if self.tablekind == 'row':
            return 'key' + str(i).zfill(5)  # return key00001, key00002, etc.
        else:
            return self.recno(i+1)

    def genvalue(self, i):

            

Reported by Pylint.

Missing function or method docstring
Error

Line: 87 Column: 5

                      else:
            return self.recno(i+1)

    def genvalue(self, i):
        if self.tablekind == 'fix':
            return int(i & 0xff)
        else:
            return 'value' + str(i)


            

Reported by Pylint.

Unnecessary "else" after "return"
Error

Line: 88 Column: 9

                          return self.recno(i+1)

    def genvalue(self, i):
        if self.tablekind == 'fix':
            return int(i & 0xff)
        else:
            return 'value' + str(i)

    def expect_either(self, cursor, lt, gt):

            

Reported by Pylint.

src/third_party/abseil-cpp-master/abseil-cpp/absl/strings/cord_ring_test.cc
14 issues
syntax error
Error

Line: 102

              using TestParams = std::vector<TestParam>;

// Matcher validating when mutable copies are required / performed.
MATCHER_P2(EqIfPrivate, param, rep,
           absl::StrCat("Equal 0x", absl::Hex(rep), " if private")) {
  return param.refcount_is_one ? arg == rep : arg != rep;
}

// Matcher validating when mutable copies are required / performed.

            

Reported by Cppcheck.

StrCat - Does not check for buffer overflows when concatenating to destination [MS-banned]
Security

Line: 91 Column: 18 CWE codes: 120

                InputShareMode input_share_mode = kPrivate;

  std::string ToString() const {
    return absl::StrCat(refcount_is_one ? "Private" : "Shared",
                        with_capacity ? "" : "_NoCapacity",
                        (input_share_mode == kPrivate) ? ""
                        : (input_share_mode == kShared)
                            ? "_SharedInput"
                            : "_IndirectSharedInput");

            

Reported by FlawFinder.

StrCat - Does not check for buffer overflows when concatenating to destination [MS-banned]
Security

Line: 103 Column: 18 CWE codes: 120

              
// Matcher validating when mutable copies are required / performed.
MATCHER_P2(EqIfPrivate, param, rep,
           absl::StrCat("Equal 0x", absl::Hex(rep), " if private")) {
  return param.refcount_is_one ? arg == rep : arg != rep;
}

// Matcher validating when mutable copies are required / performed.
MATCHER_P2(EqIfPrivateAndCapacity, param, rep,

            

Reported by FlawFinder.

StrCat - Does not check for buffer overflows when concatenating to destination [MS-banned]
Security

Line: 109 Column: 18 CWE codes: 120

              
// Matcher validating when mutable copies are required / performed.
MATCHER_P2(EqIfPrivateAndCapacity, param, rep,
           absl::StrCat("Equal 0x", absl::Hex(rep),
                        " if private and capacity")) {
  return (param.refcount_is_one && param.with_capacity) ? arg == rep
                                                        : arg != rep;
}


            

Reported by FlawFinder.

StrCat - Does not check for buffer overflows when concatenating to destination [MS-banned]
Security

Line: 789 Column: 46 CWE codes: 120

                EXPECT_THAT(result->length, Eq(str1.size() + str2.size()));
  EXPECT_THAT(result, EqIfPrivateAndCapacity(GetParam(), ring));
  if (GetParam().refcount_is_one) {
    EXPECT_THAT(ToFlats(result), ElementsAre(StrCat(str1, str1a), str2a));
  } else {
    EXPECT_THAT(ToFlats(result), ElementsAre(str1, str2));
  }
  UnrefIfShared(ring);
  Unref(result);

            

Reported by FlawFinder.

StrCat - Does not check for buffer overflows when concatenating to destination [MS-banned]
Security

Line: 807 Column: 46 CWE codes: 120

                EXPECT_THAT(result, EqIfPrivate(GetParam(), ring));
  EXPECT_THAT(result->length, Eq(4 + str2.size()));
  if (GetParam().refcount_is_one) {
    EXPECT_THAT(ToFlats(result), ElementsAre(StrCat("1234", str2)));
  } else {
    EXPECT_THAT(ToFlats(result), ElementsAre("1234", str2));
  }
  UnrefIfShared(ring);
  Unref(result);

            

Reported by FlawFinder.

StrCat - Does not check for buffer overflows when concatenating to destination [MS-banned]
Security

Line: 819 Column: 24 CWE codes: 120

                absl::string_view str1 = "123456789_1234";
  absl::string_view str2 = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
  for (int shared_type = 0; shared_type < 2; ++shared_type) {
    SCOPED_TRACE(absl::StrCat("Shared extra type ", shared_type));

    // Create a flat that is shared in some way.
    CordRep* flat = nullptr;
    CordRep* flat1 = nullptr;
    if (shared_type == 0) {

            

Reported by FlawFinder.

StrCat - Does not check for buffer overflows when concatenating to destination [MS-banned]
Security

Line: 859 Column: 50 CWE codes: 120

                ASSERT_THAT(result, IsValidRingBuffer());
  EXPECT_THAT(result->length, Eq(str1.size() + str2.size() + str3.size()));
  EXPECT_THAT(result, EqIfPrivateAndCapacity(GetParam(), ring));
  EXPECT_THAT(ToFlats(result), ElementsAre(str1, StrCat(str2, str3)));
  UnrefIfShared(ring);
  Unref(result);
}

TEST_P(CordRingBuildTest, PrependString) {

            

Reported by FlawFinder.

StrCat - Does not check for buffer overflows when concatenating to destination [MS-banned]
Security

Line: 892 Column: 46 CWE codes: 120

                EXPECT_THAT(result, EqIfPrivate(GetParam(), ring));
  EXPECT_THAT(result->length, Eq(4 + str2.size()));
  if (GetParam().refcount_is_one) {
    EXPECT_THAT(ToFlats(result), ElementsAre(StrCat(str2, "1234")));
  } else {
    EXPECT_THAT(ToFlats(result), ElementsAre(str2, "1234"));
  }
  UnrefIfShared(ring);
  Unref(result);

            

Reported by FlawFinder.

StrCat - Does not check for buffer overflows when concatenating to destination [MS-banned]
Security

Line: 905 Column: 24 CWE codes: 120

                absl::string_view str2 = "abcdefghij";
  absl::string_view str1a = str1.substr(10);
  for (int shared_type = 1; shared_type < 2; ++shared_type) {
    SCOPED_TRACE(absl::StrCat("Shared extra type ", shared_type));

    // Create a flat that is shared in some way.
    CordRep* flat = nullptr;
    CordRep* flat1 = nullptr;
    if (shared_type == 1) {

            

Reported by FlawFinder.

src/third_party/wiredtiger/test/suite/test_util07.py
14 issues
Unable to import 'wiredtiger'
Error

Line: 31 Column: 1

              
import os, struct
from suite_subprocess import suite_subprocess
import wiredtiger, wttest

# test_util07.py
#    Utilities: wt read
class test_util07(wttest.WiredTigerTestCase, suite_subprocess):
    tablename = 'test_util07.a'

            

Reported by Pylint.

Unused import os
Error

Line: 29 Column: 1

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

import os, struct
from suite_subprocess import suite_subprocess
import wiredtiger, wttest

# test_util07.py
#    Utilities: wt read

            

Reported by Pylint.

Unused import struct
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 os, struct
from suite_subprocess import suite_subprocess
import wiredtiger, wttest

# test_util07.py
#    Utilities: wt read

            

Reported by Pylint.

Unused import wiredtiger
Error

Line: 31 Column: 1

              
import os, struct
from suite_subprocess import suite_subprocess
import wiredtiger, wttest

# test_util07.py
#    Utilities: wt read
class test_util07(wttest.WiredTigerTestCase, suite_subprocess):
    tablename = 'test_util07.a'

            

Reported by Pylint.

Parameters differ from overridden 'close_conn' method
Error

Line: 51 Column: 5

                          cursor[key] = val
        cursor.close()

    def close_conn(self):
        """
        Close the connection if already open.
        """
        if self.conn != None:
            self.conn.close()

            

Reported by Pylint.

Parameters differ from overridden 'open_conn' method
Error

Line: 59 Column: 5

                          self.conn.close()
            self.conn = None

    def open_conn(self):
        """
        Open the connection if already closed.
        """
        if self.conn == None:
            self.conn = self.setUpConnectionOpen(".")

            

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 (os, struct)
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 os, struct
from suite_subprocess import suite_subprocess
import wiredtiger, wttest

# test_util07.py
#    Utilities: wt read

            

Reported by Pylint.

Multiple imports on one line (wiredtiger, wttest)
Error

Line: 31 Column: 1

              
import os, struct
from suite_subprocess import suite_subprocess
import wiredtiger, wttest

# test_util07.py
#    Utilities: wt read
class test_util07(wttest.WiredTigerTestCase, suite_subprocess):
    tablename = 'test_util07.a'

            

Reported by Pylint.

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

Line: 31 Column: 1

              
import os, struct
from suite_subprocess import suite_subprocess
import wiredtiger, wttest

# test_util07.py
#    Utilities: wt read
class test_util07(wttest.WiredTigerTestCase, suite_subprocess):
    tablename = 'test_util07.a'

            

Reported by Pylint.

src/third_party/tomcrypt-1.18.2/src/headers/tomcrypt_cipher.h
14 issues
char - Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues
Security

Line: 37 Column: 13 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

              
#ifdef LTC_SAFERP
struct saferp_key {
   unsigned char K[33][16];
   long rounds;
};
#endif

#ifdef LTC_RIJNDAEL

            

Reported by FlawFinder.

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

Line: 77 Column: 16 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

              #else
   struct twofish_key {
      ulong32 K[40];
      unsigned char S[32], start;
   };
#endif
#endif

#ifdef LTC_SAFER

            

Reported by FlawFinder.

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

Line: 90 Column: 18 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 LTC_SAFER_MAX_NOF_ROUNDS            13
#define LTC_SAFER_BLOCK_LEN                  8
#define LTC_SAFER_KEY_LEN     (1 + LTC_SAFER_BLOCK_LEN * (1 + 2 * LTC_SAFER_MAX_NOF_ROUNDS))
typedef unsigned char safer_block_t[LTC_SAFER_BLOCK_LEN];
typedef unsigned char safer_key_t[LTC_SAFER_KEY_LEN];
struct safer_key { safer_key_t key; };
#endif

#ifdef LTC_RC2

            

Reported by FlawFinder.

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

Line: 91 Column: 18 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 LTC_SAFER_BLOCK_LEN                  8
#define LTC_SAFER_KEY_LEN     (1 + LTC_SAFER_BLOCK_LEN * (1 + 2 * LTC_SAFER_MAX_NOF_ROUNDS))
typedef unsigned char safer_block_t[LTC_SAFER_BLOCK_LEN];
typedef unsigned char safer_key_t[LTC_SAFER_KEY_LEN];
struct safer_key { safer_key_t key; };
#endif

#ifdef LTC_RC2
struct rc2_key { unsigned xkey[64]; };

            

Reported by FlawFinder.

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

Line: 123 Column: 14 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

              
#ifdef LTC_SKIPJACK
struct skipjack_key {
    unsigned char key[10];
};
#endif

#ifdef LTC_KHAZAD
struct khazad_key {

            

Reported by FlawFinder.

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

Line: 241 Column: 13 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

                 /** The padding offset */
                       padlen;
   /** The current IV */
   unsigned char       IV[MAXBLOCKSIZE],
   /** The pad used to encrypt/decrypt */
                       pad[MAXBLOCKSIZE];
   /** The scheduled key */
   symmetric_key       key;
} symmetric_CFB;

            

Reported by FlawFinder.

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

Line: 259 Column: 13 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

                 /** The padding offset */
                       padlen;
   /** The current IV */
   unsigned char       IV[MAXBLOCKSIZE];
   /** The scheduled key */
   symmetric_key       key;
} symmetric_OFB;
#endif


            

Reported by FlawFinder.

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

Line: 273 Column: 13 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

                 /** The block size of the given cipher */
                       blocklen;
   /** The current IV */
   unsigned char       IV[MAXBLOCKSIZE];
   /** The scheduled key */
   symmetric_key       key;
} symmetric_CBC;
#endif


            

Reported by FlawFinder.

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

Line: 295 Column: 13 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

                                     ctrlen;

   /** The counter */
   unsigned char       ctr[MAXBLOCKSIZE],
   /** The pad used to encrypt/decrypt */
                       pad[MAXBLOCKSIZE];
   /** The scheduled key */
   symmetric_key       key;
} symmetric_CTR;

            

Reported by FlawFinder.

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

Line: 311 Column: 14 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

                  int               cipher;

    /** The current IV */
    unsigned char     IV[16],

    /** the tweak key */
                      tweak[16],

    /** The current pad, it's the product of the first 15 bytes against the tweak key */

            

Reported by FlawFinder.

src/third_party/wiredtiger/test/suite/test_metadata_cursor01.py
14 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_metadata_cursor01.py
#    Metadata cursor operations
# Basic smoke-test of metadata cursor: test backward and forward iteration

            

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_metadata_cursor01.py
#    Metadata cursor operations
# Basic smoke-test of metadata cursor: test backward and forward iteration

            

Reported by Pylint.

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

Line: 36 Column: 1

              #    Metadata cursor operations
# Basic smoke-test of metadata cursor: test backward and forward iteration
# as well as search.
class test_metadata_cursor01(wttest.WiredTigerTestCase):
    """
    Test basic operations
    """
    table_name1 = 'test_metadata_cursor01'


            

Reported by Pylint.

Missing function or method docstring
Error

Line: 47 Column: 5

                      ('create', {'metauri' : 'metadata:create'}),
    ])

    def genkey(self, i):
        if self.tablekind == 'row':
            return 'key' + str(i)
        else:
            return self.recno(i+1)


            

Reported by Pylint.

Unnecessary "else" after "return"
Error

Line: 48 Column: 9

                  ])

    def genkey(self, i):
        if self.tablekind == 'row':
            return 'key' + str(i)
        else:
            return self.recno(i+1)

    def genvalue(self, i):

            

Reported by Pylint.

Missing function or method docstring
Error

Line: 53 Column: 5

                      else:
            return self.recno(i+1)

    def genvalue(self, i):
        if self.tablekind == 'fix':
            return int(i & 0xff)
        else:
            return 'value' + str(i)


            

Reported by Pylint.

Unnecessary "else" after "return"
Error

Line: 54 Column: 9

                          return self.recno(i+1)

    def genvalue(self, i):
        if self.tablekind == 'fix':
            return int(i & 0xff)
        else:
            return 'value' + str(i)

    def assertCursorHasNoKeyValue(self, cursor):

            

Reported by Pylint.

Method name "assertCursorHasNoKeyValue" doesn't conform to snake_case naming style
Error

Line: 59 Column: 5

                      else:
            return 'value' + str(i)

    def assertCursorHasNoKeyValue(self, cursor):
        keymsg = '/requires key be set/'
        valuemsg = '/requires value be set/'
        self.assertRaisesWithMessage(
            wiredtiger.WiredTigerError, cursor.get_key, keymsg)
        self.assertRaisesWithMessage(

            

Reported by Pylint.

Missing function or method docstring
Error

Line: 59 Column: 5

                      else:
            return 'value' + str(i)

    def assertCursorHasNoKeyValue(self, cursor):
        keymsg = '/requires key be set/'
        valuemsg = '/requires value be set/'
        self.assertRaisesWithMessage(
            wiredtiger.WiredTigerError, cursor.get_key, keymsg)
        self.assertRaisesWithMessage(

            

Reported by Pylint.

src/third_party/wiredtiger/test/suite/test_prepare02.py
14 issues
Unable to import 'wiredtiger'
Error

Line: 34 Column: 1

              #

from suite_subprocess import suite_subprocess
import wiredtiger, wttest

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

    def test_prepare_session_operations(self):

            

Reported by Pylint.

Lambda may not be necessary
Error

Line: 52 Column: 13

                      # The operations are listed in the same order as they are declared in the session structure.
        # WT_SESSION.close permitted.
        self.assertRaisesWithMessage(wiredtiger.WiredTigerError,
            lambda:self.session.reconfigure(), msg)
        # WT_SESSION.strerror permitted, but currently broken in the Python API (WT-5399).
        self.assertRaisesWithMessage(wiredtiger.WiredTigerError,
            lambda: self.session.open_cursor("table:mytable", None), msg)
        self.assertRaisesWithMessage(wiredtiger.WiredTigerError,
            lambda: self.session.alter("table:mytable", "access_pattern_hint=random"), msg)

            

Reported by Pylint.

Lambda may not be necessary
Error

Line: 72 Column: 13

                      self.assertRaisesWithMessage(wiredtiger.WiredTigerError,
            lambda: self.session.rename("table:mytable", "table:mynewtable", None), msg)
        self.assertRaisesWithMessage(wiredtiger.WiredTigerError,
            lambda:self.session.reset(), msg)
        self.assertRaisesWithMessage(wiredtiger.WiredTigerError,
            lambda: self.session.salvage("table:mytable", None), msg)
        self.assertRaisesWithMessage(wiredtiger.WiredTigerError,
            lambda: self.session.truncate("table:mytable", None, None, None), msg)
        self.assertRaisesWithMessage(wiredtiger.WiredTigerError,

            

Reported by Pylint.

Lambda may not be necessary
Error

Line: 82 Column: 13

                      self.assertRaisesWithMessage(wiredtiger.WiredTigerError,
            lambda: self.session.verify("table:mytable", None), msg)
        self.assertRaisesWithMessage(wiredtiger.WiredTigerError,
            lambda:self.session.begin_transaction(), msg)
        # WT_SESSION.commit_transaction permitted, tested below.
        self.assertRaisesWithMessage(wiredtiger.WiredTigerError,
            lambda:self.session.prepare_transaction("prepare_timestamp=2a"), msg)
        # WT_SESSION.rollback_transaction permitted, tested below.
        self.session.timestamp_transaction("commit_timestamp=2b")

            

Reported by Pylint.

Lambda may not be necessary
Error

Line: 90 Column: 13

                      self.session.timestamp_transaction("commit_timestamp=2b")
        self.assertTimestampsEqual(self.session.query_timestamp('get=prepare'), '2a')
        self.assertRaisesWithMessage(wiredtiger.WiredTigerError,
            lambda:self.session.checkpoint(), msg)
        self.session.breakpoint()

        # Commit the transaction. Test that no "not permitted in a prepared transaction" error has
        # set a transaction error flag, that is, we should still be able to commit successfully.
        self.session.timestamp_transaction("commit_timestamp=2b")

            

Reported by Pylint.

Unused variable 'c1'
Error

Line: 101 Column: 9

              
        # Commit after prepare is permitted.
        self.session.begin_transaction()
        c1 = self.session.open_cursor("table:mytable", None)
        self.session.prepare_transaction("prepare_timestamp=2a")
        self.session.timestamp_transaction("commit_timestamp=2b")
        self.session.timestamp_transaction("durable_timestamp=2b")
        self.session.commit_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.

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

Line: 34 Column: 1

              #

from suite_subprocess import suite_subprocess
import wiredtiger, wttest

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

    def test_prepare_session_operations(self):

            

Reported by Pylint.

Multiple imports on one line (wiredtiger, wttest)
Error

Line: 34 Column: 1

              #

from suite_subprocess import suite_subprocess
import wiredtiger, wttest

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

    def test_prepare_session_operations(self):

            

Reported by Pylint.

Missing class docstring
Error

Line: 36 Column: 1

              from suite_subprocess import suite_subprocess
import wiredtiger, wttest

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

    def test_prepare_session_operations(self):

        # Test the session methods forbidden after the transaction is prepared.

            

Reported by Pylint.

src/third_party/abseil-cpp-master/abseil-cpp/absl/flags/parse.cc
14 issues
StrCat - Does not check for buffer overflows when concatenating to destination [MS-banned]
Security

Line: 177 Column: 15 CWE codes: 120

              
  if (!flag_file) {
    flags_internal::ReportUsageError(
        absl::StrCat("Can't open flagfile ", flag_file_name), true);

    return false;
  }

  // This argument represents fake argv[0], which should be present in all arg

            

Reported by FlawFinder.

StrCat - Does not check for buffer overflows when concatenating to destination [MS-banned]
Security

Line: 211 Column: 15 CWE codes: 120

                  }

    flags_internal::ReportUsageError(
        absl::StrCat("Unexpected line in the flagfile ", flag_file_name, ": ",
                     line),
        true);

    success = false;
  }

            

Reported by FlawFinder.

StrCat - Does not check for buffer overflows when concatenating to destination [MS-banned]
Security

Line: 367 Column: 17 CWE codes: 120

                  // Avoid infinite recursion.
    if (flag_name == "fromenv" || flag_name == "tryfromenv") {
      flags_internal::ReportUsageError(
          absl::StrCat("Infinite recursion on flag ", flag_name), true);

      success = false;
      continue;
    }


            

Reported by FlawFinder.

StrCat - Does not check for buffer overflows when concatenating to destination [MS-banned]
Security

Line: 373 Column: 39 CWE codes: 120

                    continue;
    }

    const std::string envname = absl::StrCat("FLAGS_", flag_name);
    std::string envval;
    if (!GetEnvVar(envname.c_str(), envval)) {
      if (fail_on_absent_in_env) {
        flags_internal::ReportUsageError(
            absl::StrCat(envname, " not found in environment"), true);

            

Reported by FlawFinder.

StrCat - Does not check for buffer overflows when concatenating to destination [MS-banned]
Security

Line: 378 Column: 19 CWE codes: 120

                  if (!GetEnvVar(envname.c_str(), envval)) {
      if (fail_on_absent_in_env) {
        flags_internal::ReportUsageError(
            absl::StrCat(envname, " not found in environment"), true);

        success = false;
      }

      continue;

            

Reported by FlawFinder.

StrCat - Does not check for buffer overflows when concatenating to destination [MS-banned]
Security

Line: 386 Column: 26 CWE codes: 120

                    continue;
    }

    args.push_back(absl::StrCat("--", flag_name, "=", envval));
  }

  if (success) {
    input_args.emplace_back(args);
  }

            

Reported by FlawFinder.

StrCat - Does not check for buffer overflows when concatenating to destination [MS-banned]
Security

Line: 517 Column: 19 CWE codes: 120

                    if (is_empty_value) {
        // "--bool_flag=" case
        flags_internal::ReportUsageError(
            absl::StrCat(
                "Missing the value after assignment for the boolean flag '",
                flag.Name(), "'"),
            true);
        return std::make_tuple(false, "");
      }

            

Reported by FlawFinder.

StrCat - Does not check for buffer overflows when concatenating to destination [MS-banned]
Security

Line: 529 Column: 17 CWE codes: 120

                  } else if (is_negative) {
      // "--nobool_flag=Y" case
      flags_internal::ReportUsageError(
          absl::StrCat("Negative form with assignment is not valid for the "
                       "boolean flag '",
                       flag.Name(), "'"),
          true);
      return std::make_tuple(false, "");
    }

            

Reported by FlawFinder.

StrCat - Does not check for buffer overflows when concatenating to destination [MS-banned]
Security

Line: 538 Column: 15 CWE codes: 120

                } else if (is_negative) {
    // "--noint_flag=1" case
    flags_internal::ReportUsageError(
        absl::StrCat("Negative form is not valid for the flag '", flag.Name(),
                     "'"),
        true);
    return std::make_tuple(false, "");
  } else if (value.empty() && (!is_empty_value)) {
    if (curr_list->Size() == 1) {

            

Reported by FlawFinder.

StrCat - Does not check for buffer overflows when concatenating to destination [MS-banned]
Security

Line: 546 Column: 17 CWE codes: 120

                  if (curr_list->Size() == 1) {
      // "--int_flag" case
      flags_internal::ReportUsageError(
          absl::StrCat("Missing the value for the flag '", flag.Name(), "'"),
          true);
      return std::make_tuple(false, "");
    }

    // "--int_flag" "10" case

            

Reported by FlawFinder.

src/third_party/wiredtiger/test/suite/test_alter01.py
14 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_alter01.py
#    Smoke-test the session alter operations.
class test_alter01(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 wiredtiger, wttest
from wtscenario import make_scenarios

# test_alter01.py
#    Smoke-test the session alter operations.
class test_alter01(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 wtscenario import make_scenarios

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

            

Reported by Pylint.

Missing class docstring
Error

Line: 34 Column: 1

              
# test_alter01.py
#    Smoke-test the session alter operations.
class test_alter01(wttest.WiredTigerTestCase):
    name = "alter01"
    entries = 100
    # Settings for access_pattern_hint
    types = [
        ('file', dict(uri='file:', use_cg=False, use_index=False)),

            

Reported by Pylint.

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

Line: 34 Column: 1

              
# test_alter01.py
#    Smoke-test the session alter operations.
class test_alter01(wttest.WiredTigerTestCase):
    name = "alter01"
    entries = 100
    # Settings for access_pattern_hint
    types = [
        ('file', dict(uri='file:', use_cg=False, use_index=False)),

            

Reported by Pylint.

Missing function or method docstring
Error

Line: 65 Column: 5

                  cache_alter=('', 'false', 'true')
    scenarios = make_scenarios(types, hints, resid, reopen)

    def verify_metadata(self, metastr):
        if metastr == '':
            return
        cursor = self.session.open_cursor('metadata:', None, None)
        #
        # Walk through all the metadata looking for the entries that are

            

Reported by Pylint.

Comparison 'found == True' should be 'found is True' if checking for the singleton value True, or 'bool(found)' if testing for truthiness
Error

Line: 86 Column: 25

                              found = True
                self.assertTrue(value.find(metastr) != -1)
        cursor.close()
        self.assertTrue(found == True)

    # Alter: Change the access pattern hint after creation
    def test_alter01_access(self):
        uri = self.uri + self.name
        create_params = 'key_format=i,value_format=i,'

            

Reported by Pylint.

Too many statements (55/50)
Error

Line: 89 Column: 5

                      self.assertTrue(found == True)

    # Alter: Change the access pattern hint after creation
    def test_alter01_access(self):
        uri = self.uri + self.name
        create_params = 'key_format=i,value_format=i,'
        complex_params = ''
        #
        # If we're not explicitly setting the parameter, then don't

            

Reported by Pylint.

Too many branches (17/12)
Error

Line: 89 Column: 5

                      self.assertTrue(found == True)

    # Alter: Change the access pattern hint after creation
    def test_alter01_access(self):
        uri = self.uri + self.name
        create_params = 'key_format=i,value_format=i,'
        complex_params = ''
        #
        # If we're not explicitly setting the parameter, then don't

            

Reported by Pylint.

src/third_party/wiredtiger/test/suite/test_compact01.py
14 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 suite_subprocess import suite_subprocess
from wtdataset import SimpleDataSet, ComplexDataSet
from wiredtiger import stat
from wtscenario import make_scenarios


            

Reported by Pylint.

Unable to import 'wiredtiger'
Error

Line: 32 Column: 1

              import wiredtiger, wttest
from suite_subprocess import suite_subprocess
from wtdataset import SimpleDataSet, ComplexDataSet
from wiredtiger import stat
from wtscenario import make_scenarios

# test_compact.py
#    session level compact operation
class test_compact(wttest.WiredTigerTestCase, suite_subprocess):

            

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 suite_subprocess import suite_subprocess
from wtdataset import SimpleDataSet, ComplexDataSet
from wiredtiger import stat
from wtscenario import make_scenarios


            

Reported by Pylint.

FIXME-WT-7187
Error

Line: 65 Column: 3

              
    # Test compaction.
    def test_compact(self):
        # FIXME-WT-7187
        # This test is temporarily disabled for OS/X, it fails often, but not consistently.
        import platform
        if platform.system() == 'Darwin':
            self.skipTest('Compaction tests skipped, as they fail on OS/X')


            

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 suite_subprocess import suite_subprocess
from wtdataset import SimpleDataSet, ComplexDataSet
from wiredtiger import stat
from wtscenario import make_scenarios


            

Reported by Pylint.

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

Line: 32 Column: 1

              import wiredtiger, wttest
from suite_subprocess import suite_subprocess
from wtdataset import SimpleDataSet, ComplexDataSet
from wiredtiger import stat
from wtscenario import make_scenarios

# test_compact.py
#    session level compact operation
class test_compact(wttest.WiredTigerTestCase, suite_subprocess):

            

Reported by Pylint.

Missing class docstring
Error

Line: 37 Column: 1

              
# test_compact.py
#    session level compact operation
class test_compact(wttest.WiredTigerTestCase, suite_subprocess):
    name = 'test_compact'

    # Use a small page size because we want to create lots of pages.
    config = 'allocation_size=512,' +\
        'leaf_page_max=512,key_format=S'

            

Reported by Pylint.

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

Line: 37 Column: 1

              
# test_compact.py
#    session level compact operation
class test_compact(wttest.WiredTigerTestCase, suite_subprocess):
    name = 'test_compact'

    # Use a small page size because we want to create lots of pages.
    config = 'allocation_size=512,' +\
        'leaf_page_max=512,key_format=S'

            

Reported by Pylint.

Missing function or method docstring
Error

Line: 64 Column: 5

                      'eviction_dirty_target=80,eviction_dirty_trigger=95,statistics=(all)'

    # Test compaction.
    def test_compact(self):
        # FIXME-WT-7187
        # This test is temporarily disabled for OS/X, it fails often, but not consistently.
        import platform
        if platform.system() == 'Darwin':
            self.skipTest('Compaction tests skipped, as they fail on OS/X')

            

Reported by Pylint.