The following issues were found

src/third_party/wiredtiger/test/suite/test_hs07.py
18 issues
Unable to import 'wiredtiger'
Error

Line: 31 Column: 1

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

# test_hs07.py
# Test that the history store sweep cleans the obsolete history store entries and gives expected results.

            

Reported by Pylint.

Unused copy_wiredtiger_home imported from helper
Error

Line: 30 Column: 1

              # OTHER DEALINGS IN THE SOFTWARE.

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

# test_hs07.py

            

Reported by Pylint.

Unused variable 'k'
Error

Line: 64 Column: 13

                      session.begin_transaction('read_timestamp=' + self.timestamp_str(read_ts))
        cursor = session.open_cursor(uri)
        count = 0
        for k, v in cursor:
            self.assertEqual(v, check_value)
            count += 1
        session.rollback_transaction()
        self.assertEqual(count, nrows)


            

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

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

# test_hs07.py
# Test that the history store sweep cleans the obsolete history store entries and gives expected results.

            

Reported by Pylint.

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

Line: 31 Column: 1

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

# test_hs07.py
# Test that the history store sweep cleans the obsolete history store entries and gives expected results.

            

Reported by Pylint.

Line too long (105/100)
Error

Line: 36 Column: 1

              from wtscenario import make_scenarios

# test_hs07.py
# Test that the history store sweep cleans the obsolete history store entries and gives expected results.
class test_hs07(wttest.WiredTigerTestCase):
    # Force a small cache.
    conn_config = ('cache_size=50MB,eviction_updates_trigger=95,'
                   'eviction_updates_target=80,log=(enabled)')
    session_config = 'isolation=snapshot'

            

Reported by Pylint.

Missing class docstring
Error

Line: 37 Column: 1

              
# test_hs07.py
# Test that the history store sweep cleans the obsolete history store entries and gives expected results.
class test_hs07(wttest.WiredTigerTestCase):
    # Force a small cache.
    conn_config = ('cache_size=50MB,eviction_updates_trigger=95,'
                   'eviction_updates_target=80,log=(enabled)')
    session_config = 'isolation=snapshot'


            

Reported by Pylint.

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

Line: 37 Column: 1

              
# test_hs07.py
# Test that the history store sweep cleans the obsolete history store entries and gives expected results.
class test_hs07(wttest.WiredTigerTestCase):
    # Force a small cache.
    conn_config = ('cache_size=50MB,eviction_updates_trigger=95,'
                   'eviction_updates_target=80,log=(enabled)')
    session_config = 'isolation=snapshot'


            

Reported by Pylint.

Too many arguments (6/5)
Error

Line: 49 Column: 5

                  )
    scenarios = make_scenarios(key_format_values)

    def large_updates(self, uri, value, ds, nrows, commit_ts):
        # Update a large number of records, we'll hang if the history store table isn't working.
        session = self.session
        cursor = session.open_cursor(uri)
        for i in range(1, nrows + 1):
            session.begin_transaction()

            

Reported by Pylint.

src/third_party/wiredtiger/test/suite/test_colgap.py
18 issues
Unable to import 'wiredtiger'
Error

Line: 29 Column: 1

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

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

# test_colgap.py
#    Test variable-length column-store gap performance.

            

Reported by Pylint.

Missing module docstring
Error

Line: 1 Column: 1

              #!/usr/bin/env python
#
# Public Domain 2014-present MongoDB, Inc.
# Public Domain 2008-2014 WiredTiger, Inc.
#
# This is free and unencumbered software released into the public domain.
#
# Anyone is free to copy, modify, publish, use, compile, sell, or
# distribute this software, either in source code form or as a compiled

            

Reported by Pylint.

Multiple imports on one line (wiredtiger, wttest)
Error

Line: 29 Column: 1

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

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

# test_colgap.py
#    Test variable-length column-store gap performance.

            

Reported by Pylint.

Missing class docstring
Error

Line: 35 Column: 1

              
# test_colgap.py
#    Test variable-length column-store gap performance.
class test_column_store_gap(wttest.WiredTigerTestCase):
    nentries = 13

    # Cursor forward
    def forward(self, cursor, expected):
        cursor.reset()

            

Reported by Pylint.

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

Line: 35 Column: 1

              
# test_colgap.py
#    Test variable-length column-store gap performance.
class test_column_store_gap(wttest.WiredTigerTestCase):
    nentries = 13

    # Cursor forward
    def forward(self, cursor, expected):
        cursor.reset()

            

Reported by Pylint.

Missing function or method docstring
Error

Line: 39 Column: 5

                  nentries = 13

    # Cursor forward
    def forward(self, cursor, expected):
        cursor.reset()
        i = 0
        while True:
            if cursor.next() != 0:
                break

            

Reported by Pylint.

Missing function or method docstring
Error

Line: 50 Column: 5

                      self.assertEqual(i, self.nentries)

    # Cursor backward
    def backward(self, cursor, expected):
        cursor.reset()
        i = 0
        while True:
            if cursor.prev() != 0:
                break

            

Reported by Pylint.

Missing function or method docstring
Error

Line: 62 Column: 5

              
    # Create a variable-length column-store table with really big gaps in the
    # namespace. If this runs in less-than-glacial time, it's working.
    def test_column_store_gap(self):
        uri = 'table:gap'
        # Initially just create tables.
        ds = SimpleDataSet(self, uri, 0, key_format='r')
        ds.populate()
        cursor = self.session.open_cursor(uri, None, None)

            

Reported by Pylint.

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

Line: 65 Column: 9

                  def test_column_store_gap(self):
        uri = 'table:gap'
        # Initially just create tables.
        ds = SimpleDataSet(self, uri, 0, key_format='r')
        ds.populate()
        cursor = self.session.open_cursor(uri, None, None)
        self.nentries = 0

        # Create a column-store table with large gaps in the name-space.

            

Reported by Pylint.

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

Line: 71 Column: 9

                      self.nentries = 0

        # Create a column-store table with large gaps in the name-space.
        v = [ 1000, 2000000000000, 30000000000000 ]
        for i in v:
            cursor[ds.key(i)] = ds.value(i)
            self.nentries += 1

        # In-memory cursor forward, backward.

            

Reported by Pylint.

src/third_party/wiredtiger/test/suite/test_salvage.py
18 issues
Unable to import 'wiredtiger'
Error

Line: 31 Column: 1

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

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

            

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_salvage.py
#    Utilities: wt salvage

            

Reported by Pylint.

Unused variable 'gotkey'
Error

Line: 104 Column: 13

              
    def check_empty_table(self, tablename):
        cursor = self.session.open_cursor('table:' + tablename, None, None)
        for gotkey, gotval in cursor:
            self.fail(tablename + ': has unexpected entries')
        cursor.close()

    def damage(self, tablename):
        self.damage_inner(tablename, self.unique.encode())

            

Reported by Pylint.

Unused variable 'gotval'
Error

Line: 104 Column: 21

              
    def check_empty_table(self, tablename):
        cursor = self.session.open_cursor('table:' + tablename, None, None)
        for gotkey, gotval in cursor:
            self.fail(tablename + ': has unexpected entries')
        cursor.close()

    def damage(self, tablename):
        self.damage_inner(tablename, self.unique.encode())

            

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_salvage.py
#    Utilities: wt salvage

            

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_salvage.py
#    Utilities: wt salvage
class test_salvage(wttest.WiredTigerTestCase, suite_subprocess):
    tablename = 'test_salvage.a'

            

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_salvage.py
#    Utilities: wt salvage
class test_salvage(wttest.WiredTigerTestCase, suite_subprocess):
    tablename = 'test_salvage.a'

            

Reported by Pylint.

Missing class docstring
Error

Line: 35 Column: 1

              
# test_salvage.py
#    Utilities: wt salvage
class test_salvage(wttest.WiredTigerTestCase, suite_subprocess):
    tablename = 'test_salvage.a'
    nentries = 1000
    session_params = 'key_format=S,value_format=S'
    unique = 'SomeUniqueString'


            

Reported by Pylint.

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

Line: 35 Column: 1

              
# test_salvage.py
#    Utilities: wt salvage
class test_salvage(wttest.WiredTigerTestCase, suite_subprocess):
    tablename = 'test_salvage.a'
    nentries = 1000
    session_params = 'key_format=S,value_format=S'
    unique = 'SomeUniqueString'


            

Reported by Pylint.

src/third_party/wiredtiger/test/suite/test_bug019.py
18 issues
Unable to import 'wiredtiger'
Error

Line: 30 Column: 1

              # OTHER DEALINGS IN THE SOFTWARE.

import fnmatch, os, time
import wiredtiger, wttest
from wiredtiger import stat
from wtdataset import SimpleDataSet

# test_bug019.py
#    Test that pre-allocating log files only pre-allocates a small number.

            

Reported by Pylint.

Unable to import 'wiredtiger'
Error

Line: 31 Column: 1

              
import fnmatch, os, time
import wiredtiger, wttest
from wiredtiger import stat
from wtdataset import SimpleDataSet

# test_bug019.py
#    Test that pre-allocating log files only pre-allocates a small number.
class test_bug019(wttest.WiredTigerTestCase):

            

Reported by Pylint.

Unused import wiredtiger
Error

Line: 30 Column: 1

              # OTHER DEALINGS IN THE SOFTWARE.

import fnmatch, os, time
import wiredtiger, wttest
from wiredtiger import stat
from wtdataset import SimpleDataSet

# test_bug019.py
#    Test that pre-allocating log files only pre-allocates a small number.

            

Reported by Pylint.

Unused SimpleDataSet imported from wtdataset
Error

Line: 32 Column: 1

              import fnmatch, os, time
import wiredtiger, wttest
from wiredtiger import stat
from wtdataset import SimpleDataSet

# test_bug019.py
#    Test that pre-allocating log files only pre-allocates a small number.
class test_bug019(wttest.WiredTigerTestCase):
    conn_config = 'log=(enabled,file_max=100K),statistics=(fast)'

            

Reported by Pylint.

Unused variable 'i'
Error

Line: 88 Column: 13

                  # Wait for a log file to be pre-allocated. Avoid timing problems, but
    # assert a file is created within 90 seconds.
    def prepfiles(self):
        for i in range(1,90):
            f = fnmatch.filter(os.listdir('.'), "*Prep*")
            if f:
                return
            time.sleep(1.0)
        self.fail('No pre-allocated files created after 90 seconds')

            

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 (fnmatch, os, time)
Error

Line: 29 Column: 1

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

import fnmatch, os, time
import wiredtiger, wttest
from wiredtiger import stat
from wtdataset import SimpleDataSet

# test_bug019.py

            

Reported by Pylint.

Multiple imports on one line (wiredtiger, wttest)
Error

Line: 30 Column: 1

              # OTHER DEALINGS IN THE SOFTWARE.

import fnmatch, os, time
import wiredtiger, wttest
from wiredtiger import stat
from wtdataset import SimpleDataSet

# test_bug019.py
#    Test that pre-allocating log files only pre-allocates a small number.

            

Reported by Pylint.

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

Line: 31 Column: 1

              
import fnmatch, os, time
import wiredtiger, wttest
from wiredtiger import stat
from wtdataset import SimpleDataSet

# test_bug019.py
#    Test that pre-allocating log files only pre-allocates a small number.
class test_bug019(wttest.WiredTigerTestCase):

            

Reported by Pylint.

Missing class docstring
Error

Line: 36 Column: 1

              
# test_bug019.py
#    Test that pre-allocating log files only pre-allocates a small number.
class test_bug019(wttest.WiredTigerTestCase):
    conn_config = 'log=(enabled,file_max=100K),statistics=(fast)'
    uri = "table:bug019"
    entries = 5000
    max_initial_entries = 50000
    max_prealloc = 1

            

Reported by Pylint.

src/third_party/wiredtiger/test/3rdparty/testtools-0.9.34/testtools/content.py
18 issues
Unable to import 'extras'
Error

Line: 22 Column: 1

              import sys
import traceback

from extras import try_import

from testtools.compat import (
    _b,
    _format_exception_only,
    _format_stack_list,

            

Reported by Pylint.

Undefined variable 'self'
Error

Line: 217 Column: 26

                      and isinstance(value, test.failureException)):
        # Skip assert*() traceback levels
        limit = 0
        while tb and not self._is_relevant_tb_level(tb):
            limit += 1
            tb = tb.tb_next

    prefix = _TB_HEADER
    stack_lines = traceback.extract_tb(tb, limit)

            

Reported by Pylint.

Unused import sys
Error

Line: 19 Column: 1

              import inspect
import json
import os
import sys
import traceback

from extras import try_import

from testtools.compat import (

            

Reported by Pylint.

Anomalous backslash in string: '\*'. String constant might be missing an r prefix.
Error

Line: 106 Column: 61

                      no charset parameter is present in the MIME type. (This is somewhat
        arbitrary, but consistent with RFC2617 3.7.1).

        :raises ValueError: If the content type is not text/\*.
        """
        if self.content_type.type != "text":
            raise ValueError("Not a text type %r" % self.content_type)
        return self._iter_text()


            

Reported by Pylint.

Redefining built-in 'bytes'
Error

Line: 118 Column: 17

                      try:
            # 2.5+
            decoder = codecs.getincrementaldecoder(encoding)()
            for bytes in self.iter_bytes():
                yield decoder.decode(bytes)
            final = decoder.decode(_b(''), True)
            if final:
                yield final
        except AttributeError:

            

Reported by Pylint.

Access to a protected member _is_relevant_tb_level of a client class
Error

Line: 217 Column: 26

                      and isinstance(value, test.failureException)):
        # Skip assert*() traceback levels
        limit = 0
        while tb and not self._is_relevant_tb_level(tb):
            limit += 1
            tb = tb.tb_next

    prefix = _TB_HEADER
    stack_lines = traceback.extract_tb(tb, limit)

            

Reported by Pylint.

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

Line: 62 Column: 1

                      chunk = stream.read(chunk_size)


class Content(object):
    """A MIME-like Content object.

    Content objects can be serialised to bytes using the iter_bytes method.
    If the Content-Type is recognised by other code, they are welcome to
    look for richer contents that mere byte serialisation - for example in

            

Reported by Pylint.

Consider using Python 3 style super() without arguments
Error

Line: 165 Column: 9

                      value = prefix_content + \
            self._stack_lines_to_unicode(stack_lines) + \
            postfix_content
        super(StackLinesContent, self).__init__(
            content_type, lambda: [value.encode("utf8")])

    def _stack_lines_to_unicode(self, stack_lines):
        """Converts a list of pre-processed stack lines into a unicode string.
        """

            

Reported by Pylint.

Method could be a function
Error

Line: 168 Column: 5

                      super(StackLinesContent, self).__init__(
            content_type, lambda: [value.encode("utf8")])

    def _stack_lines_to_unicode(self, stack_lines):
        """Converts a list of pre-processed stack lines into a unicode string.
        """

        # testtools customization. When str is unicode (e.g. IronPython,
        # Python 3), traceback.format_exception returns unicode. For Python 2,

            

Reported by Pylint.

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

Line: 185 Column: 1

                      return ''.join(msg_lines)


def TracebackContent(err, test):
    """Content object for tracebacks.

    This adapts an exc_info tuple to the Content interface.
    text/x-traceback;language=python is used for the mime type, in order to
    provide room for other languages to format their tracebacks differently.

            

Reported by Pylint.

src/third_party/wiredtiger/test/suite/test_stat09.py
18 issues
Unable to import 'wiredtiger'
Error

Line: 30 Column: 1

              # OTHER DEALINGS IN THE SOFTWARE.

import random
import wiredtiger, wttest

# test_stat09.py
#    Check oldest active read timestamp statistic
class test_stat09(wttest.WiredTigerTestCase):
    tablename = 'test_stat09'

            

Reported by Pylint.

Unused import wiredtiger
Error

Line: 30 Column: 1

              # OTHER DEALINGS IN THE SOFTWARE.

import random
import wiredtiger, wttest

# test_stat09.py
#    Check oldest active read timestamp statistic
class test_stat09(wttest.WiredTigerTestCase):
    tablename = 'test_stat09'

            

Reported by Pylint.

Redefining built-in 'id'
Error

Line: 63 Column: 13

              
        found = False
        foundval = 0
        for id, desc, valstr, val in statcursor:
            if desc == lookfor:
                found = True
                foundval = val
                self.printVerbose(2, '  stat: \'' + desc + '\', \'' +
                    valstr + '\', ' + str(val))

            

Reported by Pylint.

Unused variable 'id'
Error

Line: 63 Column: 13

              
        found = False
        foundval = 0
        for id, desc, valstr, val in statcursor:
            if desc == lookfor:
                found = True
                foundval = val
                self.printVerbose(2, '  stat: \'' + desc + '\', \'' +
                    valstr + '\', ' + str(val))

            

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

              # OTHER DEALINGS IN THE SOFTWARE.

import random
import wiredtiger, wttest

# test_stat09.py
#    Check oldest active read timestamp statistic
class test_stat09(wttest.WiredTigerTestCase):
    tablename = 'test_stat09'

            

Reported by Pylint.

Missing class docstring
Error

Line: 34 Column: 1

              
# test_stat09.py
#    Check oldest active read timestamp statistic
class test_stat09(wttest.WiredTigerTestCase):
    tablename = 'test_stat09'
    uri = 'table:' + tablename
    conn_config = 'statistics=(all)'
    session_config = 'isolation=snapshot'


            

Reported by Pylint.

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

Line: 34 Column: 1

              
# test_stat09.py
#    Check oldest active read timestamp statistic
class test_stat09(wttest.WiredTigerTestCase):
    tablename = 'test_stat09'
    uri = 'table:' + tablename
    conn_config = 'statistics=(all)'
    session_config = 'isolation=snapshot'


            

Reported by Pylint.

Missing function or method docstring
Error

Line: 41 Column: 5

                  session_config = 'isolation=snapshot'

    # Check the oldest active read statistic to be at the expected values
    def check_stat_oldest_read(self, statcursor, expected_oldest, all_committed):
        self.check_stats(statcursor, expected_oldest,
            'transaction: transaction read timestamp of the oldest active reader')

        # If the active oldest timestamp is 0, it implies there are no active readers,
        # the pinned range because of them is expected to be 0 in that case

            

Reported by Pylint.

Missing function or method docstring
Error

Line: 57 Column: 5

              
    # Do a quick check of the entries in the stats cursor, the "lookfor"
    # string should appear with the exact val of "expected_val".
    def check_stats(self, statcursor, expected_val, lookfor):
        # Reset the cursor, we're called multiple times.
        statcursor.reset()

        found = False
        foundval = 0

            

Reported by Pylint.

src/third_party/boost/boost/container/detail/copy_move_algo.hpp
18 issues
memcpy - Does not check for buffer overflows when copying to destination
Security

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

                 void *const large_ptr = static_cast<void*>(boost::movelib::iterator_to_raw_pointer(large_range_f));
   void *const short_ptr = static_cast<void*>(boost::movelib::iterator_to_raw_pointer(short_range_f));
   void *const stora_ptr = static_cast<void*>(boost::movelib::iterator_to_raw_pointer(storage.data));
   std::memcpy(stora_ptr, large_ptr, n_i_bytes);
   std::memcpy(large_ptr, short_ptr, n_i_bytes);
   std::memcpy(short_ptr, stora_ptr, n_i_bytes);
   boost::container::iterator_advance(large_range_f, n_i);
   boost::container::iterator_advance(short_range_f, n_i);
   boost::container::uninitialized_move_alloc_n(a, large_range_f, n_j - n_i, short_range_f);  // may throw

            

Reported by FlawFinder.

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

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

                 void *const short_ptr = static_cast<void*>(boost::movelib::iterator_to_raw_pointer(short_range_f));
   void *const stora_ptr = static_cast<void*>(boost::movelib::iterator_to_raw_pointer(storage.data));
   std::memcpy(stora_ptr, large_ptr, n_i_bytes);
   std::memcpy(large_ptr, short_ptr, n_i_bytes);
   std::memcpy(short_ptr, stora_ptr, n_i_bytes);
   boost::container::iterator_advance(large_range_f, n_i);
   boost::container::iterator_advance(short_range_f, n_i);
   boost::container::uninitialized_move_alloc_n(a, large_range_f, n_j - n_i, short_range_f);  // may throw
   boost::container::destroy_alloc_n(a, large_range_f, n_j - n_i);

            

Reported by FlawFinder.

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

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

                 void *const stora_ptr = static_cast<void*>(boost::movelib::iterator_to_raw_pointer(storage.data));
   std::memcpy(stora_ptr, large_ptr, n_i_bytes);
   std::memcpy(large_ptr, short_ptr, n_i_bytes);
   std::memcpy(short_ptr, stora_ptr, n_i_bytes);
   boost::container::iterator_advance(large_range_f, n_i);
   boost::container::iterator_advance(short_range_f, n_i);
   boost::container::uninitialized_move_alloc_n(a, large_range_f, n_j - n_i, short_range_f);  // may throw
   boost::container::destroy_alloc_n(a, large_range_f, n_j - n_i);
}

            

Reported by FlawFinder.

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

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

                    case 4:
         break;
      case 0: do{
         std::memcpy(stora_ptr, large_ptr, sizeof_storage);
         std::memcpy(large_ptr, short_ptr, sizeof_storage);
         std::memcpy(short_ptr, stora_ptr, sizeof_storage);
         large_ptr += sizeof_storage;
         short_ptr += sizeof_storage;
         BOOST_FALLTHROUGH;

            

Reported by FlawFinder.

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

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

                       break;
      case 0: do{
         std::memcpy(stora_ptr, large_ptr, sizeof_storage);
         std::memcpy(large_ptr, short_ptr, sizeof_storage);
         std::memcpy(short_ptr, stora_ptr, sizeof_storage);
         large_ptr += sizeof_storage;
         short_ptr += sizeof_storage;
         BOOST_FALLTHROUGH;
      case 3:

            

Reported by FlawFinder.

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

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

                    case 0: do{
         std::memcpy(stora_ptr, large_ptr, sizeof_storage);
         std::memcpy(large_ptr, short_ptr, sizeof_storage);
         std::memcpy(short_ptr, stora_ptr, sizeof_storage);
         large_ptr += sizeof_storage;
         short_ptr += sizeof_storage;
         BOOST_FALLTHROUGH;
      case 3:
         std::memcpy(stora_ptr, large_ptr, sizeof_storage);

            

Reported by FlawFinder.

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

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

                       short_ptr += sizeof_storage;
         BOOST_FALLTHROUGH;
      case 3:
         std::memcpy(stora_ptr, large_ptr, sizeof_storage);
         std::memcpy(large_ptr, short_ptr, sizeof_storage);
         std::memcpy(short_ptr, stora_ptr, sizeof_storage);
         large_ptr += sizeof_storage;
         short_ptr += sizeof_storage;
         BOOST_FALLTHROUGH;

            

Reported by FlawFinder.

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

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

                       BOOST_FALLTHROUGH;
      case 3:
         std::memcpy(stora_ptr, large_ptr, sizeof_storage);
         std::memcpy(large_ptr, short_ptr, sizeof_storage);
         std::memcpy(short_ptr, stora_ptr, sizeof_storage);
         large_ptr += sizeof_storage;
         short_ptr += sizeof_storage;
         BOOST_FALLTHROUGH;
      case 2:

            

Reported by FlawFinder.

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

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

                    case 3:
         std::memcpy(stora_ptr, large_ptr, sizeof_storage);
         std::memcpy(large_ptr, short_ptr, sizeof_storage);
         std::memcpy(short_ptr, stora_ptr, sizeof_storage);
         large_ptr += sizeof_storage;
         short_ptr += sizeof_storage;
         BOOST_FALLTHROUGH;
      case 2:
         std::memcpy(stora_ptr, large_ptr, sizeof_storage);

            

Reported by FlawFinder.

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

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

                       short_ptr += sizeof_storage;
         BOOST_FALLTHROUGH;
      case 2:
         std::memcpy(stora_ptr, large_ptr, sizeof_storage);
         std::memcpy(large_ptr, short_ptr, sizeof_storage);
         std::memcpy(short_ptr, stora_ptr, sizeof_storage);
         large_ptr += sizeof_storage;
         short_ptr += sizeof_storage;
         BOOST_FALLTHROUGH;

            

Reported by FlawFinder.

src/third_party/wiredtiger/test/suite/test_home.py
18 issues
Unable to import 'wiredtiger'
Error

Line: 30 Column: 1

              # OTHER DEALINGS IN THE SOFTWARE.

import os
import wiredtiger, wttest

# test_isnew
#    database is-new method
class test_isnew(wttest.WiredTigerTestCase):


            

Reported by Pylint.

Unused import wiredtiger
Error

Line: 30 Column: 1

              # OTHER DEALINGS IN THE SOFTWARE.

import os
import wiredtiger, wttest

# test_isnew
#    database is-new method
class test_isnew(wttest.WiredTigerTestCase):


            

Reported by Pylint.

Using deprecated method assertEquals()
Error

Line: 39 Column: 9

                  # Test is-new of a connection.
    def test_isnew(self):
        # We just created a connection, is_new should return True.
        self.assertEquals(self.conn.is_new(), True)

        # Close and re-open the connection, is_new should return False.
        self.conn.close()
        self.conn = self.setUpConnectionOpen(".")
        self.assertEquals(self.conn.is_new(), False)

            

Reported by Pylint.

Using deprecated method assertEquals()
Error

Line: 44 Column: 9

                      # Close and re-open the connection, is_new should return False.
        self.conn.close()
        self.conn = self.setUpConnectionOpen(".")
        self.assertEquals(self.conn.is_new(), False)

# test_gethome
#    database get-home method
class test_gethome(wttest.WiredTigerTestCase):


            

Reported by Pylint.

Using deprecated method assertEquals()
Error

Line: 52 Column: 9

              
    # Test gethome of a connection, the initially created one is ".".
    def test_gethome_default(self):
        self.assertEquals(self.conn.get_home(), '.')

    # Create a new database directory, open it and check its name.
    def test_gethome_new(self):
        name = 'new_database'
        os.mkdir(name)

            

Reported by Pylint.

Using deprecated method assertEquals()
Error

Line: 60 Column: 9

                      os.mkdir(name)
        self.conn.close()
        self.conn = self.setUpConnectionOpen(name)
        self.assertEquals(self.conn.get_home(), name)

# test_base_config
#       test base configuration file config.
class test_base_config(wttest.WiredTigerTestCase):
    def test_base_config(self):

            

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

              # OTHER DEALINGS IN THE SOFTWARE.

import os
import wiredtiger, wttest

# test_isnew
#    database is-new method
class test_isnew(wttest.WiredTigerTestCase):


            

Reported by Pylint.

Missing class docstring
Error

Line: 34 Column: 1

              
# test_isnew
#    database is-new method
class test_isnew(wttest.WiredTigerTestCase):

    # Test is-new of a connection.
    def test_isnew(self):
        # We just created a connection, is_new should return True.
        self.assertEquals(self.conn.is_new(), True)

            

Reported by Pylint.

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

Line: 34 Column: 1

              
# test_isnew
#    database is-new method
class test_isnew(wttest.WiredTigerTestCase):

    # Test is-new of a connection.
    def test_isnew(self):
        # We just created a connection, is_new should return True.
        self.assertEquals(self.conn.is_new(), True)

            

Reported by Pylint.

src/third_party/wiredtiger/test/suite/test_rollback_to_stable20.py
18 issues
Unable to import 'wiredtiger'
Error

Line: 31 Column: 1

              
import time
from helper import copy_wiredtiger_home
import wiredtiger, wttest
from wtdataset import SimpleDataSet
from wtscenario import make_scenarios
from wiredtiger import stat
from helper import simulate_crash_restart
from test_rollback_to_stable01 import test_rollback_to_stable_base

            

Reported by Pylint.

Unable to import 'wiredtiger'
Error

Line: 34 Column: 1

              import wiredtiger, wttest
from wtdataset import SimpleDataSet
from wtscenario import make_scenarios
from wiredtiger import stat
from helper import simulate_crash_restart
from test_rollback_to_stable01 import test_rollback_to_stable_base

# Test that rollback to stable does not open any dhandles that don't have unstable updates.
class test_rollback_to_stable20(test_rollback_to_stable_base):

            

Reported by Pylint.

An attribute defined in wttest line 401 hides this method
Error

Line: 49 Column: 5

              
    scenarios = make_scenarios(key_format_values)

    def conn_config(self):
        config = 'cache_size=50MB,statistics=(all)'
        return config

    def test_rollback_to_stable(self):
        nrows = 10000

            

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
from helper import copy_wiredtiger_home
import wiredtiger, wttest
from wtdataset import SimpleDataSet
from wtscenario import make_scenarios
from wiredtiger import stat

            

Reported by Pylint.

Unused copy_wiredtiger_home imported from helper
Error

Line: 30 Column: 1

              # OTHER DEALINGS IN THE SOFTWARE.

import time
from helper import copy_wiredtiger_home
import wiredtiger, wttest
from wtdataset import SimpleDataSet
from wtscenario import make_scenarios
from wiredtiger import stat
from helper import simulate_crash_restart

            

Reported by Pylint.

Unused import wiredtiger
Error

Line: 31 Column: 1

              
import time
from helper import copy_wiredtiger_home
import wiredtiger, wttest
from wtdataset import SimpleDataSet
from wtscenario import make_scenarios
from wiredtiger import stat
from helper import simulate_crash_restart
from test_rollback_to_stable01 import test_rollback_to_stable_base

            

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 helper import copy_wiredtiger_home"
Error

Line: 31 Column: 1

              
import time
from helper import copy_wiredtiger_home
import wiredtiger, wttest
from wtdataset import SimpleDataSet
from wtscenario import make_scenarios
from wiredtiger import stat
from helper import simulate_crash_restart
from test_rollback_to_stable01 import test_rollback_to_stable_base

            

Reported by Pylint.

Multiple imports on one line (wiredtiger, wttest)
Error

Line: 31 Column: 1

              
import time
from helper import copy_wiredtiger_home
import wiredtiger, wttest
from wtdataset import SimpleDataSet
from wtscenario import make_scenarios
from wiredtiger import stat
from helper import simulate_crash_restart
from test_rollback_to_stable01 import test_rollback_to_stable_base

            

Reported by Pylint.

third party import "from wiredtiger import stat" should be placed before "from helper import copy_wiredtiger_home"
Error

Line: 34 Column: 1

              import wiredtiger, wttest
from wtdataset import SimpleDataSet
from wtscenario import make_scenarios
from wiredtiger import stat
from helper import simulate_crash_restart
from test_rollback_to_stable01 import test_rollback_to_stable_base

# Test that rollback to stable does not open any dhandles that don't have unstable updates.
class test_rollback_to_stable20(test_rollback_to_stable_base):

            

Reported by Pylint.

src/third_party/wiredtiger/test/suite/test_jsondump01.py
18 issues
Unable to import 'wiredtiger'
Error

Line: 30 Column: 1

              # OTHER DEALINGS IN THE SOFTWARE.

import os, json
import wiredtiger, wttest
from wtdataset import SimpleDataSet, SimpleLSMDataSet, SimpleIndexDataSet, \
    ComplexDataSet, ComplexLSMDataSet
from helper import compare_files
from suite_subprocess import suite_subprocess
from wtscenario import make_scenarios

            

Reported by Pylint.

Unused import os
Error

Line: 29 Column: 1

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

import os, json
import wiredtiger, wttest
from wtdataset import SimpleDataSet, SimpleLSMDataSet, SimpleIndexDataSet, \
    ComplexDataSet, ComplexLSMDataSet
from helper import compare_files
from suite_subprocess import suite_subprocess

            

Reported by Pylint.

Unused import wiredtiger
Error

Line: 30 Column: 1

              # OTHER DEALINGS IN THE SOFTWARE.

import os, json
import wiredtiger, wttest
from wtdataset import SimpleDataSet, SimpleLSMDataSet, SimpleIndexDataSet, \
    ComplexDataSet, ComplexLSMDataSet
from helper import compare_files
from suite_subprocess import suite_subprocess
from wtscenario import make_scenarios

            

Reported by Pylint.

Unused variable 'configs'
Error

Line: 115 Column: 9

                      dumpin.close()

        # spot check
        configs = tables[uri][0]
        data = tables[uri][1]["data"]
        d = data[24]
        if 'column5' in d:
            self.assertEqual(d['column5'], '25: abcde')
        else:

            

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, json)
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, json
import wiredtiger, wttest
from wtdataset import SimpleDataSet, SimpleLSMDataSet, SimpleIndexDataSet, \
    ComplexDataSet, ComplexLSMDataSet
from helper import compare_files
from suite_subprocess import suite_subprocess

            

Reported by Pylint.

Multiple imports on one line (wiredtiger, wttest)
Error

Line: 30 Column: 1

              # OTHER DEALINGS IN THE SOFTWARE.

import os, json
import wiredtiger, wttest
from wtdataset import SimpleDataSet, SimpleLSMDataSet, SimpleIndexDataSet, \
    ComplexDataSet, ComplexLSMDataSet
from helper import compare_files
from suite_subprocess import suite_subprocess
from wtscenario import make_scenarios

            

Reported by Pylint.

Missing class docstring
Error

Line: 40 Column: 1

              # A 'fake' cursor based on a set of rows.
# It emulates a WT cursor well enough for the *_check_cursor methods.
# They just need an iterable object.
class FakeCursor:
    def __init__(self, uri, keyfmt, valuefmt, rows):
        self.uri = uri
        self.key_format = keyfmt
        self.value_format = valuefmt
        self.rows = rows

            

Reported by Pylint.

Missing function or method docstring
Error

Line: 54 Column: 5

                  def __next__(self):
        return self.next()

    def next(self):
        if self.pos >= len(self.rows):
            raise StopIteration
        else:
            row = self.rows[self.pos]
            self.pos += 1

            

Reported by Pylint.

Unnecessary "else" after "raise"
Error

Line: 55 Column: 9

                      return self.next()

    def next(self):
        if self.pos >= len(self.rows):
            raise StopIteration
        else:
            row = self.rows[self.pos]
            self.pos += 1
            tup = []

            

Reported by Pylint.