The following issues were found

src/third_party/wiredtiger/test/suite/test_checkpoint08.py
19 issues
Unable to import 'wiredtiger'
Error

Line: 36 Column: 1

              # test_checkpoint08.py
# Test that the btree checkpoint is not skipped if there are obsolete pages.

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

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

            

Reported by Pylint.

Unable to import 'wiredtiger'
Error

Line: 37 Column: 1

              # Test that the btree checkpoint is not skipped if there are obsolete pages.

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

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

            

Reported by Pylint.

Unused import wiredtiger
Error

Line: 36 Column: 1

              # test_checkpoint08.py
# Test that the btree checkpoint is not skipped if there are obsolete pages.

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

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

            

Reported by Pylint.

Unused SimpleDataSet imported from wtdataset
Error

Line: 38 Column: 1

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

class test_checkpoint08(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: 52 Column: 9

                      return val

    def test_checkpoint08(self):
        self.uri1 = 'table:ckpt08.1'
        self.file1 = 'file:ckpt08.1.wt'
        self.uri2 = 'table:ckpt08.2'
        self.file2 = 'file:ckpt08.2.wt'
        self.hsfile = 'file:WiredTigerHS.wt'
        self.session.create(self.uri1, 'key_format=i,value_format=i')

            

Reported by Pylint.

Attribute 'file1' defined outside __init__
Error

Line: 53 Column: 9

              
    def test_checkpoint08(self):
        self.uri1 = 'table:ckpt08.1'
        self.file1 = 'file:ckpt08.1.wt'
        self.uri2 = 'table:ckpt08.2'
        self.file2 = 'file:ckpt08.2.wt'
        self.hsfile = 'file:WiredTigerHS.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 'uri2' defined outside __init__
Error

Line: 54 Column: 9

                  def test_checkpoint08(self):
        self.uri1 = 'table:ckpt08.1'
        self.file1 = 'file:ckpt08.1.wt'
        self.uri2 = 'table:ckpt08.2'
        self.file2 = 'file:ckpt08.2.wt'
        self.hsfile = 'file:WiredTigerHS.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: 55 Column: 9

                      self.uri1 = 'table:ckpt08.1'
        self.file1 = 'file:ckpt08.1.wt'
        self.uri2 = 'table:ckpt08.2'
        self.file2 = 'file:ckpt08.2.wt'
        self.hsfile = 'file:WiredTigerHS.wt'
        self.session.create(self.uri1, 'key_format=i,value_format=i')
        self.session.create(self.uri2, 'key_format=i,value_format=i')

        # Pin oldest and stable to timestamp 1.

            

Reported by Pylint.

Attribute 'hsfile' defined outside __init__
Error

Line: 56 Column: 9

                      self.file1 = 'file:ckpt08.1.wt'
        self.uri2 = 'table:ckpt08.2'
        self.file2 = 'file:ckpt08.2.wt'
        self.hsfile = 'file:WiredTigerHS.wt'
        self.session.create(self.uri1, 'key_format=i,value_format=i')
        self.session.create(self.uri2, 'key_format=i,value_format=i')

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

            

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.

src/third_party/wiredtiger/test/3rdparty/testscenarios-0.4/lib/testscenarios/testcase.py
19 issues
Unable to import 'testtools.testcase'
Error

Line: 24 Column: 1

              
import unittest

from testtools.testcase import clone_test_with_new_id

from testscenarios.scenarios import generate_scenarios

_doc = """
    When a test object which inherits from WithScenarios is run, and there is a

            

Reported by Pylint.

Super of 'WithScenarios' has no 'debug' member
Error

Line: 56 Column: 20

                          for test in generate_scenarios(self):
                test.debug()
        else:
            return super(WithScenarios, self).debug()

    def run(self, result=None):
        scenarios = self._get_scenarios()
        if scenarios:
            for test in generate_scenarios(self):

            

Reported by Pylint.

Super of 'WithScenarios' has no 'run' member
Error

Line: 65 Column: 20

                              test.run(result)
            return
        else:
            return super(WithScenarios, self).run(result)


class TestWithScenarios(WithScenarios, unittest.TestCase):
    __doc__ = """Unittest TestCase with support for declarative scenarios.
    """ + _doc

            

Reported by Pylint.

Unused clone_test_with_new_id imported from testtools.testcase
Error

Line: 24 Column: 1

              
import unittest

from testtools.testcase import clone_test_with_new_id

from testscenarios.scenarios import generate_scenarios

_doc = """
    When a test object which inherits from WithScenarios is run, and there is a

            

Reported by Pylint.

Missing module docstring
Error

Line: 1 Column: 1

              #  testscenarios: extensions to python unittest to allow declarative
#  dependency injection ('scenarios') by tests.
#
# Copyright (c) 2009, Robert Collins <robertc@robertcollins.net>
# 
# Licensed under either the Apache License, Version 2.0 or the BSD 3-clause
# license at the users choice. A copy of both licenses are available in the
# project source as Apache-2.0 and BSD. You may not use this file except in
# compliance with one of these two licences.

            

Reported by Pylint.

Trailing whitespace
Error

Line: 5 Column: 2

              #  dependency injection ('scenarios') by tests.
#
# Copyright (c) 2009, Robert Collins <robertc@robertcollins.net>
# 
# Licensed under either the Apache License, Version 2.0 or the BSD 3-clause
# license at the users choice. A copy of both licenses are available in the
# project source as Apache-2.0 and BSD. You may not use this file except in
# compliance with one of these two licences.
# 

            

Reported by Pylint.

Trailing whitespace
Error

Line: 10 Column: 2

              # license at the users choice. A copy of both licenses are available in the
# project source as Apache-2.0 and BSD. You may not use this file except in
# compliance with one of these two licences.
# 
# Unless required by applicable law or agreed to in writing, software
# distributed under these licenses is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the
# license you chose for the specific language governing permissions and
# limitations under that license.

            

Reported by Pylint.

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

Line: 28 Column: 1

              
from testscenarios.scenarios import generate_scenarios

_doc = """
    When a test object which inherits from WithScenarios is run, and there is a
    non-empty scenarios attribute on the object, the test is multiplied by the
    run method into one test per scenario. For this to work reliably the
    WithScenarios.run method must not be overriden in a subclass (or overridden
    compatibly with WithScenarios).

            

Reported by Pylint.

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

Line: 36 Column: 1

                  compatibly with WithScenarios).
    """

class WithScenarios(object):
    __doc__ = """A mixin for TestCase with support for declarative scenarios.
    """ + _doc

    def _get_scenarios(self):
        return getattr(self, 'scenarios', None)

            

Reported by Pylint.

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

Line: 43 Column: 5

                  def _get_scenarios(self):
        return getattr(self, 'scenarios', None)

    def countTestCases(self):
        scenarios = self._get_scenarios()
        if not scenarios:
            return 1
        else:
            return len(scenarios)

            

Reported by Pylint.

buildscripts/libdeps/graph_visualizer_web_stack/flask/flask_backend.py
19 issues
Unable to import 'networkx'
Error

Line: 34 Column: 1

              from collections import namedtuple, OrderedDict

import flask
import networkx

from flask_socketio import SocketIO, emit
from flask_cors import CORS
from flask_session import Session
from lxml import etree

            

Reported by Pylint.

Unable to import 'flask_socketio'
Error

Line: 36 Column: 1

              import flask
import networkx

from flask_socketio import SocketIO, emit
from flask_cors import CORS
from flask_session import Session
from lxml import etree

import libdeps.graph

            

Reported by Pylint.

Unable to import 'flask_session'
Error

Line: 38 Column: 1

              
from flask_socketio import SocketIO, emit
from flask_cors import CORS
from flask_session import Session
from lxml import etree

import libdeps.graph
import libdeps.analyzer


            

Reported by Pylint.

Unable to import 'lxml'
Error

Line: 39 Column: 1

              from flask_socketio import SocketIO, emit
from flask_cors import CORS
from flask_session import Session
from lxml import etree

import libdeps.graph
import libdeps.analyzer



            

Reported by Pylint.

Unable to import 'libdeps.graph'
Error

Line: 41 Column: 1

              from flask_session import Session
from lxml import etree

import libdeps.graph
import libdeps.analyzer


class BackendServer:
    """Create small class for storing variables and state of the backend."""

            

Reported by Pylint.

Unable to import 'libdeps.analyzer'
Error

Line: 42 Column: 1

              from lxml import etree

import libdeps.graph
import libdeps.analyzer


class BackendServer:
    """Create small class for storing variables and state of the backend."""


            

Reported by Pylint.

Unused Session imported from flask_session
Error

Line: 38 Column: 1

              
from flask_socketio import SocketIO, emit
from flask_cors import CORS
from flask_session import Session
from lxml import etree

import libdeps.graph
import libdeps.analyzer


            

Reported by Pylint.

third party import "import networkx" should be placed before "import flask"
Error

Line: 34 Column: 1

              from collections import namedtuple, OrderedDict

import flask
import networkx

from flask_socketio import SocketIO, emit
from flask_cors import CORS
from flask_session import Session
from lxml import etree

            

Reported by Pylint.

third party import "from flask_socketio import SocketIO, emit" should be placed before "import flask"
Error

Line: 36 Column: 1

              import flask
import networkx

from flask_socketio import SocketIO, emit
from flask_cors import CORS
from flask_session import Session
from lxml import etree

import libdeps.graph

            

Reported by Pylint.

third party import "from flask_cors import CORS" should be placed before "import flask"
Error

Line: 37 Column: 1

              import networkx

from flask_socketio import SocketIO, emit
from flask_cors import CORS
from flask_session import Session
from lxml import etree

import libdeps.graph
import libdeps.analyzer

            

Reported by Pylint.

src/third_party/abseil-cpp-master/abseil-cpp/absl/strings/numbers.cc
19 issues
char - Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues
Security

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

              namespace {

// Used to optimize printing a decimal number's final digit.
const char one_ASCII_final_digits[10][2] {
  {'0', 0}, {'1', 0}, {'2', 0}, {'3', 0}, {'4', 0},
  {'5', 0}, {'6', 0}, {'7', 0}, {'8', 0}, {'9', 0},
};

}  // namespace

            

Reported by FlawFinder.

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

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

                if (i < 100) {
    digits = i;
    if (i >= 10) goto lt100;
    memcpy(buffer, one_ASCII_final_digits[i], 2);
    return buffer + 1;
  }
  if (i < 10000) {  //    10,000
    if (i >= 1000) goto lt10_000;
    digits = i / 100;

            

Reported by FlawFinder.

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

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

                u32 -= digits * 10;
  PutTwoDigits(digits, buffer);
  buffer += 2;
  memcpy(buffer, one_ASCII_final_digits[u32], 2);
  return buffer + 1;
}

char* numbers_internal::FastIntToBuffer(int64_t i, char* buffer) {
  uint64_t u = i;

            

Reported by FlawFinder.

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

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

              
struct ExpDigits {
  int32_t exponent;
  char digits[6];
};

// SplitToSix converts value, a positive double-precision floating-point number,
// into a base-10 exponent and 6 ASCII digits, where the first digit is never
// zero.  For example, SplitToSix(1) returns an exponent of zero and a digits

            

Reported by FlawFinder.

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

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

                                     // passed in.

  if (std::isnan(d)) {
    strcpy(out, "nan");  // NOLINT(runtime/printf)
    return 3;
  }
  if (d == 0) {  // +0 and -0 are handled here
    if (std::signbit(d)) *out++ = '-';
    *out++ = '0';

            

Reported by FlawFinder.

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

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

                  d = -d;
  }
  if (std::isinf(d)) {
    strcpy(out, "inf");  // NOLINT(runtime/printf)
    return out + 3 - buffer;
  }

  auto exp_dig = SplitToSix(d);
  int exp = exp_dig.exponent;

            

Reported by FlawFinder.

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

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

                out[1] = '.';
  switch (exp) {
    case 5:
      memcpy(out, &digits[0], 6), out += 6;
      *out = 0;
      return out - buffer;
    case 4:
      memcpy(out, &digits[0], 5), out += 5;
      if (digits[5] != '0') {

            

Reported by FlawFinder.

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

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

                    *out = 0;
      return out - buffer;
    case 4:
      memcpy(out, &digits[0], 5), out += 5;
      if (digits[5] != '0') {
        *out++ = '.';
        *out++ = digits[5];
      }
      *out = 0;

            

Reported by FlawFinder.

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

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

                    *out = 0;
      return out - buffer;
    case 3:
      memcpy(out, &digits[0], 4), out += 4;
      if ((digits[5] | digits[4]) != '0') {
        *out++ = '.';
        *out++ = digits[4];
        if (digits[5] != '0') *out++ = digits[5];
      }

            

Reported by FlawFinder.

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

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

                    *out = 0;
      return out - buffer;
    case 2:
      memcpy(out, &digits[0], 3), out += 3;
      *out++ = '.';
      memcpy(out, &digits[3], 3);
      out += 3;
      while (out[-1] == '0') --out;
      if (out[-1] == '.') --out;

            

Reported by FlawFinder.

src/third_party/wiredtiger/test/suite/test_env01.py
19 issues
Unable to import 'wiredtiger'
Error

Line: 30 Column: 1

              # OTHER DEALINGS IN THE SOFTWARE.

import os
import wiredtiger, wttest

# test_priv01.py
#    Test privileged operations.
#    This is a variant of test_config02.py.  This test should be run as both
# normal and privileged (e.g. root) user, and should pass in both cases.

            

Reported by Pylint.

Parameters differ from overridden 'setUpConnectionOpen' method
Error

Line: 56 Column: 5

              
    # Each test needs to set up its connection in its own way,
    # so override these methods to do nothing
    def setUpConnectionOpen(self, dir):
        return None

    def setUpSessionOpen(self, conn):
        return None


            

Reported by Pylint.

Unused argument 'dir'
Error

Line: 56 Column: 35

              
    # Each test needs to set up its connection in its own way,
    # so override these methods to do nothing
    def setUpConnectionOpen(self, dir):
        return None

    def setUpSessionOpen(self, conn):
        return None


            

Reported by Pylint.

Redefining built-in 'dir'
Error

Line: 56 Column: 35

              
    # Each test needs to set up its connection in its own way,
    # so override these methods to do nothing
    def setUpConnectionOpen(self, dir):
        return None

    def setUpSessionOpen(self, conn):
        return None


            

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_priv01.py
#    Test privileged operations.
#    This is a variant of test_config02.py.  This test should be run as both
# normal and privileged (e.g. root) user, and should pass in both cases.

            

Reported by Pylint.

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

Line: 36 Column: 1

              #    Test privileged operations.
#    This is a variant of test_config02.py.  This test should be run as both
# normal and privileged (e.g. root) user, and should pass in both cases.
class test_priv01(wttest.WiredTigerTestCase):
    """
    This tests privileged operations.
    The only part of WiredTiger that currently cares about privilege
    levels is the 'use_environment_priv' configuration option for
    wiredtiger_open, which by design, behaves differently depending on

            

Reported by Pylint.

Consider using Python 3 style super() without arguments
Error

Line: 52 Column: 9

                  def setUp(self):
        if os.name == 'nt':
            self.skipTest('Unix specific test skipped on Windows')
        super(test_priv01, self).setUp()

    # Each test needs to set up its connection in its own way,
    # so override these methods to do nothing
    def setUpConnectionOpen(self, dir):
        return None

            

Reported by Pylint.

Missing function or method docstring
Error

Line: 80 Column: 5

                      self.assertEqual(i, self.nentries)
        cursor.close()

    def checkfiles(self, dirname):
        self.assertTrue(os.path.exists(dirname + os.sep + self.table_name1 + ".wt"))

    def checknofiles(self, dirname):
        nfiles = len([nm for nm in os.listdir(dirname) if os.path.isfile(nm)])
        self.assertEqual(nfiles, 0)

            

Reported by Pylint.

Missing function or method docstring
Error

Line: 83 Column: 5

                  def checkfiles(self, dirname):
        self.assertTrue(os.path.exists(dirname + os.sep + self.table_name1 + ".wt"))

    def checknofiles(self, dirname):
        nfiles = len([nm for nm in os.listdir(dirname) if os.path.isfile(nm)])
        self.assertEqual(nfiles, 0)

    def common_test(self, homearg, homeenv, configextra):
        """

            

Reported by Pylint.

src/third_party/wiredtiger/test/suite/test_txn08.py
19 issues
Unable to import 'wiredtiger'
Error

Line: 35 Column: 1

              
import fnmatch, os, shutil, run, time
from suite_subprocess import suite_subprocess
from wiredtiger import stat
import wttest
from wtscenario import make_scenarios

class test_txn08(wttest.WiredTigerTestCase, suite_subprocess):
    logmax = "100K"

            

Reported by Pylint.

An attribute defined in wttest line 401 hides this method
Error

Line: 51 Column: 5

                  scenarios = make_scenarios(key_format_values)

    # Turn on logging for this test.
    def conn_config(self):
        return 'log=(archive=false,enabled,file_max=%s),' % self.logmax + \
            'transaction_sync="(method=dsync,enabled)"'

    def test_printlog_unicode(self):
        create_params = 'key_format={},value_format=S'.format(self.key_format)

            

Reported by Pylint.

Unused import run
Error

Line: 33 Column: 1

              # Printlog: test Unicode output
#

import fnmatch, os, shutil, run, time
from suite_subprocess import suite_subprocess
from wiredtiger import stat
import wttest
from wtscenario import make_scenarios


            

Reported by Pylint.

Unused import time
Error

Line: 33 Column: 1

              # Printlog: test Unicode output
#

import fnmatch, os, shutil, run, time
from suite_subprocess import suite_subprocess
from wiredtiger import stat
import wttest
from wtscenario import make_scenarios


            

Reported by Pylint.

Unused import fnmatch
Error

Line: 33 Column: 1

              # Printlog: test Unicode output
#

import fnmatch, os, shutil, run, time
from suite_subprocess import suite_subprocess
from wiredtiger import stat
import wttest
from wtscenario import make_scenarios


            

Reported by Pylint.

Unused import os
Error

Line: 33 Column: 1

              # Printlog: test Unicode output
#

import fnmatch, os, shutil, run, time
from suite_subprocess import suite_subprocess
from wiredtiger import stat
import wttest
from wtscenario import make_scenarios


            

Reported by Pylint.

Unused import shutil
Error

Line: 33 Column: 1

              # Printlog: test Unicode output
#

import fnmatch, os, shutil, run, time
from suite_subprocess import suite_subprocess
from wiredtiger import stat
import wttest
from wtscenario import make_scenarios


            

Reported by Pylint.

Unused stat imported from wiredtiger
Error

Line: 35 Column: 1

              
import fnmatch, os, shutil, run, time
from suite_subprocess import suite_subprocess
from wiredtiger import stat
import wttest
from wtscenario import make_scenarios

class test_txn08(wttest.WiredTigerTestCase, suite_subprocess):
    logmax = "100K"

            

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, shutil, run, time)
Error

Line: 33 Column: 1

              # Printlog: test Unicode output
#

import fnmatch, os, shutil, run, time
from suite_subprocess import suite_subprocess
from wiredtiger import stat
import wttest
from wtscenario import make_scenarios


            

Reported by Pylint.

src/third_party/wiredtiger/test/suite/test_bug025.py
19 issues
Unable to import 'wiredtiger'
Error

Line: 30 Column: 1

              # OTHER DEALINGS IN THE SOFTWARE.

from helper import copy_wiredtiger_home
import wiredtiger, wttest
from wtdataset import ComplexDataSet
import os, shutil

# test_bug025.py
# WT-7208: After a missing index is accessed, we return an error.

            

Reported by Pylint.

Unused copy_wiredtiger_home imported from helper
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 helper import copy_wiredtiger_home
import wiredtiger, wttest
from wtdataset import ComplexDataSet
import os, shutil

# test_bug025.py

            

Reported by Pylint.

Unused import wiredtiger
Error

Line: 30 Column: 1

              # OTHER DEALINGS IN THE SOFTWARE.

from helper import copy_wiredtiger_home
import wiredtiger, wttest
from wtdataset import ComplexDataSet
import os, shutil

# test_bug025.py
# WT-7208: After a missing index is accessed, we return an error.

            

Reported by Pylint.

Unused import shutil
Error

Line: 32 Column: 1

              from helper import copy_wiredtiger_home
import wiredtiger, wttest
from wtdataset import ComplexDataSet
import os, shutil

# test_bug025.py
# WT-7208: After a missing index is accessed, we return an error.
# After a later access, we crash (null pointer access).
#

            

Reported by Pylint.

Unused variable 'pos'
Error

Line: 55 Column: 9

                      iname_suffix = iname[iname.rindex(':') + 1:]
        filename = 'test_bug025_' + iname_suffix + '.wti'
        self.close_conn()
        pos = os.path.getsize(filename) - 1024
        os.remove(filename)

        # We will get error output, but not always in the same API calls from run to run,
        # in particular the open connection doesn't always report the missing file, as
        # index files are usually lazily loaded. As long as the missing file is reported

            

Reported by Pylint.

Catching too general exception Exception
Error

Line: 72 Column: 20

                          # The insert fails, and the cursor remains open.
            try:
                cursor[newkey] = newval
            except Exception as e:
                self.pr('Exception in first access: ' + str(e))

            # The insert fails again.  Before the associated fix was made, the insert crashed.
            try:
                cursor[newkey] = newval    # point of crash

            

Reported by Pylint.

Catching too general exception Exception
Error

Line: 78 Column: 20

                          # The insert fails again.  Before the associated fix was made, the insert crashed.
            try:
                cursor[newkey] = newval    # point of crash
            except Exception as e:
                self.pr('Exception in second access: ' + str(e))

            cursor.close()

if __name__ == '__main__':

            

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

              # OTHER DEALINGS IN THE SOFTWARE.

from helper import copy_wiredtiger_home
import wiredtiger, wttest
from wtdataset import ComplexDataSet
import os, shutil

# test_bug025.py
# WT-7208: After a missing index is accessed, we return an error.

            

Reported by Pylint.

Multiple imports on one line (wiredtiger, wttest)
Error

Line: 30 Column: 1

              # OTHER DEALINGS IN THE SOFTWARE.

from helper import copy_wiredtiger_home
import wiredtiger, wttest
from wtdataset import ComplexDataSet
import os, shutil

# test_bug025.py
# WT-7208: After a missing index is accessed, we return an error.

            

Reported by Pylint.

src/third_party/wiredtiger/test/suite/test_encrypt07.py
19 issues
Unable to import 'wiredtiger'
Error

Line: 34 Column: 1

              #

import os, run, string, codecs
import wiredtiger, wttest
import test_salvage

# Run the regular salvage test, but with encryption on
class test_encrypt07(test_salvage.test_salvage):


            

Reported by Pylint.

An attribute defined in wttest line 401 hides this method
Error

Line: 52 Column: 5

                      extlist.skip_if_missing = True
        extlist.extension('encryptors', self.sys_encrypt)

    def conn_config(self):
        return 'encryption=(name={0}{1}),'.format(
            self.sys_encrypt, self.sys_encrypt_args)

    def rot13(self, s):
        return codecs.encode(s, 'rot_13')

            

Reported by Pylint.

Unused import string
Error

Line: 33 Column: 1

              #   Salvage encrypted databases
#

import os, run, string, codecs
import wiredtiger, wttest
import test_salvage

# Run the regular salvage test, but with encryption on
class test_encrypt07(test_salvage.test_salvage):

            

Reported by Pylint.

Unused import run
Error

Line: 33 Column: 1

              #   Salvage encrypted databases
#

import os, run, string, codecs
import wiredtiger, wttest
import test_salvage

# Run the regular salvage test, but with encryption on
class test_encrypt07(test_salvage.test_salvage):

            

Reported by Pylint.

Unused import os
Error

Line: 33 Column: 1

              #   Salvage encrypted databases
#

import os, run, string, codecs
import wiredtiger, wttest
import test_salvage

# Run the regular salvage test, but with encryption on
class test_encrypt07(test_salvage.test_salvage):

            

Reported by Pylint.

Unused import wiredtiger
Error

Line: 34 Column: 1

              #

import os, run, string, codecs
import wiredtiger, wttest
import test_salvage

# Run the regular salvage test, but with encryption on
class test_encrypt07(test_salvage.test_salvage):


            

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, run, string, codecs)
Error

Line: 33 Column: 1

              #   Salvage encrypted databases
#

import os, run, string, codecs
import wiredtiger, wttest
import test_salvage

# Run the regular salvage test, but with encryption on
class test_encrypt07(test_salvage.test_salvage):

            

Reported by Pylint.

standard import "import os, run, string, codecs" should be placed before "import os, run, string, codecs"
Error

Line: 33 Column: 1

              #   Salvage encrypted databases
#

import os, run, string, codecs
import wiredtiger, wttest
import test_salvage

# Run the regular salvage test, but with encryption on
class test_encrypt07(test_salvage.test_salvage):

            

Reported by Pylint.

standard import "import os, run, string, codecs" should be placed before "import os, run, string, codecs"
Error

Line: 33 Column: 1

              #   Salvage encrypted databases
#

import os, run, string, codecs
import wiredtiger, wttest
import test_salvage

# Run the regular salvage test, but with encryption on
class test_encrypt07(test_salvage.test_salvage):

            

Reported by Pylint.

src/third_party/mozjs-60/extract/js/src/jit/x86/Lowering-x86.cpp
19 issues
access - This usually indicates a security flaw. If an attacker can change anything along the path between the call to access() and the file's actual use (e.g., by moving files), the attacker can exploit the race condition
Security

Line: 295 Column: 14 CWE codes: 362/367!
Suggestion: Set up the correct permissions (e.g., using setuid()) and try to open the file directly

                  MDefinition* memoryBase = ins->memoryBase();
    MOZ_ASSERT(memoryBase->type() == MIRType::Pointer);

    if (ins->access().type() == Scalar::Int64 && ins->access().isAtomic()) {
        auto* lir = new(alloc()) LWasmAtomicLoadI64(useRegister(memoryBase),
                                                    useRegister(base),
                                                    tempFixed(ecx),
                                                    tempFixed(ebx));
        defineInt64Fixed(lir, ins, LInt64Allocation(LAllocation(AnyRegister(edx)),

            

Reported by FlawFinder.

access - This usually indicates a security flaw. If an attacker can change anything along the path between the call to access() and the file's actual use (e.g., by moving files), the attacker can exploit the race condition
Security

Line: 295 Column: 55 CWE codes: 362/367!
Suggestion: Set up the correct permissions (e.g., using setuid()) and try to open the file directly

                  MDefinition* memoryBase = ins->memoryBase();
    MOZ_ASSERT(memoryBase->type() == MIRType::Pointer);

    if (ins->access().type() == Scalar::Int64 && ins->access().isAtomic()) {
        auto* lir = new(alloc()) LWasmAtomicLoadI64(useRegister(memoryBase),
                                                    useRegister(base),
                                                    tempFixed(ecx),
                                                    tempFixed(ebx));
        defineInt64Fixed(lir, ins, LInt64Allocation(LAllocation(AnyRegister(edx)),

            

Reported by FlawFinder.

access - This usually indicates a security flaw. If an attacker can change anything along the path between the call to access() and the file's actual use (e.g., by moving files), the attacker can exploit the race condition
Security

Line: 310 Column: 73 CWE codes: 362/367!
Suggestion: Set up the correct permissions (e.g., using setuid()) and try to open the file directly

                  // pointer to a register only if that can't happen.

    LAllocation baseAlloc;
    if (!base->isConstant() || !(base->toConstant()->isInt32(0) || ins->access().offset() == 0))
        baseAlloc = ins->type() == MIRType::Int64 ? useRegister(base) : useRegisterAtStart(base);

    if (ins->type() != MIRType::Int64) {
        auto* lir = new(alloc()) LWasmLoad(baseAlloc, useRegisterAtStart(memoryBase));
        define(lir, ins);

            

Reported by FlawFinder.

access - This usually indicates a security flaw. If an attacker can change anything along the path between the call to access() and the file's actual use (e.g., by moving files), the attacker can exploit the race condition
Security

Line: 325 Column: 36 CWE codes: 362/367!
Suggestion: Set up the correct permissions (e.g., using setuid()) and try to open the file directly

              
    auto* lir = new(alloc()) LWasmLoadI64(baseAlloc, useRegister(memoryBase));

    Scalar::Type accessType = ins->access().type();
    if (accessType == Scalar::Int8 || accessType == Scalar::Int16 || accessType == Scalar::Int32) {
        // We use cdq to sign-extend the result and cdq demands these registers.
        defineInt64Fixed(lir, ins, LInt64Allocation(LAllocation(AnyRegister(edx)),
                                                    LAllocation(AnyRegister(eax))));
        return;

            

Reported by FlawFinder.

access - This usually indicates a security flaw. If an attacker can change anything along the path between the call to access() and the file's actual use (e.g., by moving files), the attacker can exploit the race condition
Security

Line: 345 Column: 55 CWE codes: 362/367!
Suggestion: Set up the correct permissions (e.g., using setuid()) and try to open the file directly

                  MDefinition* memoryBase = ins->memoryBase();
    MOZ_ASSERT(memoryBase->type() == MIRType::Pointer);

    if (ins->access().type() == Scalar::Int64 && ins->access().isAtomic()) {
        auto* lir = new(alloc()) LWasmAtomicStoreI64(useRegister(memoryBase),
                                                     useRegister(base),
                                                     useInt64Fixed(ins->value(),
                                                                   Register64(ecx, ebx)),
                                                     tempFixed(edx),

            

Reported by FlawFinder.

access - This usually indicates a security flaw. If an attacker can change anything along the path between the call to access() and the file's actual use (e.g., by moving files), the attacker can exploit the race condition
Security

Line: 345 Column: 14 CWE codes: 362/367!
Suggestion: Set up the correct permissions (e.g., using setuid()) and try to open the file directly

                  MDefinition* memoryBase = ins->memoryBase();
    MOZ_ASSERT(memoryBase->type() == MIRType::Pointer);

    if (ins->access().type() == Scalar::Int64 && ins->access().isAtomic()) {
        auto* lir = new(alloc()) LWasmAtomicStoreI64(useRegister(memoryBase),
                                                     useRegister(base),
                                                     useInt64Fixed(ins->value(),
                                                                   Register64(ecx, ebx)),
                                                     tempFixed(edx),

            

Reported by FlawFinder.

access - This usually indicates a security flaw. If an attacker can change anything along the path between the call to access() and the file's actual use (e.g., by moving files), the attacker can exploit the race condition
Security

Line: 361 Column: 73 CWE codes: 362/367!
Suggestion: Set up the correct permissions (e.g., using setuid()) and try to open the file directly

                  // pointer to a register only if that can't happen.

    LAllocation baseAlloc;
    if (!base->isConstant() || !(base->toConstant()->isInt32(0) || ins->access().offset() == 0))
        baseAlloc = useRegisterAtStart(base);

    LAllocation valueAlloc;
    switch (ins->access().type()) {
      case Scalar::Int8: case Scalar::Uint8:

            

Reported by FlawFinder.

access - This usually indicates a security flaw. If an attacker can change anything along the path between the call to access() and the file's actual use (e.g., by moving files), the attacker can exploit the race condition
Security

Line: 365 Column: 18 CWE codes: 362/367!
Suggestion: Set up the correct permissions (e.g., using setuid()) and try to open the file directly

                      baseAlloc = useRegisterAtStart(base);

    LAllocation valueAlloc;
    switch (ins->access().type()) {
      case Scalar::Int8: case Scalar::Uint8:
        // See comment for LIRGeneratorX86::useByteOpRegister.
        valueAlloc = useFixed(ins->value(), eax);
        break;
      case Scalar::Int16: case Scalar::Uint16:

            

Reported by FlawFinder.

access - This usually indicates a security flaw. If an attacker can change anything along the path between the call to access() and the file's actual use (e.g., by moving files), the attacker can exploit the race condition
Security

Line: 444 Column: 18 CWE codes: 362/367!
Suggestion: Set up the correct permissions (e.g., using setuid()) and try to open the file directly

                                         : LAllocation();

    LAsmJSStoreHeap* lir = nullptr;
    switch (ins->access().type()) {
      case Scalar::Int8: case Scalar::Uint8:
        // See comment for LIRGeneratorX86::useByteOpRegister.
        lir = new(alloc()) LAsmJSStoreHeap(baseAlloc, useFixed(ins->value(), eax),
                                           limitAlloc, useRegisterAtStart(memoryBase));
        break;

            

Reported by FlawFinder.

access - This usually indicates a security flaw. If an attacker can change anything along the path between the call to access() and the file's actual use (e.g., by moving files), the attacker can exploit the race condition
Security

Line: 480 Column: 14 CWE codes: 362/367!
Suggestion: Set up the correct permissions (e.g., using setuid()) and try to open the file directly

                  MDefinition* memoryBase = ins->memoryBase();
    MOZ_ASSERT(memoryBase->type() == MIRType::Pointer);

    if (ins->access().type() == Scalar::Int64) {
        auto* lir = new(alloc()) LWasmCompareExchangeI64(useRegister(memoryBase),
                                                         useRegister(base),
                                                         useInt64Fixed(ins->oldValue(),
                                                                       Register64(edx, eax)),
                                                         useInt64Fixed(ins->newValue(),

            

Reported by FlawFinder.

src/third_party/wiredtiger/test/suite/test_join10.py
19 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_join10.py
#    Test modeled on the C example for join.
class test_join10(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_join10.py
#    Test modeled on the C example for join.
class test_join10(wttest.WiredTigerTestCase):

            

Reported by Pylint.

Unused make_scenarios imported from wtscenario
Error

Line: 30 Column: 1

              # OTHER DEALINGS IN THE SOFTWARE.

import wiredtiger, wttest
from wtscenario import make_scenarios

# test_join10.py
#    Test modeled on the C example for join.
class test_join10(wttest.WiredTigerTestCase):


            

Reported by Pylint.

Unused variable 'valstr'
Error

Line: 41 Column: 23

              
    def check_stats(self, jc, expect):
        statcursor = self.session.open_cursor('statistics:join', jc, None)
        for id, desc, valstr, val in statcursor:
            if desc in expect:
                expect_val = expect.pop(desc)
                self.assertEqual(val, expect_val)
        self.assertTrue(len(expect) == 0,
                        'missing expected values in stats: ' + str(expect))

            

Reported by Pylint.

Redefining built-in 'id'
Error

Line: 41 Column: 13

              
    def check_stats(self, jc, expect):
        statcursor = self.session.open_cursor('statistics:join', jc, None)
        for id, desc, valstr, val in statcursor:
            if desc in expect:
                expect_val = expect.pop(desc)
                self.assertEqual(val, expect_val)
        self.assertTrue(len(expect) == 0,
                        'missing expected values in stats: ' + str(expect))

            

Reported by Pylint.

Unused variable 'id'
Error

Line: 41 Column: 13

              
    def check_stats(self, jc, expect):
        statcursor = self.session.open_cursor('statistics:join', jc, None)
        for id, desc, valstr, val in statcursor:
            if desc in expect:
                expect_val = expect.pop(desc)
                self.assertEqual(val, expect_val)
        self.assertTrue(len(expect) == 0,
                        'missing expected values in stats: ' + str(expect))

            

Reported by Pylint.

Unused variable 'recno'
Error

Line: 95 Column: 13

                      # Check results
        expect = [[c,y,p] for c,y,p in pop_data if c == "AU" and y > 1900]
        got = []
        for recno, country, year, population in join_cursor:
            got.append([country, year, population])
        self.assertEqual(expect, got)

        # Check statistics
        # It may seem odd to encode specific values to check against, but each of these

            

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_join10.py
#    Test modeled on the C example for join.
class test_join10(wttest.WiredTigerTestCase):

            

Reported by Pylint.

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

Line: 34 Column: 1

              
# test_join10.py
#    Test modeled on the C example for join.
class test_join10(wttest.WiredTigerTestCase):

    # We need statistics for these tests.
    conn_config = 'statistics=(all)'

    def check_stats(self, jc, expect):

            

Reported by Pylint.