The following issues were found

src/third_party/scons-3.1.2/scons-local-3.1.2/SCons/SConsign.py
71 issues
Chmod setting a permissive mask 0o666 on file (NOT PARSED).
Security

Line: 385
Suggestion: https://bandit.readthedocs.io/en/latest/plugins/b103_set_bad_file_permissions.html

                      if fname != self.sconsign:
            try:
                mode = os.stat(self.sconsign)[0]
                os.chmod(self.sconsign, 0o666)
                os.unlink(self.sconsign)
            except (IOError, OSError):
                # Try to carry on in the face of either OSError
                # (things like permission issues) or IOError (disk
                # or network issues).  If there's a really dangerous

            

Reported by Bandit.

Instance of 'SConsignEntry' has no 'binfo' member
Error

Line: 144 Column: 9

                      pass

    def convert_to_sconsign(self):
        self.binfo.convert_to_sconsign()

    def convert_from_sconsign(self, dir, name):
        self.binfo.convert_from_sconsign(dir, name)

    def __getstate__(self):

            

Reported by Pylint.

Instance of 'SConsignEntry' has no 'binfo' member
Error

Line: 147 Column: 9

                      self.binfo.convert_to_sconsign()

    def convert_from_sconsign(self, dir, name):
        self.binfo.convert_from_sconsign(dir, name)

    def __getstate__(self):
        state = getattr(self, '__dict__', {}).copy()
        for obj in type(self).mro():
            for name in getattr(obj,'__slots__',()):

            

Reported by Pylint.

XXX Get rid of the global array so this becomes re-entrant.
Error

Line: 52 Column: 3

              SCons.dblite.ignore_corrupt_dbfiles = 1
SCons.dblite.corruption_warning = corrupt_dblite_warning

# XXX Get rid of the global array so this becomes re-entrant.
sig_files = []

# Info for the database SConsign implementation (now the default):
# "DataBase" is a dictionary that maps top-level SConstruct directories
# to open database handles.

            

Reported by Pylint.

Redefining built-in 'dir'
Error

Line: 67 Column: 18

              DB_sync_list = []


def Get_DataBase(dir):
    global DataBase, DB_Module, DB_Name
    top = dir.fs.Top
    if not os.path.isabs(DB_Name) and top.repositories:
        mode = "c"
        for d in [top] + top.repositories:

            

Reported by Pylint.

Using the global statement
Error

Line: 68 Column: 5

              

def Get_DataBase(dir):
    global DataBase, DB_Module, DB_Name
    top = dir.fs.Top
    if not os.path.isabs(DB_Name) and top.repositories:
        mode = "c"
        for d in [top] + top.repositories:
            if dir.is_under(d):

            

Reported by Pylint.

Using the global statement
Error

Line: 100 Column: 5

              def Reset():
    """Reset global state.  Used by unit tests that end up using
    SConsign multiple times to get a clean slate for each test."""
    global sig_files, DB_sync_list
    sig_files = []
    DB_sync_list = []

normcase = os.path.normcase


            

Reported by Pylint.

Using the global statement
Error

Line: 108 Column: 5

              

def write():
    global sig_files
    for sig_file in sig_files:
        sig_file.write(sync=0)
    for db in DB_sync_list:
        try:
            syncmethod = db.sync

            

Reported by Pylint.

Redefining built-in 'dir'
Error

Line: 146 Column: 37

                  def convert_to_sconsign(self):
        self.binfo.convert_to_sconsign()

    def convert_from_sconsign(self, dir, name):
        self.binfo.convert_from_sconsign(dir, name)

    def __getstate__(self):
        state = getattr(self, '__dict__', {}).copy()
        for obj in type(self).mro():

            

Reported by Pylint.

Redefining built-in 'dir'
Error

Line: 230 Column: 24

                  from a global .sconsign.db* file--the actual file suffix is
    determined by the database module.
    """
    def __init__(self, dir):
        Base.__init__(self)

        self.dir = dir

        db, mode = Get_DataBase(dir)

            

Reported by Pylint.

src/third_party/wiredtiger/bench/workgen/runner/compress_ratio.py
71 issues
Unable to import 'wiredtiger'
Error

Line: 43 Column: 1

              # run on.
#
from runner import *
from wiredtiger import *
from workgen import *

def op_append(ops, op):
    if ops == None:
        ops = op

            

Reported by Pylint.

Unable to import 'workgen'
Error

Line: 44 Column: 1

              #
from runner import *
from wiredtiger import *
from workgen import *

def op_append(ops, op):
    if ops == None:
        ops = op
    else:

            

Reported by Pylint.

function already defined line 42
Error

Line: 46 Column: 1

              from wiredtiger import *
from workgen import *

def op_append(ops, op):
    if ops == None:
        ops = op
    else:
        ops += op
    return ops

            

Reported by Pylint.

Undefined variable 'Operation'
Error

Line: 55 Column: 16

              
def make_op(optype, table, key, value = None):
    if value == None:
        return Operation(optype, table, key)
    else:
        return Operation(optype, table, key, value)

logkey = Key(Key.KEYGEN_APPEND, 8)  ## should be 8 bytes format 'Q'
def operations(optype, tables, key, value = None, ops_per_txn = 0, logtable = None):

            

Reported by Pylint.

Undefined variable 'Operation'
Error

Line: 57 Column: 16

                  if value == None:
        return Operation(optype, table, key)
    else:
        return Operation(optype, table, key, value)

logkey = Key(Key.KEYGEN_APPEND, 8)  ## should be 8 bytes format 'Q'
def operations(optype, tables, key, value = None, ops_per_txn = 0, logtable = None):
    txn_list = []
    ops = None

            

Reported by Pylint.

Undefined variable 'Key'
Error

Line: 59 Column: 10

                  else:
        return Operation(optype, table, key, value)

logkey = Key(Key.KEYGEN_APPEND, 8)  ## should be 8 bytes format 'Q'
def operations(optype, tables, key, value = None, ops_per_txn = 0, logtable = None):
    txn_list = []
    ops = None
    nops = 0
    for table in tables:

            

Reported by Pylint.

Undefined variable 'Key'
Error

Line: 59 Column: 14

                  else:
        return Operation(optype, table, key, value)

logkey = Key(Key.KEYGEN_APPEND, 8)  ## should be 8 bytes format 'Q'
def operations(optype, tables, key, value = None, ops_per_txn = 0, logtable = None):
    txn_list = []
    ops = None
    nops = 0
    for table in tables:

            

Reported by Pylint.

Undefined variable 'Context'
Error

Line: 80 Column: 11

                          ops = op_append(ops, t)
    return ops

context = Context()
conn_config="create,cache_size=2GB,session_max=1000,eviction=(threads_min=4,threads_max=4),log=(enabled=false),transaction_sync=(enabled=false),checkpoint_sync=false,checkpoint=(wait=20),statistics=(fast),statistics_log=(json,wait=1)"
table_config="allocation_size=4k,memory_page_max=10MB,prefix_compression=false,split_pct=90,leaf_page_max=32k,internal_page_max=16k,type=file"
compression_opts = {
    "none" : "block_compressor=none",
    "lz4" : "block_compressor=lz4",

            

Reported by Pylint.

Instance of 'dict' has no 'iteritems' member
Error

Line: 104 Column: 34

              s = conn.open_session()

tables = []
for name_ext, compress_config in compression_opts.iteritems():
    tname = "table:test_" + name_ext
    s.create(tname, 'key_format=S,value_format=S,' + table_config + "," + compress_config)
    table = Table(tname)
    table.options.value_compressibility = 70
    tables.append(table)

            

Reported by Pylint.

Undefined variable 'Table'
Error

Line: 107 Column: 13

              for name_ext, compress_config in compression_opts.iteritems():
    tname = "table:test_" + name_ext
    s.create(tname, 'key_format=S,value_format=S,' + table_config + "," + compress_config)
    table = Table(tname)
    table.options.value_compressibility = 70
    tables.append(table)

icount=500000
ins_ops = operations(Operation.OP_INSERT, tables, Key(Key.KEYGEN_APPEND, 20), Value(500))

            

Reported by Pylint.

src/third_party/boost/libs/iostreams/src/file_descriptor.cpp
71 issues
open - 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: 64 Column: 10 CWE codes: 362

              
    file_descriptor_impl();
    ~file_descriptor_impl();
    void open(file_handle fd, flags);
#ifdef BOOST_IOSTREAMS_WINDOWS
    void open(int fd, flags);
#endif
    void open(const detail::path&, BOOST_IOS::openmode);
    bool is_open() const;

            

Reported by FlawFinder.

open - 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: 66 Column: 10 CWE codes: 362

                  ~file_descriptor_impl();
    void open(file_handle fd, flags);
#ifdef BOOST_IOSTREAMS_WINDOWS
    void open(int fd, flags);
#endif
    void open(const detail::path&, BOOST_IOS::openmode);
    bool is_open() const;
    void close();
    void close_impl(bool close_flag, bool throw_);

            

Reported by FlawFinder.

open - 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: 68 Column: 10 CWE codes: 362

              #ifdef BOOST_IOSTREAMS_WINDOWS
    void open(int fd, flags);
#endif
    void open(const detail::path&, BOOST_IOS::openmode);
    bool is_open() const;
    void close();
    void close_impl(bool close_flag, bool throw_);
    std::streamsize read(char* s, std::streamsize n);
    std::streamsize write(const char* s, std::streamsize n);

            

Reported by FlawFinder.

open - 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: 91 Column: 28 CWE codes: 362

                  close_impl(flags_ & close_on_exit, false);
}

void file_descriptor_impl::open(file_handle fd, flags f)
{
    // Using 'close' to close the existing handle so that it will throw an
    // exception if it fails.
    //
    // Only closing after assigning the new handle, so that the class will

            

Reported by FlawFinder.

open - 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: 111 Column: 28 CWE codes: 362

              
#ifdef BOOST_IOSTREAMS_WINDOWS //---------------------------------------------//

void file_descriptor_impl::open(int fd, flags f)
{ open(reinterpret_cast<file_handle>(_get_osfhandle(fd)), f); }

#endif // #ifdef BOOST_IOSTREAMS_WINDOWS //-----------------------------------//

void file_descriptor_impl::open(const detail::path& p, BOOST_IOS::openmode mode)

            

Reported by FlawFinder.

open - 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: 112 Column: 3 CWE codes: 362

              #ifdef BOOST_IOSTREAMS_WINDOWS //---------------------------------------------//

void file_descriptor_impl::open(int fd, flags f)
{ open(reinterpret_cast<file_handle>(_get_osfhandle(fd)), f); }

#endif // #ifdef BOOST_IOSTREAMS_WINDOWS //-----------------------------------//

void file_descriptor_impl::open(const detail::path& p, BOOST_IOS::openmode mode)
{

            

Reported by FlawFinder.

open - 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: 116 Column: 28 CWE codes: 362

              
#endif // #ifdef BOOST_IOSTREAMS_WINDOWS //-----------------------------------//

void file_descriptor_impl::open(const detail::path& p, BOOST_IOS::openmode mode)
{
    close_impl(flags_ & close_on_exit, true);

#ifdef BOOST_IOSTREAMS_WINDOWS //---------------------------------------------//
    DWORD dwDesiredAccess;

            

Reported by FlawFinder.

open - 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: 380 Column: 3 CWE codes: 362

              
file_descriptor::file_descriptor(handle_type fd, file_descriptor_flags f)
    : pimpl_(new impl_type)
{ open(fd, f); }

#if defined(BOOST_IOSTREAMS_USE_DEPRECATED)
file_descriptor::file_descriptor(handle_type fd, bool close_on_exit)
    : pimpl_(new impl_type)
{ open(fd, close_on_exit); }

            

Reported by FlawFinder.

open - 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: 385 Column: 3 CWE codes: 362

              #if defined(BOOST_IOSTREAMS_USE_DEPRECATED)
file_descriptor::file_descriptor(handle_type fd, bool close_on_exit)
    : pimpl_(new impl_type)
{ open(fd, close_on_exit); }
#endif

#ifdef BOOST_IOSTREAMS_WINDOWS //---------------------------------------------//

file_descriptor::file_descriptor(int fd, file_descriptor_flags f)

            

Reported by FlawFinder.

open - 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: 392 Column: 3 CWE codes: 362

              
file_descriptor::file_descriptor(int fd, file_descriptor_flags f)
    : pimpl_(new impl_type)
{ open(fd, f); }

#if defined(BOOST_IOSTREAMS_USE_DEPRECATED)
file_descriptor::file_descriptor(int fd, bool close_on_exit)
    : pimpl_(new impl_type)
{ open(fd, close_on_exit); }

            

Reported by FlawFinder.

src/third_party/wiredtiger/test/suite/test_assert04.py
71 issues
Unable to import 'wiredtiger'
Error

Line: 34 Column: 1

              #

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

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


            

Reported by Pylint.

Lambda may not be necessary
Error

Line: 124 Column: 13

                          'commit_timestamp=' + self.timestamp_str(4))
        c[key_ts1] = 'value4'
        self.assertRaisesWithMessage(wiredtiger.WiredTigerError,
            lambda: self.session.commit_transaction(), msg_ooo)
        c.close()

        # Detect not using a timestamp.
        c = self.session.open_cursor(uri)
        self.session.begin_transaction()

            

Reported by Pylint.

Lambda may not be necessary
Error

Line: 132 Column: 13

                      self.session.begin_transaction()
        c[key_ts1] = 'value_nots3'
        self.assertRaisesWithMessage(wiredtiger.WiredTigerError,
            lambda: self.session.commit_transaction(), msg_usage)
        c.close()

        # Detect using a timestamp on the non-timestamp key.
        # We must first use a non timestamped operation on the key
        # in order to violate the key consistency condition in the

            

Reported by Pylint.

Lambda may not be necessary
Error

Line: 151 Column: 13

                          'commit_timestamp=' + self.timestamp_str(3))
        c[key_nots] = 'value3'
        self.assertRaisesWithMessage(wiredtiger.WiredTigerError,
            lambda: self.session.commit_transaction(), msg_usage)
        c.close()

        c = self.session.open_cursor(uri)
        self.assertEquals(c[key_ts1], 'value5')
        self.assertEquals(c[key_nots], 'value_nots3')

            

Reported by Pylint.

Using deprecated method assertEquals()
Error

Line: 155 Column: 9

                      c.close()

        c = self.session.open_cursor(uri)
        self.assertEquals(c[key_ts1], 'value5')
        self.assertEquals(c[key_nots], 'value_nots3')
        c.close()

        # Now alter the setting again and detection is off.
        self.conn.set_timestamp('oldest_timestamp=' + self.timestamp_str(5))

            

Reported by Pylint.

Using deprecated method assertEquals()
Error

Line: 156 Column: 9

              
        c = self.session.open_cursor(uri)
        self.assertEquals(c[key_ts1], 'value5')
        self.assertEquals(c[key_nots], 'value_nots3')
        c.close()

        # Now alter the setting again and detection is off.
        self.conn.set_timestamp('oldest_timestamp=' + self.timestamp_str(5))
        self.session.alter(uri, cfg_off)

            

Reported by Pylint.

Lambda may not be necessary
Error

Line: 215 Column: 13

                          'commit_timestamp=' + self.timestamp_str(1))
        c[key_ts1] = 'value1'
        self.assertRaisesWithMessage(wiredtiger.WiredTigerError,
            lambda: self.session.commit_transaction(), msg_ooo)
        c.close()

        # Make sure we can successfully add a different key at timestamp 1.
        c = self.session.open_cursor(uri)
        self.session.begin_transaction()

            

Reported by Pylint.

Lambda may not be necessary
Error

Line: 252 Column: 13

                      c[key_ts3] = 'value13'
        c[key_ts4] = 'value13'
        self.assertRaisesWithMessage(wiredtiger.WiredTigerError,
            lambda: self.session.commit_transaction(), msg_ooo)
        c.close()

        c = self.session.open_cursor(uri)
        self.assertEquals(c[key_ts3], 'value10')
        self.assertEquals(c[key_ts4], 'value15')

            

Reported by Pylint.

Using deprecated method assertEquals()
Error

Line: 256 Column: 9

                      c.close()

        c = self.session.open_cursor(uri)
        self.assertEquals(c[key_ts3], 'value10')
        self.assertEquals(c[key_ts4], 'value15')
        c.close()

        #
        # Separately, we should be able to update key_ts3 at timestamp 10

            

Reported by Pylint.

Using deprecated method assertEquals()
Error

Line: 257 Column: 9

              
        c = self.session.open_cursor(uri)
        self.assertEquals(c[key_ts3], 'value10')
        self.assertEquals(c[key_ts4], 'value15')
        c.close()

        #
        # Separately, we should be able to update key_ts3 at timestamp 10
        # but not update key_ts4 inserted at timestamp 15.

            

Reported by Pylint.

src/third_party/wiredtiger/bench/workgen/runner/read_write_sync_long.py
70 issues
Unable to import 'wiredtiger'
Error

Line: 35 Column: 1

              import sys

from runner import *
from wiredtiger import *
from workgen import *

context = Context()
conn_config = ""
conn_config += ",cache_size=2GB,eviction=(threads_max=8),log=(enabled=true),session_max=250,statistics=(fast),statistics_log=(wait=1,json)"   # explicitly added

            

Reported by Pylint.

Unable to import 'workgen'
Error

Line: 36 Column: 1

              
from runner import *
from wiredtiger import *
from workgen import *

context = Context()
conn_config = ""
conn_config += ",cache_size=2GB,eviction=(threads_max=8),log=(enabled=true),session_max=250,statistics=(fast),statistics_log=(wait=1,json)"   # explicitly added
conn = context.wiredtiger_open("create," + conn_config)

            

Reported by Pylint.

Undefined variable 'Context'
Error

Line: 38 Column: 11

              from wiredtiger import *
from workgen import *

context = Context()
conn_config = ""
conn_config += ",cache_size=2GB,eviction=(threads_max=8),log=(enabled=true),session_max=250,statistics=(fast),statistics_log=(wait=1,json)"   # explicitly added
conn = context.wiredtiger_open("create," + conn_config)
s = conn.open_session("")


            

Reported by Pylint.

Undefined variable 'Table'
Error

Line: 53 Column: 13

              table_count = 100
for i in range(0, table_count):
    tname = "table:test" + str(i)
    table = Table(tname)
    s.create(tname, wtperf_table_config +\
             compress_table_config + table_config)
    table.options.key_size = 20
    table.options.value_size = 7000
    tables.append(table)

            

Reported by Pylint.

Undefined variable 'Operation'
Error

Line: 64 Column: 21

              icount = 4000000
# There are multiple tables to be filled during populate,
# the icount is split between them all.
pop_ops = Operation(Operation.OP_INSERT, tables[0])
pop_ops = op_multi_table(pop_ops, tables)
nops_per_thread = icount // (populate_threads * table_count)
pop_thread = Thread(pop_ops * nops_per_thread)
pop_workload = Workload(context, populate_threads * pop_thread)
pop_workload.run(conn)

            

Reported by Pylint.

Undefined variable 'Operation'
Error

Line: 64 Column: 11

              icount = 4000000
# There are multiple tables to be filled during populate,
# the icount is split between them all.
pop_ops = Operation(Operation.OP_INSERT, tables[0])
pop_ops = op_multi_table(pop_ops, tables)
nops_per_thread = icount // (populate_threads * table_count)
pop_thread = Thread(pop_ops * nops_per_thread)
pop_workload = Workload(context, populate_threads * pop_thread)
pop_workload.run(conn)

            

Reported by Pylint.

Undefined variable 'Thread'
Error

Line: 67 Column: 14

              pop_ops = Operation(Operation.OP_INSERT, tables[0])
pop_ops = op_multi_table(pop_ops, tables)
nops_per_thread = icount // (populate_threads * table_count)
pop_thread = Thread(pop_ops * nops_per_thread)
pop_workload = Workload(context, populate_threads * pop_thread)
pop_workload.run(conn)
print('populate complete')

# Log like file, requires that logging be enabled in the connection config.

            

Reported by Pylint.

Undefined variable 'Workload'
Error

Line: 68 Column: 16

              pop_ops = op_multi_table(pop_ops, tables)
nops_per_thread = icount // (populate_threads * table_count)
pop_thread = Thread(pop_ops * nops_per_thread)
pop_workload = Workload(context, populate_threads * pop_thread)
pop_workload.run(conn)
print('populate complete')

# Log like file, requires that logging be enabled in the connection config.
log_name = "table:log"

            

Reported by Pylint.

Undefined variable 'Table'
Error

Line: 75 Column: 13

              # Log like file, requires that logging be enabled in the connection config.
log_name = "table:log"
s.create(log_name, wtperf_table_config + "key_format=S,value_format=S," + compress_table_config + table_config + ",log=(enabled=true)")
log_table = Table(log_name)

ops = Operation(Operation.OP_UPDATE, tables[0])
ops = op_multi_table(ops, tables, False)
ops = op_log_like(ops, log_table, 0)
thread0 = Thread(ops)

            

Reported by Pylint.

Undefined variable 'Operation'
Error

Line: 77 Column: 17

              s.create(log_name, wtperf_table_config + "key_format=S,value_format=S," + compress_table_config + table_config + ",log=(enabled=true)")
log_table = Table(log_name)

ops = Operation(Operation.OP_UPDATE, tables[0])
ops = op_multi_table(ops, tables, False)
ops = op_log_like(ops, log_table, 0)
thread0 = Thread(ops)
# These operations include log_like operations, which will increase the number
# of insert/update operations by a factor of 2.0. This may cause the

            

Reported by Pylint.

src/third_party/wiredtiger/test/3rdparty/testtools-0.9.34/testtools/tests/test_testsuite.py
70 issues
Unable to import 'extras'
Error

Line: 12 Column: 1

              import sys
import unittest

from extras import try_import

from testtools import (
    ConcurrentTestSuite,
    ConcurrentStreamTestSuite,
    iterate_tests,

            

Reported by Pylint.

Unused partial imported from functools
Error

Line: 8 Column: 1

              __metaclass__ = type

import doctest
from functools import partial
import sys
import unittest

from extras import try_import


            

Reported by Pylint.

Unused import sys
Error

Line: 9 Column: 1

              
import doctest
from functools import partial
import sys
import unittest

from extras import try_import

from testtools import (

            

Reported by Pylint.

Unused _b imported from testtools.compat
Error

Line: 22 Column: 1

                  TestByTestResult,
    TestCase,
    )
from testtools.compat import _b, _u
from testtools.matchers import DocTestMatches
from testtools.testsuite import FixtureSuite, iterate_tests, sorted_tests
from testtools.tests.helpers import LoggingResult
from testtools.testresult.doubles import StreamResult as LoggingStream


            

Reported by Pylint.

Reimport 'iterate_tests' (imported line 14)
Error

Line: 24 Column: 1

                  )
from testtools.compat import _b, _u
from testtools.matchers import DocTestMatches
from testtools.testsuite import FixtureSuite, iterate_tests, sorted_tests
from testtools.tests.helpers import LoggingResult
from testtools.testresult.doubles import StreamResult as LoggingStream

FunctionFixture = try_import('fixtures.FunctionFixture')


            

Reported by Pylint.

Unused argument 'tags'
Error

Line: 43 Column: 58

              
    def test_broken_test(self):
        log = []
        def on_test(test, status, start_time, stop_time, tags, details):
            log.append((test.id(), status, set(details.keys())))
        class BrokenTest(object):
            # Simple break - no result parameter to run()
            def __call__(self):
                pass

            

Reported by Pylint.

Unused argument 'start_time'
Error

Line: 43 Column: 35

              
    def test_broken_test(self):
        log = []
        def on_test(test, status, start_time, stop_time, tags, details):
            log.append((test.id(), status, set(details.keys())))
        class BrokenTest(object):
            # Simple break - no result parameter to run()
            def __call__(self):
                pass

            

Reported by Pylint.

Unused argument 'stop_time'
Error

Line: 43 Column: 47

              
    def test_broken_test(self):
        log = []
        def on_test(test, status, start_time, stop_time, tags, details):
            log.append((test.id(), status, set(details.keys())))
        class BrokenTest(object):
            # Simple break - no result parameter to run()
            def __call__(self):
                pass

            

Reported by Pylint.

Access to a protected member _events of a client class
Error

Line: 164 Column: 30

                           None,
             ),
            ]), set(event[0:3] + (freeze(event[3]),) + event[4:10] + (None,)
                for event in result._events))

    def test_broken_runner(self):
        # If the object called breaks, the stream is informed about it
        # regardless.
        class BrokenTest(object):

            

Reported by Pylint.

Access to a protected member _events of a client class
Error

Line: 179 Column: 18

                      cases = lambda:[(BrokenTest(), '0')]
        suite = ConcurrentStreamTestSuite(cases)
        suite.run(result)
        events = result._events
        # Check the traceback loosely.
        self.assertThat(events[1][6].decode('utf8'), DocTestMatches("""\
Traceback (most recent call last):
  File "...testtools/testsuite.py", line ..., in _run_test
    test.run(process_result)

            

Reported by Pylint.

src/third_party/scons-3.1.2/scons-local-3.1.2/SCons/Script/SConsOptions.py
70 issues
Attempted relative import beyond top-level package
Error

Line: 843 Column: 9

                  tree_options = ["all", "derived", "prune", "status"]

    def opt_tree(option, opt, value, parser, tree_options=tree_options):
        from . import Main
        tp = Main.TreePrinter()
        for o in value.split(','):
            if o == 'all':
                tp.derived = False
            elif o == 'derived':

            

Reported by Pylint.

Uses of a deprecated module 'optparse'
Error

Line: 26 Column: 1

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

import optparse
import re
import sys
import textwrap

no_hyphen_re = re.compile(r'(\s+|(?<=[\w\!\"\'\&\.\,\?])-{2,}(?=\w))')

            

Reported by Pylint.

__init__ method from base class 'Values' is not called
Error

Line: 101 Column: 5

                  in the set_option() method.
    """

    def __init__(self, defaults):
        self.__dict__['__defaults__'] = defaults
        self.__dict__['__SConscript_settings__'] = {}

    def __getattr__(self, attr):
        """

            

Reported by Pylint.

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

Line: 127 Column: 21

                                  # which will throw an exception of KeyError
                    # deepcopy() is expecting AttributeError if __setstate__
                    # is not available.
                    raise AttributeError(attr)


    settable = [
        'clean',
        'diskcheck',

            

Reported by Pylint.

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

Line: 159 Column: 17

                              if value < 1:
                    raise ValueError
            except ValueError:
                raise SCons.Errors.UserError("A positive integer is required: %s"%repr(value))
        elif name == 'max_drift':
            try:
                value = int(value)
            except ValueError:
                raise SCons.Errors.UserError("An integer is required: %s"%repr(value))

            

Reported by Pylint.

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

Line: 164 Column: 17

                          try:
                value = int(value)
            except ValueError:
                raise SCons.Errors.UserError("An integer is required: %s"%repr(value))
        elif name == 'duplicate':
            try:
                value = str(value)
            except ValueError:
                raise SCons.Errors.UserError("A string is required: %s"%repr(value))

            

Reported by Pylint.

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

Line: 169 Column: 17

                          try:
                value = str(value)
            except ValueError:
                raise SCons.Errors.UserError("A string is required: %s"%repr(value))
            if value not in SCons.Node.FS.Valid_Duplicates:
                raise SCons.Errors.UserError("Not a valid duplication style: %s" % value)
            # Set the duplicate style right away so it can affect linking
            # of SConscript files.
            SCons.Node.FS.set_duplicate(value)

            

Reported by Pylint.

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

Line: 189 Column: 17

                          try:
                value = int(value)
            except ValueError:
                raise SCons.Errors.UserError("An integer is required: %s"%repr(value))
        elif name == 'md5_chunksize':
            try:
                value = int(value)
            except ValueError:
                raise SCons.Errors.UserError("An integer is required: %s"%repr(value))

            

Reported by Pylint.

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

Line: 194 Column: 17

                          try:
                value = int(value)
            except ValueError:
                raise SCons.Errors.UserError("An integer is required: %s"%repr(value))
        elif name == 'warn':
            if SCons.Util.is_String(value):
                value = [value]
            value = self.__SConscript_settings__.get(name, []) + value
            SCons.Warnings.process_warn_strings(value)

            

Reported by Pylint.

Attribute 'largs' defined outside __init__
Error

Line: 396 Column: 9

                      self.parse_args(rargs, self.values)
        # Restore the list of remaining arguments for the
        # next call of AddOption/add_local_option...
        self.largs = self.largs + largs_restore

    def add_local_option(self, *args, **kw):
        """
        Adds a local option to the parser.


            

Reported by Pylint.

src/third_party/abseil-cpp-master/abseil-cpp/absl/copts/generate_copts.py
69 issues
Missing function or method docstring
Error

Line: 15 Column: 1

              

# Helper functions
def file_header_lines():
  return [
      "GENERATED! DO NOT MANUALLY EDIT THIS FILE.", "",
      "(1) Edit absl/copts/copts.py.",
      "(2) Run `python <path_to_absl>/copts/generate_copts.py`."
  ]

            

Reported by Pylint.

Bad indentation. Found 2 spaces, expected 4
Style

Line: 16 Column: 1

              
# Helper functions
def file_header_lines():
  return [
      "GENERATED! DO NOT MANUALLY EDIT THIS FILE.", "",
      "(1) Edit absl/copts/copts.py.",
      "(2) Run `python <path_to_absl>/copts/generate_copts.py`."
  ]


            

Reported by Pylint.

Missing function or method docstring
Error

Line: 23 Column: 1

                ]


def flatten(*lists):
  return [item for sublist in lists for item in sublist]


def relative_filename(filename):
  return path.join(path.dirname(__file__), filename)

            

Reported by Pylint.

Bad indentation. Found 2 spaces, expected 4
Style

Line: 24 Column: 1

              

def flatten(*lists):
  return [item for sublist in lists for item in sublist]


def relative_filename(filename):
  return path.join(path.dirname(__file__), filename)


            

Reported by Pylint.

Missing function or method docstring
Error

Line: 27 Column: 1

                return [item for sublist in lists for item in sublist]


def relative_filename(filename):
  return path.join(path.dirname(__file__), filename)


# Style classes.  These contain all the syntactic styling needed to generate a
# copt file for different build tools.

            

Reported by Pylint.

Bad indentation. Found 2 spaces, expected 4
Style

Line: 28 Column: 1

              

def relative_filename(filename):
  return path.join(path.dirname(__file__), filename)


# Style classes.  These contain all the syntactic styling needed to generate a
# copt file for different build tools.
class CMakeStyle(object):

            

Reported by Pylint.

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

Line: 33 Column: 1

              
# Style classes.  These contain all the syntactic styling needed to generate a
# copt file for different build tools.
class CMakeStyle(object):
  """Style object for CMake copts file."""

  def separator(self):
    return ""


            

Reported by Pylint.

Bad indentation. Found 2 spaces, expected 4
Style

Line: 34 Column: 1

              # Style classes.  These contain all the syntactic styling needed to generate a
# copt file for different build tools.
class CMakeStyle(object):
  """Style object for CMake copts file."""

  def separator(self):
    return ""

  def list_introducer(self, name):

            

Reported by Pylint.

Method could be a function
Error

Line: 36 Column: 3

              class CMakeStyle(object):
  """Style object for CMake copts file."""

  def separator(self):
    return ""

  def list_introducer(self, name):
    return "list(APPEND " + name


            

Reported by Pylint.

Missing function or method docstring
Error

Line: 36 Column: 3

              class CMakeStyle(object):
  """Style object for CMake copts file."""

  def separator(self):
    return ""

  def list_introducer(self, name):
    return "list(APPEND " + name


            

Reported by Pylint.

src/third_party/s2/pywraps2_test.py
69 issues
Unable to import 'google3.pyglib'
Error

Line: 6 Column: 1

              


from google3.pyglib import app
from google3.testing.pybase import googletest
from google3.util.geometry.pywraps2 import *

class PyWrapS2TestCase(googletest.TestCase):


            

Reported by Pylint.

Unable to import 'google3.testing.pybase'
Error

Line: 7 Column: 1

              

from google3.pyglib import app
from google3.testing.pybase import googletest
from google3.util.geometry.pywraps2 import *

class PyWrapS2TestCase(googletest.TestCase):

  def testContainsIsWrappedCorrectly(self):

            

Reported by Pylint.

Unable to import 'google3.util.geometry.pywraps2'
Error

Line: 8 Column: 1

              
from google3.pyglib import app
from google3.testing.pybase import googletest
from google3.util.geometry.pywraps2 import *

class PyWrapS2TestCase(googletest.TestCase):

  def testContainsIsWrappedCorrectly(self):
    london = S2LatLngRect(S2LatLng.FromDegrees(51.3368602, 0.4931979),

            

Reported by Pylint.

Undefined variable 'S2LatLngRect'
Error

Line: 13 Column: 14

              class PyWrapS2TestCase(googletest.TestCase):

  def testContainsIsWrappedCorrectly(self):
    london = S2LatLngRect(S2LatLng.FromDegrees(51.3368602, 0.4931979),
                          S2LatLng.FromDegrees(51.7323965, 0.1495211))
    e14lj = S2LatLngRect(S2LatLng.FromDegrees(51.5213527, -0.0476026),
                         S2LatLng.FromDegrees(51.5213527, -0.0476026))
    self.failUnless(london.Contains(e14lj))


            

Reported by Pylint.

Undefined variable 'S2LatLng'
Error

Line: 13 Column: 27

              class PyWrapS2TestCase(googletest.TestCase):

  def testContainsIsWrappedCorrectly(self):
    london = S2LatLngRect(S2LatLng.FromDegrees(51.3368602, 0.4931979),
                          S2LatLng.FromDegrees(51.7323965, 0.1495211))
    e14lj = S2LatLngRect(S2LatLng.FromDegrees(51.5213527, -0.0476026),
                         S2LatLng.FromDegrees(51.5213527, -0.0476026))
    self.failUnless(london.Contains(e14lj))


            

Reported by Pylint.

Undefined variable 'S2LatLng'
Error

Line: 14 Column: 27

              
  def testContainsIsWrappedCorrectly(self):
    london = S2LatLngRect(S2LatLng.FromDegrees(51.3368602, 0.4931979),
                          S2LatLng.FromDegrees(51.7323965, 0.1495211))
    e14lj = S2LatLngRect(S2LatLng.FromDegrees(51.5213527, -0.0476026),
                         S2LatLng.FromDegrees(51.5213527, -0.0476026))
    self.failUnless(london.Contains(e14lj))

  def testS2CellIdEqualsIsWrappedCorrectly(self):

            

Reported by Pylint.

Undefined variable 'S2LatLng'
Error

Line: 15 Column: 26

                def testContainsIsWrappedCorrectly(self):
    london = S2LatLngRect(S2LatLng.FromDegrees(51.3368602, 0.4931979),
                          S2LatLng.FromDegrees(51.7323965, 0.1495211))
    e14lj = S2LatLngRect(S2LatLng.FromDegrees(51.5213527, -0.0476026),
                         S2LatLng.FromDegrees(51.5213527, -0.0476026))
    self.failUnless(london.Contains(e14lj))

  def testS2CellIdEqualsIsWrappedCorrectly(self):
    london = S2LatLng.FromDegrees(51.5001525, -0.1262355)

            

Reported by Pylint.

Undefined variable 'S2LatLngRect'
Error

Line: 15 Column: 13

                def testContainsIsWrappedCorrectly(self):
    london = S2LatLngRect(S2LatLng.FromDegrees(51.3368602, 0.4931979),
                          S2LatLng.FromDegrees(51.7323965, 0.1495211))
    e14lj = S2LatLngRect(S2LatLng.FromDegrees(51.5213527, -0.0476026),
                         S2LatLng.FromDegrees(51.5213527, -0.0476026))
    self.failUnless(london.Contains(e14lj))

  def testS2CellIdEqualsIsWrappedCorrectly(self):
    london = S2LatLng.FromDegrees(51.5001525, -0.1262355)

            

Reported by Pylint.

Undefined variable 'S2LatLng'
Error

Line: 16 Column: 26

                  london = S2LatLngRect(S2LatLng.FromDegrees(51.3368602, 0.4931979),
                          S2LatLng.FromDegrees(51.7323965, 0.1495211))
    e14lj = S2LatLngRect(S2LatLng.FromDegrees(51.5213527, -0.0476026),
                         S2LatLng.FromDegrees(51.5213527, -0.0476026))
    self.failUnless(london.Contains(e14lj))

  def testS2CellIdEqualsIsWrappedCorrectly(self):
    london = S2LatLng.FromDegrees(51.5001525, -0.1262355)
    cell = S2CellId.FromLatLng(london)

            

Reported by Pylint.

Undefined variable 'S2LatLng'
Error

Line: 20 Column: 14

                  self.failUnless(london.Contains(e14lj))

  def testS2CellIdEqualsIsWrappedCorrectly(self):
    london = S2LatLng.FromDegrees(51.5001525, -0.1262355)
    cell = S2CellId.FromLatLng(london)
    same_cell = S2CellId.FromLatLng(london)
    self.assertEquals(cell, same_cell)

  def testS2CellIdComparsionIsWrappedCorrectly(self):

            

Reported by Pylint.

src/third_party/scons-3.1.2/scons-local-3.1.2/SCons/Tool/packaging/__init__.py
68 issues
Undefined variable name 'src_tarxz' in __all__
Error

Line: 41 Column: 32

              import importlib

__all__ = [
    'src_targz', 'src_tarbz2', 'src_tarxz', 'src_zip',
    'targz', 'tarbz2', 'tarxz', 'zip',
    'rpm', 'msi', 'ipk',
]

#

            

Reported by Pylint.

Undefined variable name 'src_tarbz2' in __all__
Error

Line: 41 Column: 18

              import importlib

__all__ = [
    'src_targz', 'src_tarbz2', 'src_tarxz', 'src_zip',
    'targz', 'tarbz2', 'tarxz', 'zip',
    'rpm', 'msi', 'ipk',
]

#

            

Reported by Pylint.

Undefined variable name 'src_zip' in __all__
Error

Line: 41 Column: 45

              import importlib

__all__ = [
    'src_targz', 'src_tarbz2', 'src_tarxz', 'src_zip',
    'targz', 'tarbz2', 'tarxz', 'zip',
    'rpm', 'msi', 'ipk',
]

#

            

Reported by Pylint.

Undefined variable name 'src_targz' in __all__
Error

Line: 41 Column: 5

              import importlib

__all__ = [
    'src_targz', 'src_tarbz2', 'src_tarxz', 'src_zip',
    'targz', 'tarbz2', 'tarxz', 'zip',
    'rpm', 'msi', 'ipk',
]

#

            

Reported by Pylint.

Undefined variable name 'targz' in __all__
Error

Line: 42 Column: 5

              
__all__ = [
    'src_targz', 'src_tarbz2', 'src_tarxz', 'src_zip',
    'targz', 'tarbz2', 'tarxz', 'zip',
    'rpm', 'msi', 'ipk',
]

#
# Utility and Builder function

            

Reported by Pylint.

Undefined variable name 'tarbz2' in __all__
Error

Line: 42 Column: 14

              
__all__ = [
    'src_targz', 'src_tarbz2', 'src_tarxz', 'src_zip',
    'targz', 'tarbz2', 'tarxz', 'zip',
    'rpm', 'msi', 'ipk',
]

#
# Utility and Builder function

            

Reported by Pylint.

Undefined variable name 'zip' in __all__
Error

Line: 42 Column: 33

              
__all__ = [
    'src_targz', 'src_tarbz2', 'src_tarxz', 'src_zip',
    'targz', 'tarbz2', 'tarxz', 'zip',
    'rpm', 'msi', 'ipk',
]

#
# Utility and Builder function

            

Reported by Pylint.

Undefined variable name 'tarxz' in __all__
Error

Line: 42 Column: 24

              
__all__ = [
    'src_targz', 'src_tarbz2', 'src_tarxz', 'src_zip',
    'targz', 'tarbz2', 'tarxz', 'zip',
    'rpm', 'msi', 'ipk',
]

#
# Utility and Builder function

            

Reported by Pylint.

Undefined variable name 'rpm' in __all__
Error

Line: 43 Column: 5

              __all__ = [
    'src_targz', 'src_tarbz2', 'src_tarxz', 'src_zip',
    'targz', 'tarbz2', 'tarxz', 'zip',
    'rpm', 'msi', 'ipk',
]

#
# Utility and Builder function
#

            

Reported by Pylint.

Undefined variable name 'ipk' in __all__
Error

Line: 43 Column: 19

              __all__ = [
    'src_targz', 'src_tarbz2', 'src_tarxz', 'src_zip',
    'targz', 'tarbz2', 'tarxz', 'zip',
    'rpm', 'msi', 'ipk',
]

#
# Utility and Builder function
#

            

Reported by Pylint.