The following issues were found

src/third_party/wiredtiger/test/suite/test_inmem01.py
21 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 time import sleep
from wtdataset import SimpleDataSet
from wtscenario import make_scenarios

# test_inmem01.py

            

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 time import sleep
from wtdataset import SimpleDataSet
from wtscenario import make_scenarios

# test_inmem01.py

            

Reported by Pylint.

standard import "from time import sleep" should be placed before "import wiredtiger, wttest"
Error

Line: 30 Column: 1

              # OTHER DEALINGS IN THE SOFTWARE.

import wiredtiger, wttest
from time import sleep
from wtdataset import SimpleDataSet
from wtscenario import make_scenarios

# test_inmem01.py
#    Test in-memory configuration.

            

Reported by Pylint.

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

Line: 36 Column: 1

              
# test_inmem01.py
#    Test in-memory configuration.
class test_inmem01(wttest.WiredTigerTestCase):
    uri = 'table:inmem01'
    conn_config = \
        'cache_size=5MB,file_manager=(close_idle_time=0),in_memory=true'
    table_config = ',memory_page_max=32k,leaf_page_max=4k'


            

Reported by Pylint.

Missing class docstring
Error

Line: 36 Column: 1

              
# test_inmem01.py
#    Test in-memory configuration.
class test_inmem01(wttest.WiredTigerTestCase):
    uri = 'table:inmem01'
    conn_config = \
        'cache_size=5MB,file_manager=(close_idle_time=0),in_memory=true'
    table_config = ',memory_page_max=32k,leaf_page_max=4k'


            

Reported by Pylint.

Missing function or method docstring
Error

Line: 50 Column: 5

              
    # Smoke-test in-memory configurations, add a small amount of data and
    # ensure it's visible.
    def test_insert(self):
        ds = SimpleDataSet(self, self.uri, 1000, key_format=self.keyfmt,
            value_format=self.valuefmt, config=self.table_config)
        ds.populate()
        ds.check()


            

Reported by Pylint.

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

Line: 51 Column: 9

                  # Smoke-test in-memory configurations, add a small amount of data and
    # ensure it's visible.
    def test_insert(self):
        ds = SimpleDataSet(self, self.uri, 1000, key_format=self.keyfmt,
            value_format=self.valuefmt, config=self.table_config)
        ds.populate()
        ds.check()

    # Add more data than fits into the configured cache and verify it fails.

            

Reported by Pylint.

Missing function or method docstring
Error

Line: 57 Column: 5

                      ds.check()

    # Add more data than fits into the configured cache and verify it fails.
    def test_insert_over_capacity(self):
        msg = '/WT_CACHE_FULL.*/'
        ds = SimpleDataSet(self, self.uri, 10000000, key_format=self.keyfmt,
            value_format=self.valuefmt, config=self.table_config)
        self.assertRaisesHavingMessage(wiredtiger.WiredTigerError,
            ds.populate, msg)

            

Reported by Pylint.

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

Line: 59 Column: 9

                  # Add more data than fits into the configured cache and verify it fails.
    def test_insert_over_capacity(self):
        msg = '/WT_CACHE_FULL.*/'
        ds = SimpleDataSet(self, self.uri, 10000000, key_format=self.keyfmt,
            value_format=self.valuefmt, config=self.table_config)
        self.assertRaisesHavingMessage(wiredtiger.WiredTigerError,
            ds.populate, msg)

        # Figure out the last key we successfully inserted, and check all

            

Reported by Pylint.

src/third_party/wiredtiger/test/suite/test_checkpoint07.py
21 issues
Unable to import 'wiredtiger'
Error

Line: 32 Column: 1

              # test_checkpoint07.py
# Test that the checkpoints timing statistics are populated as expected.

import wiredtiger, wttest
from wiredtiger import stat
from wtdataset import SimpleDataSet

class test_checkpoint07(wttest.WiredTigerTestCase):
    conn_config = 'cache_size=50MB,log=(enabled),statistics=(all)'

            

Reported by Pylint.

Unable to import 'wiredtiger'
Error

Line: 33 Column: 1

              # Test that the checkpoints timing statistics are populated as expected.

import wiredtiger, wttest
from wiredtiger import stat
from wtdataset import SimpleDataSet

class test_checkpoint07(wttest.WiredTigerTestCase):
    conn_config = 'cache_size=50MB,log=(enabled),statistics=(all)'
    session_config = 'isolation=snapshot'

            

Reported by Pylint.

Unused import wiredtiger
Error

Line: 32 Column: 1

              # test_checkpoint07.py
# Test that the checkpoints timing statistics are populated as expected.

import wiredtiger, wttest
from wiredtiger import stat
from wtdataset import SimpleDataSet

class test_checkpoint07(wttest.WiredTigerTestCase):
    conn_config = 'cache_size=50MB,log=(enabled),statistics=(all)'

            

Reported by Pylint.

Unused SimpleDataSet imported from wtdataset
Error

Line: 34 Column: 1

              
import wiredtiger, wttest
from wiredtiger import stat
from wtdataset import SimpleDataSet

class test_checkpoint07(wttest.WiredTigerTestCase):
    conn_config = 'cache_size=50MB,log=(enabled),statistics=(all)'
    session_config = 'isolation=snapshot'


            

Reported by Pylint.

Attribute 'uri1' defined outside __init__
Error

Line: 48 Column: 9

                      return val

    def test_checkpoint07(self):
        self.uri1 = 'table:ckpt05.1'
        self.file1 = 'file:ckpt05.1.wt'
        self.uri2 = 'table:ckpt05.2'
        self.file2 = 'file:ckpt05.2.wt'
        self.uri3 = 'table:ckpt05.3'
        self.file3 = 'file:ckpt05.3.wt'

            

Reported by Pylint.

Attribute 'file1' defined outside __init__
Error

Line: 49 Column: 9

              
    def test_checkpoint07(self):
        self.uri1 = 'table:ckpt05.1'
        self.file1 = 'file:ckpt05.1.wt'
        self.uri2 = 'table:ckpt05.2'
        self.file2 = 'file:ckpt05.2.wt'
        self.uri3 = 'table:ckpt05.3'
        self.file3 = 'file:ckpt05.3.wt'
        self.session.create(self.uri1, 'key_format=i,value_format=i')

            

Reported by Pylint.

Attribute 'uri2' defined outside __init__
Error

Line: 50 Column: 9

                  def test_checkpoint07(self):
        self.uri1 = 'table:ckpt05.1'
        self.file1 = 'file:ckpt05.1.wt'
        self.uri2 = 'table:ckpt05.2'
        self.file2 = 'file:ckpt05.2.wt'
        self.uri3 = 'table:ckpt05.3'
        self.file3 = 'file:ckpt05.3.wt'
        self.session.create(self.uri1, 'key_format=i,value_format=i')
        self.session.create(self.uri2, 'key_format=i,value_format=i')

            

Reported by Pylint.

Attribute 'file2' defined outside __init__
Error

Line: 51 Column: 9

                      self.uri1 = 'table:ckpt05.1'
        self.file1 = 'file:ckpt05.1.wt'
        self.uri2 = 'table:ckpt05.2'
        self.file2 = 'file:ckpt05.2.wt'
        self.uri3 = 'table:ckpt05.3'
        self.file3 = 'file:ckpt05.3.wt'
        self.session.create(self.uri1, 'key_format=i,value_format=i')
        self.session.create(self.uri2, 'key_format=i,value_format=i')
        self.session.create(self.uri3, 'key_format=i,value_format=i')

            

Reported by Pylint.

Attribute 'uri3' defined outside __init__
Error

Line: 52 Column: 9

                      self.file1 = 'file:ckpt05.1.wt'
        self.uri2 = 'table:ckpt05.2'
        self.file2 = 'file:ckpt05.2.wt'
        self.uri3 = 'table:ckpt05.3'
        self.file3 = 'file:ckpt05.3.wt'
        self.session.create(self.uri1, 'key_format=i,value_format=i')
        self.session.create(self.uri2, 'key_format=i,value_format=i')
        self.session.create(self.uri3, 'key_format=i,value_format=i')


            

Reported by Pylint.

Attribute 'file3' defined outside __init__
Error

Line: 53 Column: 9

                      self.uri2 = 'table:ckpt05.2'
        self.file2 = 'file:ckpt05.2.wt'
        self.uri3 = 'table:ckpt05.3'
        self.file3 = 'file:ckpt05.3.wt'
        self.session.create(self.uri1, 'key_format=i,value_format=i')
        self.session.create(self.uri2, 'key_format=i,value_format=i')
        self.session.create(self.uri3, 'key_format=i,value_format=i')

        # Setup: Insert some data and checkpoint it. Then modify only

            

Reported by Pylint.

src/third_party/wiredtiger/bench/wtperf/config.c
21 issues
fprintf - If format strings can be influenced by an attacker, they can be exploited
Security

Line: 807 Column: 17 CWE codes: 134
Suggestion: Use a constant for the format specification

                          }
            if (workp->table_index != INT32_MAX &&
              workp->table_index >= (int32_t)opts->table_count) {
                fprintf(stderr,
                  "Workload table index %" PRId32 " is larger than table count %" PRIu32,
                  workp->table_index, opts->table_count);
                return (EINVAL);
            }
            if (workp->modify != 0 && workp->ops_per_txn == 0) {

            

Reported by FlawFinder.

strcpy - Does not check for buffer overflows when copying to destination [MS-banned]
Security

Line: 863 Column: 21 CWE codes: 120
Suggestion: Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused)

                                   */
                    val_pointer = strchr(test_line->string, '=') + 2;
                    concat_str = dmalloc(strlen(conf_line->string) + strlen(val_pointer) + 1);
                    strcpy(concat_str, conf_line->string);
                    concat_str[strlen(concat_str) - 1] = ',';
                    strcat(concat_str, val_pointer);
                    free(test_line->string);
                    test_line->string = concat_str;
                }

            

Reported by FlawFinder.

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

Line: 865 Column: 21 CWE codes: 120
Suggestion: Consider using strcat_s, strncat, strlcat, or snprintf (warning: strncat is easily misused)

                                  concat_str = dmalloc(strlen(conf_line->string) + strlen(val_pointer) + 1);
                    strcpy(concat_str, conf_line->string);
                    concat_str[strlen(concat_str) - 1] = ',';
                    strcat(concat_str, val_pointer);
                    free(test_line->string);
                    test_line->string = concat_str;
                }

                TAILQ_REMOVE(&opts->config_head, conf_line, q);

            

Reported by FlawFinder.

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

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

                  size_t linelen, optionpos;
    int linenum, ret;
    bool contline;
    char line[4 * 1024], option[4 * 1024];
    char *comment, *ltrim, *rtrim;

    ret = 0;

    if ((fp = fopen(filename, "r")) == NULL) {

            

Reported by FlawFinder.

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

Line: 505 Column: 15 CWE codes: 362

              
    ret = 0;

    if ((fp = fopen(filename, "r")) == NULL) {
        fprintf(stderr, "wtperf: %s: %s\n", filename, strerror(errno));
        return (errno);
    }

    optionpos = 0;

            

Reported by FlawFinder.

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

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

                          break;
        }

        memcpy(&option[optionpos], ltrim, linelen);
        option[optionpos + linelen] = '\0';
        if (contline)
            optionpos += linelen;
        else {
            if ((ret = config_opt_str(wtperf, option)) != 0) {

            

Reported by FlawFinder.

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

Line: 891 Column: 30 CWE codes: 362

                  CONFIG_QUEUE_ENTRY *config_line;
    FILE *fp;

    testutil_checkfmt(((fp = fopen(path, "w")) == NULL), "%s", path);

    config_consolidate(opts);

    fprintf(fp,
      "# Warning: This config includes unwritten, implicit configuration defaults.\n"

            

Reported by FlawFinder.

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

Line: 348 Column: 61 CWE codes: 120 20

                      if (workp->truncate != 0 && workp->threads > 1)
            goto err;
        if (workp->truncate != 0 &&
          (workp->insert > 0 || workp->modify > 0 || workp->read > 0 || workp->update > 0))
            goto err;
        wtperf->workers_cnt += (u_int)workp->threads;
    }

    ret = group->close(group);

            

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: 389 Column: 13 CWE codes: 126

              
    desc = NULL;
    for (i = 0; i < WT_ELEMENTS(config_opts_desc); i++)
        if (strlen(config_opts_desc[i].name) == k->len &&
          strncmp(config_opts_desc[i].name, k->str, k->len) == 0) {
            desc = &config_opts_desc[i];
            break;
        }
    if (desc == NULL) {

            

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

                      if (*strp == NULL)
            begin = newstr = dstrdup(v->str);
        else {
            newlen = strlen(*strp) + v->len + strlen(",") + 1;
            newstr = dmalloc(newlen);
            testutil_check(__wt_snprintf(newstr, newlen, "%s,%.*s", *strp, (int)v->len, v->str));
            /* Free the old value now we've copied it. */
            free(*strp);
            begin = &newstr[(newlen - 1) - v->len];

            

Reported by FlawFinder.

src/third_party/wiredtiger/test/suite/test_checkpoint04.py
21 issues
Unable to import 'wiredtiger'
Error

Line: 32 Column: 1

              # test_checkpoint04.py
# Test that the checkpoints timing statistics are populated as expected.

import wiredtiger, wttest
from wiredtiger import stat
from wtdataset import SimpleDataSet

class test_checkpoint04(wttest.WiredTigerTestCase):
    conn_config = 'cache_size=50MB,log=(enabled),statistics=(all)'

            

Reported by Pylint.

Unable to import 'wiredtiger'
Error

Line: 33 Column: 1

              # Test that the checkpoints timing statistics are populated as expected.

import wiredtiger, wttest
from wiredtiger import stat
from wtdataset import SimpleDataSet

class test_checkpoint04(wttest.WiredTigerTestCase):
    conn_config = 'cache_size=50MB,log=(enabled),statistics=(all)'
    session_config = 'isolation=snapshot'

            

Reported by Pylint.

Unused import wiredtiger
Error

Line: 32 Column: 1

              # test_checkpoint04.py
# Test that the checkpoints timing statistics are populated as expected.

import wiredtiger, wttest
from wiredtiger import stat
from wtdataset import SimpleDataSet

class test_checkpoint04(wttest.WiredTigerTestCase):
    conn_config = 'cache_size=50MB,log=(enabled),statistics=(all)'

            

Reported by Pylint.

Redefining name 'stat' from outer scope (line 33)
Error

Line: 60 Column: 24

                          session.commit_transaction()
        cursor.close()

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

              # test_checkpoint04.py
# Test that the checkpoints timing statistics are populated as expected.

import wiredtiger, wttest
from wiredtiger import stat
from wtdataset import SimpleDataSet

class test_checkpoint04(wttest.WiredTigerTestCase):
    conn_config = 'cache_size=50MB,log=(enabled),statistics=(all)'

            

Reported by Pylint.

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

Line: 33 Column: 1

              # Test that the checkpoints timing statistics are populated as expected.

import wiredtiger, wttest
from wiredtiger import stat
from wtdataset import SimpleDataSet

class test_checkpoint04(wttest.WiredTigerTestCase):
    conn_config = 'cache_size=50MB,log=(enabled),statistics=(all)'
    session_config = 'isolation=snapshot'

            

Reported by Pylint.

Missing class docstring
Error

Line: 36 Column: 1

              from wiredtiger import stat
from wtdataset import SimpleDataSet

class test_checkpoint04(wttest.WiredTigerTestCase):
    conn_config = 'cache_size=50MB,log=(enabled),statistics=(all)'
    session_config = 'isolation=snapshot'

    def create_tables(self, ntables):
        tables = {}

            

Reported by Pylint.

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

Line: 36 Column: 1

              from wiredtiger import stat
from wtdataset import SimpleDataSet

class test_checkpoint04(wttest.WiredTigerTestCase):
    conn_config = 'cache_size=50MB,log=(enabled),statistics=(all)'
    session_config = 'isolation=snapshot'

    def create_tables(self, ntables):
        tables = {}

            

Reported by Pylint.

Missing function or method docstring
Error

Line: 40 Column: 5

                  conn_config = 'cache_size=50MB,log=(enabled),statistics=(all)'
    session_config = 'isolation=snapshot'

    def create_tables(self, ntables):
        tables = {}
        for i in range(0, ntables):
            uri = 'table:table' + str(i)
            ds = SimpleDataSet(
                self, uri, 0, key_format="i", value_format="S", config='log=(enabled=false)')

            

Reported by Pylint.

src/third_party/wiredtiger/test/suite/test_stat04.py
21 issues
Unable to import 'wiredtiger'
Error

Line: 32 Column: 1

              import os, struct
from suite_subprocess import suite_subprocess
from wtscenario import make_scenarios
import wiredtiger, wttest
from wiredtiger import stat

# test_stat04.py
#    Statistics key/value pair count
class test_stat04(wttest.WiredTigerTestCase, suite_subprocess):

            

Reported by Pylint.

Unable to import 'wiredtiger'
Error

Line: 33 Column: 1

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

# test_stat04.py
#    Statistics key/value pair count
class test_stat04(wttest.WiredTigerTestCase, suite_subprocess):
    uripfx = 'table:test_stat04.'

            

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


            

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


            

Reported by Pylint.

Unused import wiredtiger
Error

Line: 32 Column: 1

              import os, struct
from suite_subprocess import suite_subprocess
from wtscenario import make_scenarios
import wiredtiger, wttest
from wiredtiger import stat

# test_stat04.py
#    Statistics key/value pair count
class test_stat04(wttest.WiredTigerTestCase, suite_subprocess):

            

Reported by Pylint.

Attribute 'valuepfx' defined outside __init__
Error

Line: 56 Column: 9

                  conn_config = 'statistics=(all)'

    def init_test(self):
        self.valuepfx = self.valuesize * 'X'

    def genkey(self, n):
        if self.keyfmt == 'S':
            return 'SOMEKEY' + str(n)
        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, 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
from wtscenario import make_scenarios
import wiredtiger, wttest
from wiredtiger import stat


            

Reported by Pylint.

Multiple imports on one line (wiredtiger, wttest)
Error

Line: 32 Column: 1

              import os, struct
from suite_subprocess import suite_subprocess
from wtscenario import make_scenarios
import wiredtiger, wttest
from wiredtiger import stat

# test_stat04.py
#    Statistics key/value pair count
class test_stat04(wttest.WiredTigerTestCase, suite_subprocess):

            

Reported by Pylint.

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

Line: 32 Column: 1

              import os, struct
from suite_subprocess import suite_subprocess
from wtscenario import make_scenarios
import wiredtiger, wttest
from wiredtiger import stat

# test_stat04.py
#    Statistics key/value pair count
class test_stat04(wttest.WiredTigerTestCase, suite_subprocess):

            

Reported by Pylint.

src/third_party/wiredtiger/test/suite/test_rollback_to_stable04.py
21 issues
Unable to import 'wiredtiger'
Error

Line: 29 Column: 1

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

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

def mod_val(value, char, location, nbytes=1):

            

Reported by Pylint.

An attribute defined in wttest line 401 hides this method
Error

Line: 60 Column: 5

              
    scenarios = make_scenarios(key_format_values, in_memory_values, prepare_values)

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

            

Reported by Pylint.

Undefined variable 'wttest'
Error

Line: 162 Column: 5

                          self.assertGreaterEqual(upd_aborted + hs_removed + hs_sweep, nrows * 11)

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

            

Reported by Pylint.

Missing module docstring
Error

Line: 1 Column: 1

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

            

Reported by Pylint.

Missing function or method docstring
Error

Line: 34 Column: 1

              from wtscenario import make_scenarios
from test_rollback_to_stable01 import test_rollback_to_stable_base

def mod_val(value, char, location, nbytes=1):
    return value[0:location] + char + value[location+nbytes:]

# test_rollback_to_stable04.py
# Test that rollback to stable always replaces the on-disk value with a full update
# from the history store.

            

Reported by Pylint.

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

Line: 40 Column: 1

              # test_rollback_to_stable04.py
# Test that rollback to stable always replaces the on-disk value with a full update
# from the history store.
class test_rollback_to_stable04(test_rollback_to_stable_base):
    session_config = 'isolation=snapshot'

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

            

Reported by Pylint.

Missing class docstring
Error

Line: 40 Column: 1

              # test_rollback_to_stable04.py
# Test that rollback to stable always replaces the on-disk value with a full update
# from the history store.
class test_rollback_to_stable04(test_rollback_to_stable_base):
    session_config = 'isolation=snapshot'

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

            

Reported by Pylint.

Missing function or method docstring
Error

Line: 60 Column: 5

              
    scenarios = make_scenarios(key_format_values, in_memory_values, prepare_values)

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

            

Reported by Pylint.

Too many local variables (24/15)
Error

Line: 68 Column: 5

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

    def test_rollback_to_stable(self):
        nrows = 1000

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

            

Reported by Pylint.

Too many statements (72/50)
Error

Line: 68 Column: 5

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

    def test_rollback_to_stable(self):
        nrows = 1000

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

            

Reported by Pylint.

src/third_party/scons-3.1.2/scons-local-3.1.2/SCons/Tool/yacc.py
20 issues
Unused variable 'targetExt'
Error

Line: 56 Column: 17

              def _yaccEmitter(target, source, env, ysuf, hsuf):
    yaccflags = env.subst("$YACCFLAGS", target=target, source=source)
    flags = SCons.Util.CLVar(yaccflags)
    targetBase, targetExt = os.path.splitext(SCons.Util.to_String(target[0]))

    if '.ym' in ysuf:                # If using Objective-C
        target = [targetBase + ".m"] # the extension is ".m".



            

Reported by Pylint.

Unused variable 'ext'
Error

Line: 70 Column: 15

                  # If -g is specified on the command line, yacc will emit a .vcg
    # file with the same base name as the .y, .yacc, .ym or .yy file.
    if "-g" in flags:
        base, ext = os.path.splitext(SCons.Util.to_String(source[0]))
        target.append(base + env.subst("$YACCVCGFILESUFFIX"))

    # If -v is specified yacc will create the output debug file
    # which is not really source for any process, but should
    # be noted and also be cleaned

            

Reported by Pylint.

Line too long (115/100)
Error

Line: 34 Column: 1

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

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

import os.path
import sys

import SCons.Defaults

            

Reported by Pylint.

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

Line: 53 Column: 1

              else:
    BINS = ["bison", "yacc"]

def _yaccEmitter(target, source, env, ysuf, hsuf):
    yaccflags = env.subst("$YACCFLAGS", target=target, source=source)
    flags = SCons.Util.CLVar(yaccflags)
    targetBase, targetExt = os.path.splitext(SCons.Util.to_String(target[0]))

    if '.ym' in ysuf:                # If using Objective-C

            

Reported by Pylint.

Too many local variables (16/15)
Error

Line: 53 Column: 1

              else:
    BINS = ["bison", "yacc"]

def _yaccEmitter(target, source, env, ysuf, hsuf):
    yaccflags = env.subst("$YACCFLAGS", target=target, source=source)
    flags = SCons.Util.CLVar(yaccflags)
    targetBase, targetExt = os.path.splitext(SCons.Util.to_String(target[0]))

    if '.ym' in ysuf:                # If using Objective-C

            

Reported by Pylint.

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

Line: 56 Column: 17

              def _yaccEmitter(target, source, env, ysuf, hsuf):
    yaccflags = env.subst("$YACCFLAGS", target=target, source=source)
    flags = SCons.Util.CLVar(yaccflags)
    targetBase, targetExt = os.path.splitext(SCons.Util.to_String(target[0]))

    if '.ym' in ysuf:                # If using Objective-C
        target = [targetBase + ".m"] # the extension is ".m".



            

Reported by Pylint.

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

Line: 56 Column: 5

              def _yaccEmitter(target, source, env, ysuf, hsuf):
    yaccflags = env.subst("$YACCFLAGS", target=target, source=source)
    flags = SCons.Util.CLVar(yaccflags)
    targetBase, targetExt = os.path.splitext(SCons.Util.to_String(target[0]))

    if '.ym' in ysuf:                # If using Objective-C
        target = [targetBase + ".m"] # the extension is ".m".



            

Reported by Pylint.

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

Line: 85 Column: 5

              
    # With --defines and --graph, the name of the file is totally defined
    # in the options.
    fileGenOptions = ["--defines=", "--graph="]
    for option in flags:
        for fileGenOption in fileGenOptions:
            l = len(fileGenOption)
            if option[:l] == fileGenOption:
                # A file generating option is present, so add the file

            

Reported by Pylint.

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

Line: 87 Column: 13

                  # in the options.
    fileGenOptions = ["--defines=", "--graph="]
    for option in flags:
        for fileGenOption in fileGenOptions:
            l = len(fileGenOption)
            if option[:l] == fileGenOption:
                # A file generating option is present, so add the file
                # name to the list of targets.
                fileName = option[l:].strip()

            

Reported by Pylint.

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

Line: 88 Column: 13

                  fileGenOptions = ["--defines=", "--graph="]
    for option in flags:
        for fileGenOption in fileGenOptions:
            l = len(fileGenOption)
            if option[:l] == fileGenOption:
                # A file generating option is present, so add the file
                # name to the list of targets.
                fileName = option[l:].strip()
                target.append(fileName)

            

Reported by Pylint.

src/third_party/wiredtiger/test/suite/test_backup06.py
20 issues
Unable to import 'wiredtiger'
Error

Line: 33 Column: 1

              import shutil
import string
from wtbackup import backup_base
import wiredtiger, wttest
from wiredtiger import stat
from wtdataset import SimpleDataSet, ComplexDataSet, ComplexLSMDataSet
try:
    # Windows does not getrlimit/setrlimit so we must catch the resource
    # module load.

            

Reported by Pylint.

Unable to import 'wiredtiger'
Error

Line: 34 Column: 1

              import string
from wtbackup import backup_base
import wiredtiger, wttest
from wiredtiger import stat
from wtdataset import SimpleDataSet, ComplexDataSet, ComplexLSMDataSet
try:
    # Windows does not getrlimit/setrlimit so we must catch the resource
    # module load.
    import resource

            

Reported by Pylint.

Unused import shutil
Error

Line: 30 Column: 1

              # OTHER DEALINGS IN THE SOFTWARE.

import os
import shutil
import string
from wtbackup import backup_base
import wiredtiger, wttest
from wiredtiger import stat
from wtdataset import SimpleDataSet, ComplexDataSet, ComplexLSMDataSet

            

Reported by Pylint.

Unused import string
Error

Line: 31 Column: 1

              
import os
import shutil
import string
from wtbackup import backup_base
import wiredtiger, wttest
from wiredtiger import stat
from wtdataset import SimpleDataSet, ComplexDataSet, ComplexLSMDataSet
try:

            

Reported by Pylint.

No exception type(s) specified
Error

Line: 40 Column: 1

                  # Windows does not getrlimit/setrlimit so we must catch the resource
    # module load.
    import resource
except:
    None

# test_backup06.py
#    Test that opening a backup cursor does not open file handles.
class test_backup06(backup_base):

            

Reported by Pylint.

Statement seems to have no effect
Error

Line: 41 Column: 5

                  # module load.
    import resource
except:
    None

# test_backup06.py
#    Test that opening a backup cursor does not open file handles.
class test_backup06(backup_base):
    conn_config = 'statistics=(fast)'

            

Reported by Pylint.

Cell variable i defined in loop
Error

Line: 133 Column: 43

                      self.session.create(schema_uri, None)
        for i in self.fobjs:
            self.assertRaises(wiredtiger.WiredTigerError,
                lambda: self.session.drop(i[0], None))
            self.assertRaises(wiredtiger.WiredTigerError,
                lambda: self.session.rename(i[0], rename_uri))
        for i in self.tobjs:
            self.assertRaises(wiredtiger.WiredTigerError,
                lambda: self.session.drop(i[0], None))

            

Reported by Pylint.

Cell variable i defined in loop
Error

Line: 135 Column: 45

                          self.assertRaises(wiredtiger.WiredTigerError,
                lambda: self.session.drop(i[0], None))
            self.assertRaises(wiredtiger.WiredTigerError,
                lambda: self.session.rename(i[0], rename_uri))
        for i in self.tobjs:
            self.assertRaises(wiredtiger.WiredTigerError,
                lambda: self.session.drop(i[0], None))
            self.assertRaises(wiredtiger.WiredTigerError,
                lambda: self.session.rename(i[0], trename_uri))

            

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 wtbackup import backup_base"
Error

Line: 33 Column: 1

              import shutil
import string
from wtbackup import backup_base
import wiredtiger, wttest
from wiredtiger import stat
from wtdataset import SimpleDataSet, ComplexDataSet, ComplexLSMDataSet
try:
    # Windows does not getrlimit/setrlimit so we must catch the resource
    # module load.

            

Reported by Pylint.

src/third_party/scons-3.1.2/scons-local-3.1.2/SCons/Node/Python.py
20 issues
An attribute defined in Python line 90 hides this method
Error

Line: 152 Column: 5

                          return text_contents


    def changed_since_last_build(self, target, prev_ni):
        cur_csig = self.get_csig()
        try:
            return cur_csig != prev_ni.csig
        except AttributeError:
            return 1

            

Reported by Pylint.

TODO check or discard version
Error

Line: 68 Column: 3

                      """
        Restore the attributes from a pickled state.
        """
        # TODO check or discard version
        del state['_version_id']
        for key, value in state.items():
            if key not in ('__weakref__',):
                setattr(self, key, value)


            

Reported by Pylint.

Unused argument 'dir'
Error

Line: 110 Column: 24

              
    is_up_to_date = SCons.Node.Node.children_are_up_to_date

    def is_under(self, dir):
        # Make Value nodes get built regardless of
        # what directory scons was run from. Value nodes
        # are outside the filesystem:
        return 1


            

Reported by Pylint.

Redefining built-in 'dir'
Error

Line: 110 Column: 24

              
    is_up_to_date = SCons.Node.Node.children_are_up_to_date

    def is_under(self, dir):
        # Make Value nodes get built regardless of
        # what directory scons was run from. Value nodes
        # are outside the filesystem:
        return 1


            

Reported by Pylint.

##TODO: something reasonable about universal newlines
Error

Line: 133 Column: 4

                      are the concatenation of all the contents of its sources.  As
        the value need not be built when get_contents() is called, we
        cannot use the actual node.built_value."""
        ###TODO: something reasonable about universal newlines
        contents = str(self.value)
        for kid in self.children(None):
            contents = contents + kid.get_contents().decode()
        return contents


            

Reported by Pylint.

Unused argument 'target'
Error

Line: 152 Column: 40

                          return text_contents


    def changed_since_last_build(self, target, prev_ni):
        cur_csig = self.get_csig()
        try:
            return cur_csig != prev_ni.csig
        except AttributeError:
            return 1

            

Reported by Pylint.

Unused argument 'calc'
Error

Line: 159 Column: 24

                      except AttributeError:
            return 1

    def get_csig(self, calc=None):
        """Because we're a Python value node and don't have a real
        timestamp, we get to ignore the calculator and just use the
        value contents.

        Returns string. Ideally string of hex digits. (Not bytes)

            

Reported by Pylint.

Parameters differ from overridden 'get_csig' method
Error

Line: 159 Column: 5

                      except AttributeError:
            return 1

    def get_csig(self, calc=None):
        """Because we're a Python value node and don't have a real
        timestamp, we get to ignore the calculator and just use the
        value contents.

        Returns string. Ideally string of hex digits. (Not bytes)

            

Reported by Pylint.

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

Line: 1 Column: 1

              """scons.Node.Python

Python nodes.

"""

#
# Copyright (c) 2001 - 2019 The SCons Foundation
#

            

Reported by Pylint.

Line too long (117/100)
Error

Line: 30 Column: 1

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

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

import SCons.Node

class ValueNodeInfo(SCons.Node.NodeInfoBase):
    __slots__ = ('csig',)

            

Reported by Pylint.

src/third_party/wiredtiger/test/suite/test_util18.py
20 issues
Unable to import 'wiredtiger'
Error

Line: 31 Column: 1

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

# test_util18.py
#   Utilities: wt printlog
class test_util18(wttest.WiredTigerTestCase, suite_subprocess):

            

Reported by Pylint.

An attribute defined in wttest line 401 hides this method
Error

Line: 53 Column: 5

              
    scenarios = make_scenarios(print_user_data)

    def conn_config(self):
        return 'log=(archive=false,enabled,file_max=%dK)' % self.logmax

    # Populate our test table with data we can check against in the printlog output.
    def populate(self):
        cursor = self.session.open_cursor(self.uri, None)

            

Reported by Pylint.

Unused import wiredtiger
Error

Line: 31 Column: 1

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

# test_util18.py
#   Utilities: wt printlog
class test_util18(wttest.WiredTigerTestCase, suite_subprocess):

            

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 (codecs, filecmp)
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 codecs, filecmp
from suite_subprocess import suite_subprocess
import wiredtiger, wttest
from wtscenario import make_scenarios

# test_util18.py

            

Reported by Pylint.

Multiple imports on one line (wiredtiger, wttest)
Error

Line: 31 Column: 1

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

# test_util18.py
#   Utilities: wt printlog
class test_util18(wttest.WiredTigerTestCase, suite_subprocess):

            

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 codecs, filecmp
from suite_subprocess import suite_subprocess
import wiredtiger, wttest
from wtscenario import make_scenarios

# test_util18.py
#   Utilities: wt printlog
class test_util18(wttest.WiredTigerTestCase, suite_subprocess):

            

Reported by Pylint.

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

Line: 36 Column: 1

              
# test_util18.py
#   Utilities: wt printlog
class test_util18(wttest.WiredTigerTestCase, suite_subprocess):
    tablename = 'test_util18.a'
    uri = 'table:' + tablename
    logmax = 100
    nentries = 5
    create_params = 'key_format=S,value_format=S'

            

Reported by Pylint.

Missing class docstring
Error

Line: 36 Column: 1

              
# test_util18.py
#   Utilities: wt printlog
class test_util18(wttest.WiredTigerTestCase, suite_subprocess):
    tablename = 'test_util18.a'
    uri = 'table:' + tablename
    logmax = 100
    nentries = 5
    create_params = 'key_format=S,value_format=S'

            

Reported by Pylint.

Missing function or method docstring
Error

Line: 53 Column: 5

              
    scenarios = make_scenarios(print_user_data)

    def conn_config(self):
        return 'log=(archive=false,enabled,file_max=%dK)' % self.logmax

    # Populate our test table with data we can check against in the printlog output.
    def populate(self):
        cursor = self.session.open_cursor(self.uri, None)

            

Reported by Pylint.