The following issues were found

src/third_party/wiredtiger/test/suite/test_prepare03.py
23 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_prepare03.py
#    Prepare: Cursor API usage generates expected error in prepared state.


            

Reported by Pylint.

Lambda may not be necessary
Error

Line: 96 Column: 17

                          cursor.set_value(self.genvalue(i))
            self.session.prepare_transaction("prepare_timestamp=2a")
            self.assertRaisesWithMessage(wiredtiger.WiredTigerError,
                lambda:cursor.insert(), preparemsg)
            self.session.timestamp_transaction("commit_timestamp=2b")
            self.session.timestamp_transaction("durable_timestamp=2b")
            self.session.commit_transaction()
            cursor.insert()


            

Reported by Pylint.

Lambda may not be necessary
Error

Line: 111 Column: 17

                          self.session.begin_transaction()
            self.session.prepare_transaction("prepare_timestamp=2a")
            self.assertRaisesWithMessage(wiredtiger.WiredTigerError,
                lambda:cursor.next(), preparemsg)
            self.assertRaisesWithMessage(wiredtiger.WiredTigerError,
                lambda:cursor.get_key(), preparemsg)
            self.assertRaisesWithMessage(wiredtiger.WiredTigerError,
                lambda:cursor.get_value(), preparemsg)
            self.session.timestamp_transaction("commit_timestamp=2b")

            

Reported by Pylint.

Lambda may not be necessary
Error

Line: 113 Column: 17

                          self.assertRaisesWithMessage(wiredtiger.WiredTigerError,
                lambda:cursor.next(), preparemsg)
            self.assertRaisesWithMessage(wiredtiger.WiredTigerError,
                lambda:cursor.get_key(), preparemsg)
            self.assertRaisesWithMessage(wiredtiger.WiredTigerError,
                lambda:cursor.get_value(), preparemsg)
            self.session.timestamp_transaction("commit_timestamp=2b")
            self.session.timestamp_transaction("durable_timestamp=2b")
            self.session.commit_transaction()

            

Reported by Pylint.

Lambda may not be necessary
Error

Line: 115 Column: 17

                          self.assertRaisesWithMessage(wiredtiger.WiredTigerError,
                lambda:cursor.get_key(), preparemsg)
            self.assertRaisesWithMessage(wiredtiger.WiredTigerError,
                lambda:cursor.get_value(), preparemsg)
            self.session.timestamp_transaction("commit_timestamp=2b")
            self.session.timestamp_transaction("durable_timestamp=2b")
            self.session.commit_transaction()
            nextret = cursor.next()
            if nextret != 0:

            

Reported by Pylint.

Lambda may not be necessary
Error

Line: 141 Column: 17

                          self.session.begin_transaction()
            self.session.prepare_transaction("prepare_timestamp=2a")
            self.assertRaisesWithMessage(wiredtiger.WiredTigerError,
                lambda:cursor.prev(), preparemsg)
            self.session.timestamp_transaction("commit_timestamp=2b")
            self.session.timestamp_transaction("durable_timestamp=2b")
            self.session.commit_transaction()
            prevret = cursor.prev()
            if prevret != 0:

            

Reported by Pylint.

Lambda may not be necessary
Error

Line: 169 Column: 13

                      self.session.begin_transaction()
        self.session.prepare_transaction("prepare_timestamp=2a")
        self.assertRaisesWithMessage(wiredtiger.WiredTigerError,
            lambda:cursor.search(), preparemsg)
        self.assertRaisesWithMessage(wiredtiger.WiredTigerError,
            lambda:cursor.update(), preparemsg)
        self.assertRaisesWithMessage(wiredtiger.WiredTigerError,
            lambda:cursor.remove(), preparemsg)
        self.assertRaisesWithMessage(wiredtiger.WiredTigerError,

            

Reported by Pylint.

Lambda may not be necessary
Error

Line: 171 Column: 13

                      self.assertRaisesWithMessage(wiredtiger.WiredTigerError,
            lambda:cursor.search(), preparemsg)
        self.assertRaisesWithMessage(wiredtiger.WiredTigerError,
            lambda:cursor.update(), preparemsg)
        self.assertRaisesWithMessage(wiredtiger.WiredTigerError,
            lambda:cursor.remove(), preparemsg)
        self.assertRaisesWithMessage(wiredtiger.WiredTigerError,
            lambda:cursor.reserve(), preparemsg)
        self.assertRaisesWithMessage(wiredtiger.WiredTigerError,

            

Reported by Pylint.

Lambda may not be necessary
Error

Line: 173 Column: 13

                      self.assertRaisesWithMessage(wiredtiger.WiredTigerError,
            lambda:cursor.update(), preparemsg)
        self.assertRaisesWithMessage(wiredtiger.WiredTigerError,
            lambda:cursor.remove(), preparemsg)
        self.assertRaisesWithMessage(wiredtiger.WiredTigerError,
            lambda:cursor.reserve(), preparemsg)
        self.assertRaisesWithMessage(wiredtiger.WiredTigerError,
            lambda:cursor.reconfigure(), preparemsg)
        self.session.timestamp_transaction("commit_timestamp=2b")

            

Reported by Pylint.

Lambda may not be necessary
Error

Line: 175 Column: 13

                      self.assertRaisesWithMessage(wiredtiger.WiredTigerError,
            lambda:cursor.remove(), preparemsg)
        self.assertRaisesWithMessage(wiredtiger.WiredTigerError,
            lambda:cursor.reserve(), preparemsg)
        self.assertRaisesWithMessage(wiredtiger.WiredTigerError,
            lambda:cursor.reconfigure(), preparemsg)
        self.session.timestamp_transaction("commit_timestamp=2b")
        self.session.timestamp_transaction("durable_timestamp=2b")
        self.session.commit_transaction()

            

Reported by Pylint.

src/third_party/icu4c-57.1/source/common/uloc.cpp
23 issues
char - Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues
Security

Line: 614 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

              }

typedef struct {
    char keyword[ULOC_KEYWORD_BUFFER_LEN];
    int32_t keywordLen;
    const char *valueStart;
    int32_t valueLen;
} KeywordStruct;


            

Reported by FlawFinder.

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

Line: 834 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

              { 
    const char* startSearchHere = NULL;
    const char* nextSeparator = NULL;
    char keywordNameBuffer[ULOC_KEYWORD_BUFFER_LEN];
    char localeKeywordNameBuffer[ULOC_KEYWORD_BUFFER_LEN];
    int32_t i = 0;
    int32_t result = 0;

    if(status && U_SUCCESS(*status) && localeID) {

            

Reported by FlawFinder.

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

Line: 835 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

                  const char* startSearchHere = NULL;
    const char* nextSeparator = NULL;
    char keywordNameBuffer[ULOC_KEYWORD_BUFFER_LEN];
    char localeKeywordNameBuffer[ULOC_KEYWORD_BUFFER_LEN];
    int32_t i = 0;
    int32_t result = 0;

    if(status && U_SUCCESS(*status) && localeID) {
      char tempBuffer[ULOC_FULLNAME_CAPACITY];

            

Reported by FlawFinder.

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

Line: 840 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

                  int32_t result = 0;

    if(status && U_SUCCESS(*status) && localeID) {
      char tempBuffer[ULOC_FULLNAME_CAPACITY];
      const char* tmpLocaleID;

      if (_hasBCP47Extension(localeID)) {
          _ConvertBCP47(tmpLocaleID, localeID, tempBuffer, sizeof(tempBuffer), status);
      } else {

            

Reported by FlawFinder.

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

Line: 937 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

                  int32_t needLen = 0;
    int32_t foundValueLen;
    int32_t keywordAtEnd = 0; /* is the keyword at the end of the string? */
    char keywordNameBuffer[ULOC_KEYWORD_BUFFER_LEN];
    char localeKeywordNameBuffer[ULOC_KEYWORD_BUFFER_LEN];
    int32_t i = 0;
    int32_t rc;
    char* nextSeparator = NULL;
    char* nextEqualsign = NULL;

            

Reported by FlawFinder.

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

Line: 938 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

                  int32_t foundValueLen;
    int32_t keywordAtEnd = 0; /* is the keyword at the end of the string? */
    char keywordNameBuffer[ULOC_KEYWORD_BUFFER_LEN];
    char localeKeywordNameBuffer[ULOC_KEYWORD_BUFFER_LEN];
    int32_t i = 0;
    int32_t rc;
    char* nextSeparator = NULL;
    char* nextEqualsign = NULL;
    char* startSearchHere = NULL;

            

Reported by FlawFinder.

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

Line: 1223 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

                                  const char **pEnd) {
    int32_t i=0;
    int32_t offset;
    char lang[4]={ 0, 0, 0, 0 }; /* temporary buffer to hold language code for searching */

    /* if it starts with i- or x- then copy that prefix */
    if(_isIDPrefix(localeID)) {
        if(i<languageCapacity) {
            language[i]=(char)uprv_tolower(*localeID);

            

Reported by FlawFinder.

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

Line: 1309 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

                                 const char **pEnd)
{
    int32_t idLen=0;
    char cnty[ULOC_COUNTRY_CAPACITY]={ 0, 0, 0, 0 };
    int32_t offset;

    /* copy the country as far as possible and count its length */
    while(!_isTerminator(localeID[idLen]) && !_isIDSeparator(localeID[idLen])) {
        if(idLen<(ULOC_COUNTRY_CAPACITY-1)) {   /*CWB*/

            

Reported by FlawFinder.

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

Line: 1560 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

                                      UErrorCode* status) 
{
    int32_t i=0;
    char keywords[256];
    int32_t keywordsCapacity = 256;
    char tempBuffer[ULOC_FULLNAME_CAPACITY];
    const char* tmpLocaleID;

    if(status==NULL || U_FAILURE(*status)) {

            

Reported by FlawFinder.

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

Line: 1562 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

                  int32_t i=0;
    char keywords[256];
    int32_t keywordsCapacity = 256;
    char tempBuffer[ULOC_FULLNAME_CAPACITY];
    const char* tmpLocaleID;

    if(status==NULL || U_FAILURE(*status)) {
        return 0;
    }

            

Reported by FlawFinder.

src/third_party/wiredtiger/test/suite/test_index01.py
23 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

# test_index01.py
#    basic tests for indices
class test_index01(wttest.WiredTigerTestCase):
    '''Test basic operations for indices'''

            

Reported by Pylint.

Attribute 'index' defined outside __init__
Error

Line: 42 Column: 9

                  NUM_INDICES = 6

    def create_table(self):
        self.index = ['%s:index%d' % (self.indexbase, i) \
            for i in range(self.NUM_INDICES)]
        self.pr('create table')
        self.session.create(self.tablename, 'key_format=Si,value_format=SSii,columns=(name,ID,dept,job,salary,year)')
        self.session.create(self.index[0], 'columns=(dept)')
        self.session.create(self.index[1], 'columns=(name,year)')

            

Reported by Pylint.

Lambda may not be necessary
Error

Line: 96 Column: 55

                      cursor = self.cursor(config='overwrite=false')
        cursor.set_key(*cols[:2])
        cursor.set_value(*cols[2:])
        self.assertRaises(wiredtiger.WiredTigerError, lambda: cursor.insert())
        cursor.close()

    def insert_overwrite(self, *cols):
        self.pr('insert')
        cursor = self.cursor(config='overwrite=true')

            

Reported by Pylint.

Missing module docstring
Error

Line: 1 Column: 1

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

            

Reported by Pylint.

Multiple imports on one line (wiredtiger, wttest)
Error

Line: 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

# test_index01.py
#    basic tests for indices
class test_index01(wttest.WiredTigerTestCase):
    '''Test basic operations for indices'''

            

Reported by Pylint.

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

Line: 33 Column: 1

              
# test_index01.py
#    basic tests for indices
class test_index01(wttest.WiredTigerTestCase):
    '''Test basic operations for indices'''

    basename = 'test_index01'
    tablename = 'table:' + basename
    indexbase = 'index:' + basename

            

Reported by Pylint.

Missing function or method docstring
Error

Line: 41 Column: 5

                  indexbase = 'index:' + basename
    NUM_INDICES = 6

    def create_table(self):
        self.index = ['%s:index%d' % (self.indexbase, i) \
            for i in range(self.NUM_INDICES)]
        self.pr('create table')
        self.session.create(self.tablename, 'key_format=Si,value_format=SSii,columns=(name,ID,dept,job,salary,year)')
        self.session.create(self.index[0], 'columns=(dept)')

            

Reported by Pylint.

Line too long (117/100)
Error

Line: 45 Column: 1

                      self.index = ['%s:index%d' % (self.indexbase, i) \
            for i in range(self.NUM_INDICES)]
        self.pr('create table')
        self.session.create(self.tablename, 'key_format=Si,value_format=SSii,columns=(name,ID,dept,job,salary,year)')
        self.session.create(self.index[0], 'columns=(dept)')
        self.session.create(self.index[1], 'columns=(name,year)')
        self.session.create(self.index[2], 'columns=(salary)')
        self.session.create(self.index[3], 'columns=(dept,job,name)')
        self.session.create(self.index[4], 'columns=(name,ID)')

            

Reported by Pylint.

Missing function or method docstring
Error

Line: 53 Column: 5

                      self.session.create(self.index[4], 'columns=(name,ID)')
        self.session.create(self.index[5], 'columns=(ID,name)')

    def drop_table(self):
        self.pr('drop table')
        self.session.drop(self.tablename, None)

    def cursor(self, config=None):
        self.pr('open cursor')

            

Reported by Pylint.

Missing function or method docstring
Error

Line: 57 Column: 5

                      self.pr('drop table')
        self.session.drop(self.tablename, None)

    def cursor(self, config=None):
        self.pr('open cursor')
        c = self.session.open_cursor(self.tablename, None, config)
        self.assertNotEqual(c, None)
        return c


            

Reported by Pylint.

src/third_party/wiredtiger/test/suite/test_join04.py
22 issues
Unable to import 'wiredtiger'
Error

Line: 30 Column: 1

              # OTHER DEALINGS IN THE SOFTWARE.

import os
import wiredtiger, wttest, run

# test_join04.py
#    Join operations
# Joins with a custom extractor, using equality joins
class test_join04(wttest.WiredTigerTestCase):

            

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
import wiredtiger, wttest, run

# test_join04.py
#    Join operations
# Joins with a custom extractor, using equality joins

            

Reported by Pylint.

Unused import run
Error

Line: 30 Column: 1

              # OTHER DEALINGS IN THE SOFTWARE.

import os
import wiredtiger, wttest, run

# test_join04.py
#    Join operations
# Joins with a custom extractor, using equality joins
class test_join04(wttest.WiredTigerTestCase):

            

Reported by Pylint.

Unused import wiredtiger
Error

Line: 30 Column: 1

              # OTHER DEALINGS IN THE SOFTWARE.

import os
import wiredtiger, wttest, run

# test_join04.py
#    Join operations
# Joins with a custom extractor, using equality joins
class test_join04(wttest.WiredTigerTestCase):

            

Reported by Pylint.

Missing module docstring
Error

Line: 1 Column: 1

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

            

Reported by Pylint.

Multiple imports on one line (wiredtiger, wttest, run)
Error

Line: 30 Column: 1

              # OTHER DEALINGS IN THE SOFTWARE.

import os
import wiredtiger, wttest, run

# test_join04.py
#    Join operations
# Joins with a custom extractor, using equality joins
class test_join04(wttest.WiredTigerTestCase):

            

Reported by Pylint.

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

Line: 35 Column: 1

              # test_join04.py
#    Join operations
# Joins with a custom extractor, using equality joins
class test_join04(wttest.WiredTigerTestCase):
    table_name1 = 'test_join04'
    nentries = 100

    def conn_extensions(self, extlist):
        extlist.skip_if_missing = True

            

Reported by Pylint.

Missing class docstring
Error

Line: 35 Column: 1

              # test_join04.py
#    Join operations
# Joins with a custom extractor, using equality joins
class test_join04(wttest.WiredTigerTestCase):
    table_name1 = 'test_join04'
    nentries = 100

    def conn_extensions(self, extlist):
        extlist.skip_if_missing = True

            

Reported by Pylint.

Missing function or method docstring
Error

Line: 39 Column: 5

                  table_name1 = 'test_join04'
    nentries = 100

    def conn_extensions(self, extlist):
        extlist.skip_if_missing = True
        extlist.extension('extractors', 'csv')

    # JIRA WT-2308:
    # Test extractors with equality joins

            

Reported by Pylint.

Method could be a function
Error

Line: 39 Column: 5

                  table_name1 = 'test_join04'
    nentries = 100

    def conn_extensions(self, extlist):
        extlist.skip_if_missing = True
        extlist.extension('extractors', 'csv')

    # JIRA WT-2308:
    # Test extractors with equality joins

            

Reported by Pylint.

src/third_party/mozjs-60/extract/js/src/vm/make_opcode_doc.py
22 issues
Unused import re
Error

Line: 14 Column: 1

              """

from __future__ import print_function
import re
import sys

import os
sys.path.insert(0, os.path.dirname(os.path.realpath(__file__)))
import opcode

            

Reported by Pylint.

Redefining name 'opcode' from outer scope (line 19)
Error

Line: 39 Column: 18

                  flags = map(lambda x: x.replace('JOF_', ''), flags)
    return ' ({flags})'.format(flags=', '.join(flags))

def print_opcode(opcode):
    names_template = '{name} [-{nuses}, +{ndefs}]{flags}'
    opcodes = sorted([opcode] + opcode.group,
                     key=lambda opcode: opcode.name)
    names = map(lambda code: names_template.format(name=escape(code.name),
                                                   nuses=override(code.nuses,

            

Reported by Pylint.

Redefining built-in 'type'
Error

Line: 85 Column: 31

              id_cache = dict()
id_count = dict()

def make_element_id(category, type=''):
    key = '{}:{}'.format(category, type)
    if key in id_cache:
        return id_cache[key]

    if type == '':

            

Reported by Pylint.

Redefining built-in 'id'
Error

Line: 91 Column: 9

                      return id_cache[key]

    if type == '':
        id = category.replace(' ', '_')
    else:
        id = type.replace(' ', '_')

    if id in id_count:
        id_count[id] += 1

            

Reported by Pylint.

Redefining name 'index' from outer scope (line 135)
Error

Line: 104 Column: 15

                  id_cache[key] = id
    return id

def print_doc(index):
    print("""<div>{{{{SpiderMonkeySidebar("Internals")}}}}</div>

<h2 id="Bytecode_Listing">Bytecode Listing</h2>

<p>This document is automatically generated from

            

Reported by Pylint.

Redefining name 'opcode' from outer scope (line 19)
Error

Line: 122 Column: 17

                              print('<h4 id="{id}">{name}</h4>'.format(name=type_name,
                                                         id=make_element_id(category_name, type_name)))
            print('<dl>')
            for opcode in sorted(opcodes,
                                 key=lambda opcode: opcode.sort_key):
                print_opcode(opcode)
            print('</dl>')

if __name__ == '__main__':

            

Reported by Pylint.

Redefining built-in 'dir'
Error

Line: 132 Column: 5

                      print("Usage: make_opcode_doc.py PATH_TO_MOZILLA_CENTRAL",
              file=sys.stderr)
        sys.exit(1)
    dir = sys.argv[1]

    try:
        index, _ = opcode.get_opcodes(dir)
    except Exception as e:
        print("Error: {}".format(e.args[0]), file=sys.stderr)

            

Reported by Pylint.

Catching too general exception Exception
Error

Line: 136 Column: 12

              
    try:
        index, _ = opcode.get_opcodes(dir)
    except Exception as e:
        print("Error: {}".format(e.args[0]), file=sys.stderr)
        sys.exit(1)

    print_doc(index)

            

Reported by Pylint.

Import "import opcode" should be placed at the top of the module
Error

Line: 19 Column: 1

              
import os
sys.path.insert(0, os.path.dirname(os.path.realpath(__file__)))
import opcode

from xml.sax.saxutils import escape

SOURCE_BASE = 'http://dxr.mozilla.org/mozilla-central/source'


            

Reported by Pylint.

Using escape to parse untrusted XML data is known to be vulnerable to XML attacks. Replace escape with the equivalent defusedxml package, or make sure defusedxml.defuse_stdlib() is called.
Security blacklist

Line: 21
Suggestion: https://bandit.readthedocs.io/en/latest/blacklists/blacklist_imports.html#b406-import-xml-sax

              sys.path.insert(0, os.path.dirname(os.path.realpath(__file__)))
import opcode

from xml.sax.saxutils import escape

SOURCE_BASE = 'http://dxr.mozilla.org/mozilla-central/source'

def override(value, override_value):
    if override_value != '':

            

Reported by Bandit.

src/third_party/scons-3.1.2/scons-local-3.1.2/SCons/Errors.py
22 issues
Keyword argument before variable positional arguments list in the definition of __init__ function
Error

Line: 134 Column: 5

                  pass

class ExplicitExit(Exception):
    def __init__(self, node=None, status=None, *args):
        self.node = node
        self.status = status
        self.exitstatus = status
        Exception.__init__(self, *args)


            

Reported by Pylint.

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

Line: 1 Column: 1

              #
# Copyright (c) 2001 - 2019 The SCons Foundation
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, publish,
# distribute, sublicense, and/or sell copies of the Software, and to
# permit persons to whom the Software is furnished to do so, subject to

            

Reported by Pylint.

Line too long (112/100)
Error

Line: 31 Column: 1

              
"""

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

import shutil
import SCons.Util



            

Reported by Pylint.

Too many instance attributes (9/7)
Error

Line: 37 Column: 1

              import SCons.Util


class BuildError(Exception):
    """ Errors occurring while building.

    BuildError have the following attributes:
    =========================================


            

Reported by Pylint.

Too many arguments (10/5)
Error

Line: 91 Column: 5

                            is not due to the an action failure)
    """

    def __init__(self,
                 node=None, errstr="Unknown error", status=2, exitstatus=2,
                 filename=None, executor=None, action=None, command=None,
                 exc_info=(None, None, None)):

        # py3: errstr should be string and not bytes.

            

Reported by Pylint.

Unnecessary "else" after "return"
Error

Line: 113 Column: 9

                                         executor, action, command, exc_info)

    def __str__(self):
        if self.filename:
            return self.filename + ': ' + self.errstr
        else:
            return self.errstr

class InternalError(Exception):

            

Reported by Pylint.

Missing class docstring
Error

Line: 118 Column: 1

                      else:
            return self.errstr

class InternalError(Exception):
    pass

class UserError(Exception):
    pass


            

Reported by Pylint.

Missing class docstring
Error

Line: 121 Column: 1

              class InternalError(Exception):
    pass

class UserError(Exception):
    pass

class StopError(Exception):
    pass


            

Reported by Pylint.

Missing class docstring
Error

Line: 124 Column: 1

              class UserError(Exception):
    pass

class StopError(Exception):
    pass

class SConsEnvironmentError(Exception):
    pass


            

Reported by Pylint.

Missing class docstring
Error

Line: 127 Column: 1

              class StopError(Exception):
    pass

class SConsEnvironmentError(Exception):
    pass

class MSVCError(IOError):
    pass


            

Reported by Pylint.

src/third_party/wiredtiger/test/suite/test_encrypt02.py
22 issues
Unable to import 'wiredtiger'
Error

Line: 38 Column: 1

              #

import os, run, random
import wiredtiger, wttest
from suite_subprocess import suite_subprocess
from wtscenario import make_scenarios

# Test basic encryption
class test_encrypt02(wttest.WiredTigerTestCase, suite_subprocess):

            

Reported by Pylint.

An attribute defined in wttest line 401 hides this method
Error

Line: 75 Column: 5

                  nrecords = 5000
    bigvalue = "abcdefghij" * 1001    # len(bigvalue) = 10010

    def conn_config(self):
        secretarg = ''
        if self.secret_arg != None:
            secretarg = ',secretkey=' + self.secret_arg
        return 'encryption=({0}{1})'.format(self.encrypt_args, secretarg)


            

Reported by Pylint.

Unused import run
Error

Line: 37 Column: 1

              #   Encryption using passwords
#

import os, run, random
import wiredtiger, wttest
from suite_subprocess import suite_subprocess
from wtscenario import make_scenarios

# Test basic encryption

            

Reported by Pylint.

Unused import os
Error

Line: 37 Column: 1

              #   Encryption using passwords
#

import os, run, random
import wiredtiger, wttest
from suite_subprocess import suite_subprocess
from wtscenario import make_scenarios

# Test basic encryption

            

Reported by Pylint.

Unused import wiredtiger
Error

Line: 38 Column: 1

              #

import os, run, random
import wiredtiger, wttest
from suite_subprocess import suite_subprocess
from wtscenario import make_scenarios

# Test basic encryption
class test_encrypt02(wttest.WiredTigerTestCase, suite_subprocess):

            

Reported by Pylint.

Using deprecated method assertEquals()
Error

Line: 111 Column: 13

                          val = self.bigvalue[start:r.randint(0,10000)] + str(idx)
            cursor.set_key(key)
            self.assertEqual(cursor.search(), 0)
            self.assertEquals(cursor.get_value(), val)
        cursor.close()

        wtargs = []
        if self.secret_arg != None:
            wtargs += ['-E', self.secret_arg]

            

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, random)
Error

Line: 37 Column: 1

              #   Encryption using passwords
#

import os, run, random
import wiredtiger, wttest
from suite_subprocess import suite_subprocess
from wtscenario import make_scenarios

# Test basic encryption

            

Reported by Pylint.

standard import "import os, run, random" should be placed before "import os, run, random"
Error

Line: 37 Column: 1

              #   Encryption using passwords
#

import os, run, random
import wiredtiger, wttest
from suite_subprocess import suite_subprocess
from wtscenario import make_scenarios

# Test basic encryption

            

Reported by Pylint.

Multiple imports on one line (wiredtiger, wttest)
Error

Line: 38 Column: 1

              #

import os, run, random
import wiredtiger, wttest
from suite_subprocess import suite_subprocess
from wtscenario import make_scenarios

# Test basic encryption
class test_encrypt02(wttest.WiredTigerTestCase, suite_subprocess):

            

Reported by Pylint.

src/third_party/wiredtiger/test/3rdparty/python-subunit-0.0.16/python/subunit/run.py
22 issues
Unable to import 'testtools'
Error

Line: 27 Column: 1

              import os
import sys

from testtools import ExtendedToStreamDecorator
from testtools.testsuite import iterate_tests

from subunit import StreamResultToBytes, get_default_formatter
from subunit.test_results import AutoTimingTestResultDecorator
from testtools.run import (

            

Reported by Pylint.

Unable to import 'testtools.testsuite'
Error

Line: 28 Column: 1

              import sys

from testtools import ExtendedToStreamDecorator
from testtools.testsuite import iterate_tests

from subunit import StreamResultToBytes, get_default_formatter
from subunit.test_results import AutoTimingTestResultDecorator
from testtools.run import (
    BUFFEROUTPUT,

            

Reported by Pylint.

Unable to import 'testtools.run'
Error

Line: 32 Column: 1

              
from subunit import StreamResultToBytes, get_default_formatter
from subunit.test_results import AutoTimingTestResultDecorator
from testtools.run import (
    BUFFEROUTPUT,
    CATCHBREAK,
    FAILFAST,
    list_test,
    TestProgram,

            

Reported by Pylint.

Unused iterate_tests imported from testtools.testsuite
Error

Line: 28 Column: 1

              import sys

from testtools import ExtendedToStreamDecorator
from testtools.testsuite import iterate_tests

from subunit import StreamResultToBytes, get_default_formatter
from subunit.test_results import AutoTimingTestResultDecorator
from testtools.run import (
    BUFFEROUTPUT,

            

Reported by Pylint.

Unused argument 'buffer'
Error

Line: 43 Column: 55

              

class SubunitTestRunner(object):
    def __init__(self, verbosity=None, failfast=None, buffer=None, stream=None):
        """Create a TestToolsTestRunner.

        :param verbosity: Ignored.
        :param failfast: Stop running tests at the first failure.
        :param buffer: Ignored.

            

Reported by Pylint.

Unused argument 'verbosity'
Error

Line: 43 Column: 24

              

class SubunitTestRunner(object):
    def __init__(self, verbosity=None, failfast=None, buffer=None, stream=None):
        """Create a TestToolsTestRunner.

        :param verbosity: Ignored.
        :param failfast: Stop running tests at the first failure.
        :param buffer: Ignored.

            

Reported by Pylint.

No exception type(s) specified
Error

Line: 80 Column: 9

                      test_ids, errors = list_test(test)
        try:
            fileno = self.stream.fileno()
        except:
            fileno = None
        if fileno is not None:
            stream = os.fdopen(fileno, 'wb', 0)
        else:
            stream = self.stream

            

Reported by Pylint.

Unused variable 'stream'
Error

Line: 118 Column: 5

              def main():
    # Disable the default buffering, for Python 2.x where pdb doesn't do it
    # on non-ttys.
    stream = get_default_formatter()
    runner = SubunitTestRunner
    # Patch stdout to be unbuffered, so that pdb works well on 2.6/2.7.
    binstdout = io.open(sys.stdout.fileno(), 'wb', 0)
    if sys.version_info[0] > 2:
        sys.stdout = io.TextIOWrapper(binstdout, encoding=sys.stdout.encoding)

            

Reported by Pylint.

Trailing whitespace
Error

Line: 5 Column: 2

              #
# Simple subunit testrunner for python
# Copyright (C) Jelmer Vernooij <jelmer@samba.org> 2007
#   
#  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.

src/third_party/wiredtiger/test/suite/test_compat02.py
22 issues
Unable to import 'wiredtiger'
Error

Line: 33 Column: 1

              # Check compatibility API

import fnmatch, os
import wiredtiger, wttest
from suite_subprocess import suite_subprocess
from wtdataset import SimpleDataSet, simple_key
from wtscenario import make_scenarios

class test_compat02(wttest.WiredTigerTestCase, suite_subprocess):

            

Reported by Pylint.

An attribute defined in wttest line 401 hides this method
Error

Line: 117 Column: 5

                  scenarios = make_scenarios(compat_create, compat_release, compat_min, compat_max, base_config,
                               prune=100, prunelong=100000)

    def conn_config(self):
        # Set archive false on the home directory.
        config_str = 'config_base=%s,' % self.basecfg
        log_str = 'log=(archive=false,enabled,file_max=%s),' % self.logmax
        compat_str = ''
        if (self.create_rel != 'none'):

            

Reported by Pylint.

Unused import fnmatch
Error

Line: 32 Column: 1

              # test_compat02.py
# Check compatibility API

import fnmatch, os
import wiredtiger, wttest
from suite_subprocess import suite_subprocess
from wtdataset import SimpleDataSet, simple_key
from wtscenario import make_scenarios


            

Reported by Pylint.

Unused import os
Error

Line: 32 Column: 1

              # test_compat02.py
# Check compatibility API

import fnmatch, os
import wiredtiger, wttest
from suite_subprocess import suite_subprocess
from wtdataset import SimpleDataSet, simple_key
from wtscenario import make_scenarios


            

Reported by Pylint.

Unused simple_key imported from wtdataset
Error

Line: 35 Column: 1

              import fnmatch, os
import wiredtiger, wttest
from suite_subprocess import suite_subprocess
from wtdataset import SimpleDataSet, simple_key
from wtscenario import make_scenarios

class test_compat02(wttest.WiredTigerTestCase, suite_subprocess):
    # Add enough entries and use a small log size to generate more than
    # one log file.

            

Reported by Pylint.

Unused SimpleDataSet imported from wtdataset
Error

Line: 35 Column: 1

              import fnmatch, os
import wiredtiger, wttest
from suite_subprocess import suite_subprocess
from wtdataset import SimpleDataSet, simple_key
from wtscenario import make_scenarios

class test_compat02(wttest.WiredTigerTestCase, suite_subprocess):
    # Add enough entries and use a small log size to generate more than
    # one log file.

            

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)
Error

Line: 32 Column: 1

              # test_compat02.py
# Check compatibility API

import fnmatch, os
import wiredtiger, wttest
from suite_subprocess import suite_subprocess
from wtdataset import SimpleDataSet, simple_key
from wtscenario import make_scenarios


            

Reported by Pylint.

Multiple imports on one line (wiredtiger, wttest)
Error

Line: 33 Column: 1

              # Check compatibility API

import fnmatch, os
import wiredtiger, wttest
from suite_subprocess import suite_subprocess
from wtdataset import SimpleDataSet, simple_key
from wtscenario import make_scenarios

class test_compat02(wttest.WiredTigerTestCase, suite_subprocess):

            

Reported by Pylint.

Missing class docstring
Error

Line: 38 Column: 1

              from wtdataset import SimpleDataSet, simple_key
from wtscenario import make_scenarios

class test_compat02(wttest.WiredTigerTestCase, suite_subprocess):
    # Add enough entries and use a small log size to generate more than
    # one log file.
    entries = 2000
    logmax = "100K"
    tablename = 'test_compat02'

            

Reported by Pylint.

src/third_party/mozjs-60/extract/js/src/jit/arm/Lowering-arm.cpp
22 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: 600 Column: 55 CWE codes: 362/367!
Suggestion: Set up the correct permissions (e.g., using setuid()) and try to open the file directly

                  MDefinition* base = ins->base();
    MOZ_ASSERT(base->type() == MIRType::Int32);

    if (ins->access().type() == Scalar::Int64 && ins->access().isAtomic()) {
        auto* lir = new(alloc()) LWasmAtomicLoadI64(useRegisterAtStart(base));
        defineInt64Fixed(lir, ins, LInt64Allocation(LAllocation(AnyRegister(IntArgReg1)),
                                                    LAllocation(AnyRegister(IntArgReg0))));
        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: 600 Column: 14 CWE codes: 362/367!
Suggestion: Set up the correct permissions (e.g., using setuid()) and try to open the file directly

                  MDefinition* base = ins->base();
    MOZ_ASSERT(base->type() == MIRType::Int32);

    if (ins->access().type() == Scalar::Int64 && ins->access().isAtomic()) {
        auto* lir = new(alloc()) LWasmAtomicLoadI64(useRegisterAtStart(base));
        defineInt64Fixed(lir, ins, LInt64Allocation(LAllocation(AnyRegister(IntArgReg1)),
                                                    LAllocation(AnyRegister(IntArgReg0))));
        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: 609 Column: 26 CWE codes: 362/367!
Suggestion: Set up the correct permissions (e.g., using setuid()) and try to open the file directly

              
    LAllocation ptr = useRegisterAtStart(base);

    if (IsUnaligned(ins->access())) {
        MOZ_ASSERT(!ins->access().isAtomic());

        // Unaligned access expected! Revert to a byte load.
        LDefinition ptrCopy = tempCopy(base, 0);


            

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: 610 Column: 26 CWE codes: 362/367!
Suggestion: Set up the correct permissions (e.g., using setuid()) and try to open the file directly

                  LAllocation ptr = useRegisterAtStart(base);

    if (IsUnaligned(ins->access())) {
        MOZ_ASSERT(!ins->access().isAtomic());

        // Unaligned access expected! Revert to a byte load.
        LDefinition ptrCopy = tempCopy(base, 0);

        LDefinition noTemp = LDefinition::BogusTemp();

            

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: 639 Column: 44 CWE codes: 362/367!
Suggestion: Set up the correct permissions (e.g., using setuid()) and try to open the file directly

              
    if (ins->type() == MIRType::Int64) {
        auto* lir = new(alloc()) LWasmLoadI64(ptr);
        if (ins->access().offset() || ins->access().type() == Scalar::Int64)
            lir->setTemp(0, tempCopy(base, 0));
        defineInt64(lir, ins);
        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: 639 Column: 18 CWE codes: 362/367!
Suggestion: Set up the correct permissions (e.g., using setuid()) and try to open the file directly

              
    if (ins->type() == MIRType::Int64) {
        auto* lir = new(alloc()) LWasmLoadI64(ptr);
        if (ins->access().offset() || ins->access().type() == Scalar::Int64)
            lir->setTemp(0, tempCopy(base, 0));
        defineInt64(lir, ins);
        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: 646 Column: 14 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()) LWasmLoad(ptr);
    if (ins->access().offset())
        lir->setTemp(0, tempCopy(base, 0));

    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: 658 Column: 55 CWE codes: 362/367!
Suggestion: Set up the correct permissions (e.g., using setuid()) and try to open the file directly

                  MDefinition* base = ins->base();
    MOZ_ASSERT(base->type() == MIRType::Int32);

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

            

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: 658 Column: 14 CWE codes: 362/367!
Suggestion: Set up the correct permissions (e.g., using setuid()) and try to open the file directly

                  MDefinition* base = ins->base();
    MOZ_ASSERT(base->type() == MIRType::Int32);

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

            

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: 671 Column: 26 CWE codes: 362/367!
Suggestion: Set up the correct permissions (e.g., using setuid()) and try to open the file directly

              
    LAllocation ptr = useRegisterAtStart(base);

    if (IsUnaligned(ins->access())) {
        MOZ_ASSERT(!ins->access().isAtomic());

        // Unaligned access expected! Revert to a byte store.
        LDefinition ptrCopy = tempCopy(base, 0);


            

Reported by FlawFinder.