The following issues were found

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

              #endif
        ptr = useRegisterAtStart(base);

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

                  if (IsUnaligned(ins->access())) {
        if (ins->type() == MIRType::Int64) {
            auto* lir = new(alloc()) LWasmUnalignedLoadI64(ptr, temp());
            if (ins->access().offset())
                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: 341 Column: 18 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()) LWasmUnalignedLoad(ptr, temp());
        if (ins->access().offset())
            lir->setTemp(0, tempCopy(base, 0));

        define(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: 351 Column: 17 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) {

#ifdef JS_CODEGEN_MIPS32
        if(ins->access().isAtomic()) {
            auto* lir = new(alloc()) LWasmAtomicLoadI64(ptr);
            defineInt64(lir, ins);
            return;
        }
#endif

            

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

                      }
#endif
        auto* lir = new(alloc()) LWasmLoadI64(ptr);
        if (ins->access().offset())
            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: 366 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: 380 Column: 26 CWE codes: 362/367!
Suggestion: Set up the correct permissions (e.g., using setuid()) and try to open the file directly

              
    MDefinition* value = ins->value();

    if (IsUnaligned(ins->access())) {
        LAllocation baseAlloc = useRegisterAtStart(base);
        if (ins->access().type() == Scalar::Int64) {
            LInt64Allocation valueAlloc = useInt64RegisterAtStart(value);
            auto* lir = new(alloc()) LWasmUnalignedStoreI64(baseAlloc, valueAlloc, temp());
            if (ins->access().offset())

            

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

              
    if (IsUnaligned(ins->access())) {
        LAllocation baseAlloc = useRegisterAtStart(base);
        if (ins->access().type() == Scalar::Int64) {
            LInt64Allocation valueAlloc = useInt64RegisterAtStart(value);
            auto* lir = new(alloc()) LWasmUnalignedStoreI64(baseAlloc, valueAlloc, temp());
            if (ins->access().offset())
                lir->setTemp(0, 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: 385 Column: 22 CWE codes: 362/367!
Suggestion: Set up the correct permissions (e.g., using setuid()) and try to open the file directly

                      if (ins->access().type() == Scalar::Int64) {
            LInt64Allocation valueAlloc = useInt64RegisterAtStart(value);
            auto* lir = new(alloc()) LWasmUnalignedStoreI64(baseAlloc, valueAlloc, temp());
            if (ins->access().offset())
                lir->setTemp(0, tempCopy(base, 0));

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

              
        LAllocation valueAlloc = useRegisterAtStart(value);
        auto* lir = new(alloc()) LWasmUnalignedStore(baseAlloc, valueAlloc, temp());
        if (ins->access().offset())
            lir->setTemp(0, tempCopy(base, 0));

        add(lir, ins);
        return;
    }

            

Reported by FlawFinder.

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

Line: 30 Column: 1

              # OTHER DEALINGS IN THE SOFTWARE.

import os
import wiredtiger, wttest, run

# test_collator.py
#    Test indices using a custom extractor and collator.
class test_collator(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_collator.py
#    Test indices using a custom extractor and collator.
class test_collator(wttest.WiredTigerTestCase):

            

Reported by Pylint.

Unused import run
Error

Line: 30 Column: 1

              # OTHER DEALINGS IN THE SOFTWARE.

import os
import wiredtiger, wttest, run

# test_collator.py
#    Test indices using a custom extractor and collator.
class test_collator(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_collator.py
#    Test indices using a custom extractor and collator.
class test_collator(wttest.WiredTigerTestCase):
    """

            

Reported by Pylint.

Using deprecated method assertEquals()
Error

Line: 120 Column: 13

                          for key, val in c:
                primkey = int(val.split(',')[1])
                expected.remove(primkey)
            self.assertEquals(0, len(expected))
            c.close()

    def test_index(self):
        self.session.create("table:collator", "key_format=i,value_format=S,"
                            "columns=(primarykey,value)")

            

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_collator.py
#    Test indices using a custom extractor and collator.
class test_collator(wttest.WiredTigerTestCase):
    """

            

Reported by Pylint.

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

Line: 34 Column: 1

              
# test_collator.py
#    Test indices using a custom extractor and collator.
class test_collator(wttest.WiredTigerTestCase):
    """
    Test indices with a custom extractor to create an index,
    with our own collator.
    Our set of rows looks like a multiplication table:
      row '0':  '0,0,0,0'

            

Reported by Pylint.

Method could be a function
Error

Line: 51 Column: 5

                  nentries = 100
    nindices = 4

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

    def create_indices(self):

            

Reported by Pylint.

Missing function or method docstring
Error

Line: 51 Column: 5

                  nentries = 100
    nindices = 4

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

    def create_indices(self):

            

Reported by Pylint.

src/third_party/IntelRDFPMathLib20U1/LIBRARY/src/bid64_round_integral.c
22 issues
Shifting 32-bit value by 53 bits is undefined behaviour
Error

Line: 90 CWE codes: 758

                if (C1 == 0) {
    if (exp < 0)
      exp = 0;
    res = x_sign | (((BID_UINT64) exp + 398) << 53);
    BID_RETURN (res);
  }
  // x is a finite non-zero number (not 0, non-canonical, or special)

  switch (rnd_mode) {

            

Reported by Cppcheck.

Shifting 32-bit value by 52 bits is undefined behaviour
Error

Line: 146 CWE codes: 758

                } else {	// if x < 2^53
    tmp1.d = (double) C1;	// exact conversion
    x_nr_bits =
      1 + ((((unsigned int) (tmp1.ui64 >> 52)) & 0x7ff) - 0x3ff);
    q = bid_nr_digits[x_nr_bits - 1].digits;
    if (q == 0) {
      q = bid_nr_digits[x_nr_bits - 1].digits1;
      if (C1 >= bid_nr_digits[x_nr_bits - 1].threshold_lo)
	q++;

            

Reported by Cppcheck.

Shifting 32-bit value by 32 bits is undefined behaviour
Error

Line: 178 CWE codes: 758

                    // kx = 10^(-x) = bid_ten2mk64[ind - 1]
      // C* = (C1 + 1/2 * 10^x) * 10^(-x)
      // the approximation of 10^(-x) was rounded up to 64 bits
      __mul_64x64_to_128 (P128, C1, bid_ten2mk64[ind - 1]);

      // if (0 < f* < 10^(-x)) then the result is a midpoint
      //   if floor(C*) is even then C* = floor(C*) - logical right
      //       shift; C* has p decimal digits, correct by Prop. 1)
      //   else if floor(C*) is odd C* = floor(C*)-1 (logical right

            

Reported by Cppcheck.

Shifting 32-bit value by 32 bits is undefined behaviour
Error

Line: 264 CWE codes: 758

                    // kx = 10^(-x) = bid_ten2mk64[ind - 1]
      // C* = (C1 + 1/2 * 10^x) * 10^(-x)
      // the approximation of 10^(-x) was rounded up to 64 bits
      __mul_64x64_to_128 (P128, C1, bid_ten2mk64[ind - 1]);

      // if (0 < f* < 10^(-x)) then the result is a midpoint
      //   C* = floor(C*) - logical right shift; C* has p decimal digits, 
      //       correct by Prop. 1)
      // else

            

Reported by Cppcheck.

Shifting 32-bit value by 32 bits is undefined behaviour
Error

Line: 341 CWE codes: 758

                    // kx = 10^(-x) = bid_ten2mk64[ind - 1]
      // C* = C1 * 10^(-x)
      // the approximation of 10^(-x) was rounded up to 64 bits
      __mul_64x64_to_128 (P128, C1, bid_ten2mk64[ind - 1]);

      // C* = floor(C*) (logical right shift; C has p decimal digits,
      //       correct by Property 1)
      // if (0 < f* < 10^(-x)) then the result is exact
      // n = C* * 10^(e+x)  

            

Reported by Cppcheck.

Shifting 32-bit value by 32 bits is undefined behaviour
Error

Line: 394 CWE codes: 758

                    // kx = 10^(-x) = bid_ten2mk64[ind - 1]
      // C* = C1 * 10^(-x)
      // the approximation of 10^(-x) was rounded up to 64 bits
      __mul_64x64_to_128 (P128, C1, bid_ten2mk64[ind - 1]);

      // C* = floor(C*) (logical right shift; C has p decimal digits,
      //       correct by Property 1)
      // if (0 < f* < 10^(-x)) then the result is exact
      // n = C* * 10^(e+x)  

            

Reported by Cppcheck.

Shifting 32-bit value by 32 bits is undefined behaviour
Error

Line: 447 CWE codes: 758

                    // kx = 10^(-x) = bid_ten2mk64[ind - 1]
      // C* = C1 * 10^(-x)
      // the approximation of 10^(-x) was rounded up to 64 bits
      __mul_64x64_to_128 (P128, C1, bid_ten2mk64[ind - 1]);

      // C* = floor(C*) (logical right shift; C has p decimal digits,
      //       correct by Property 1)
      // if (0 < f* < 10^(-x)) then the result is exact
      // n = C* * 10^(e+x)  

            

Reported by Cppcheck.

Shifting 32-bit value by 53 bits is undefined behaviour
Error

Line: 538 CWE codes: 758

                if (C1 == 0) {
    if (exp < 0)
      exp = 0;
    res = x_sign | (((BID_UINT64) exp + 398) << 53);
    BID_RETURN (res);
  }
  // x is a finite non-zero number (not 0, non-canonical, or special)

  // return 0 if (exp <= -(p+1))

            

Reported by Cppcheck.

Shifting 32-bit value by 52 bits is undefined behaviour
Error

Line: 555 CWE codes: 758

                } else {	// if x < 2^53
    tmp1.d = (double) C1;	// exact conversion
    x_nr_bits =
      1 + ((((unsigned int) (tmp1.ui64 >> 52)) & 0x7ff) - 0x3ff);
    q = bid_nr_digits[x_nr_bits - 1].digits;
    if (q == 0) {
      q = bid_nr_digits[x_nr_bits - 1].digits1;
      if (C1 >= bid_nr_digits[x_nr_bits - 1].threshold_lo)
	q++;

            

Reported by Cppcheck.

Shifting 32-bit value by 32 bits is undefined behaviour
Error

Line: 583 CWE codes: 758

                  // kx = 10^(-x) = bid_ten2mk64[ind - 1]
    // C* = (C1 + 1/2 * 10^x) * 10^(-x)
    // the approximation of 10^(-x) was rounded up to 64 bits
    __mul_64x64_to_128 (P128, C1, bid_ten2mk64[ind - 1]);

    // if (0 < f* < 10^(-x)) then the result is a midpoint
    //   if floor(C*) is even then C* = floor(C*) - logical right
    //       shift; C* has p decimal digits, correct by Prop. 1)
    //   else if floor(C*) is odd C* = floor(C*)-1 (logical right

            

Reported by Cppcheck.

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.

src/third_party/asio-master/asio/include/asio/impl/read.hpp
22 issues
read - Check buffer boundaries if used in a loop including recursive loops
Security

Line: 64 Column: 13 CWE codes: 120 20

              
template <typename SyncReadStream, typename MutableBufferSequence,
    typename CompletionCondition>
std::size_t read(SyncReadStream& s, const MutableBufferSequence& buffers,
    CompletionCondition completion_condition, asio::error_code& ec,
    typename enable_if<
      is_mutable_buffer_sequence<MutableBufferSequence>::value
    >::type*)
{

            

Reported by FlawFinder.

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

Line: 75 Column: 20 CWE codes: 120 20

              }

template <typename SyncReadStream, typename MutableBufferSequence>
inline std::size_t read(SyncReadStream& s, const MutableBufferSequence& buffers,
    typename enable_if<
      is_mutable_buffer_sequence<MutableBufferSequence>::value
    >::type*)
{
  asio::error_code ec;

            

Reported by FlawFinder.

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

Line: 81 Column: 35 CWE codes: 120 20

                  >::type*)
{
  asio::error_code ec;
  std::size_t bytes_transferred = read(s, buffers, transfer_all(), ec);
  asio::detail::throw_error(ec, "read");
  return bytes_transferred;
}

template <typename SyncReadStream, typename MutableBufferSequence>

            

Reported by FlawFinder.

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

Line: 87 Column: 20 CWE codes: 120 20

              }

template <typename SyncReadStream, typename MutableBufferSequence>
inline std::size_t read(SyncReadStream& s, const MutableBufferSequence& buffers,
    asio::error_code& ec,
    typename enable_if<
      is_mutable_buffer_sequence<MutableBufferSequence>::value
    >::type*)
{

            

Reported by FlawFinder.

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

Line: 93 Column: 10 CWE codes: 120 20

                    is_mutable_buffer_sequence<MutableBufferSequence>::value
    >::type*)
{
  return read(s, buffers, transfer_all(), ec);
}

template <typename SyncReadStream, typename MutableBufferSequence,
    typename CompletionCondition>
inline std::size_t read(SyncReadStream& s, const MutableBufferSequence& buffers,

            

Reported by FlawFinder.

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

Line: 98 Column: 20 CWE codes: 120 20

              
template <typename SyncReadStream, typename MutableBufferSequence,
    typename CompletionCondition>
inline std::size_t read(SyncReadStream& s, const MutableBufferSequence& buffers,
    CompletionCondition completion_condition,
    typename enable_if<
      is_mutable_buffer_sequence<MutableBufferSequence>::value
    >::type*)
{

            

Reported by FlawFinder.

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

Line: 105 Column: 35 CWE codes: 120 20

                  >::type*)
{
  asio::error_code ec;
  std::size_t bytes_transferred = read(s, buffers, completion_condition, ec);
  asio::detail::throw_error(ec, "read");
  return bytes_transferred;
}

template <typename SyncReadStream, typename DynamicBuffer,

            

Reported by FlawFinder.

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

Line: 112 Column: 13 CWE codes: 120 20

              
template <typename SyncReadStream, typename DynamicBuffer,
    typename CompletionCondition>
std::size_t read(SyncReadStream& s,
    ASIO_MOVE_ARG(DynamicBuffer) buffers,
    CompletionCondition completion_condition, asio::error_code& ec,
    typename enable_if<
      is_dynamic_buffer<typename decay<DynamicBuffer>::type>::value
    >::type*)

            

Reported by FlawFinder.

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

Line: 144 Column: 20 CWE codes: 120 20

              }

template <typename SyncReadStream, typename DynamicBuffer>
inline std::size_t read(SyncReadStream& s,
    ASIO_MOVE_ARG(DynamicBuffer) buffers,
    typename enable_if<
      is_dynamic_buffer<typename decay<DynamicBuffer>::type>::value
    >::type*)
{

            

Reported by FlawFinder.

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

Line: 151 Column: 35 CWE codes: 120 20

                  >::type*)
{
  asio::error_code ec;
  std::size_t bytes_transferred = read(s,
      ASIO_MOVE_CAST(DynamicBuffer)(buffers), transfer_all(), ec);
  asio::detail::throw_error(ec, "read");
  return bytes_transferred;
}


            

Reported by FlawFinder.

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

Line: 30 Column: 1

              # OTHER DEALINGS IN THE SOFTWARE.

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

# test_prepare_hs01.py
# test to ensure history store eviction is working for prepared transactions.

            

Reported by Pylint.

Unused copy_wiredtiger_home imported from helper
Error

Line: 29 Column: 1

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

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

# test_prepare_hs01.py

            

Reported by Pylint.

Unused import wiredtiger
Error

Line: 30 Column: 1

              # OTHER DEALINGS IN THE SOFTWARE.

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

# test_prepare_hs01.py
# test to ensure history store eviction is working for prepared transactions.

            

Reported by Pylint.

Using deprecated method assertEquals()
Error

Line: 52 Column: 13

                      self.session.begin_transaction('read_timestamp=' + self.timestamp_str(read_ts))
        for i in range(1, nsessions * nkeys):
            cursor.set_key(ds.key(nrows + i))
            self.assertEquals(cursor.search(), 0)
            # Correctness Test - commit_value should be visible
            self.assertEquals(cursor.get_value(), expected_value)
            # Correctness Test - prepare_value should NOT be visible
            self.assertNotEquals(cursor.get_value(), not_expected_value)
        cursor.close()

            

Reported by Pylint.

Using deprecated method assertEquals()
Error

Line: 54 Column: 13

                          cursor.set_key(ds.key(nrows + i))
            self.assertEquals(cursor.search(), 0)
            # Correctness Test - commit_value should be visible
            self.assertEquals(cursor.get_value(), expected_value)
            # Correctness Test - prepare_value should NOT be visible
            self.assertNotEquals(cursor.get_value(), not_expected_value)
        cursor.close()
        self.session.commit_transaction()


            

Reported by Pylint.

Using deprecated method assertNotEquals()
Error

Line: 56 Column: 13

                          # Correctness Test - commit_value should be visible
            self.assertEquals(cursor.get_value(), expected_value)
            # Correctness Test - prepare_value should NOT be visible
            self.assertNotEquals(cursor.get_value(), not_expected_value)
        cursor.close()
        self.session.commit_transaction()

    def prepare_updates(self, uri, ds, nrows, nsessions, nkeys):
        # Update a large number of records in their individual transactions.

            

Reported by Pylint.

Using deprecated method assertEquals()
Error

Line: 84 Column: 13

                          self.session.begin_transaction('isolation=snapshot')
            cursor.set_key(ds.key(nrows + i))
            cursor.set_value(bigvalue1)
            self.assertEquals(cursor.insert(), 0)
            self.session.commit_transaction('commit_timestamp=' + self.timestamp_str(1))

        # Have prepared updates in multiple sessions. This should ensure writing
        # prepared updates to the history store
        sessions = [0] * nsessions

            

Reported by Pylint.

Using deprecated method assertEquals()
Error

Line: 102 Column: 17

                          for i in range(start, end):
                cursors[j].set_key(ds.key(nrows + i))
                cursors[j].set_value(bigvalue2)
                self.assertEquals(cursors[j].insert(), 0)
            sessions[j].prepare_transaction('prepare_timestamp=' + self.timestamp_str(2))

        # Re-read the original versions of all the data. This ensures reading
        # original versions from the history store
        self.check(uri, ds, nrows, nsessions, nkeys, 1, bigvalue1, bigvalue2)

            

Reported by Pylint.

Using deprecated method assertEquals()
Error

Line: 133 Column: 13

                      for i in range(1, 10000):
            cursor.set_key(ds.key(nrows + i))
            cursor.set_value(bigvalue)
            self.assertEquals(cursor.insert(), 0)
        cursor.close()
        self.session.checkpoint()

        # Check if the history store is working properly with prepare transactions.
        # We put prepared updates in multiple sessions so that we do not hang

            

Reported by Pylint.

Missing module docstring
Error

Line: 1 Column: 1

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

            

Reported by Pylint.

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

Line: 32 Column: 1

              # test_bug021.py
#       Fixed-length column store implicit record operations test.

import wiredtiger, wttest

# Fixed-length column store implicit record operations test.
class test_bug021(wttest.WiredTigerTestCase):
    uri = 'file:test_bug021'


            

Reported by Pylint.

Unused import wiredtiger
Error

Line: 32 Column: 1

              # test_bug021.py
#       Fixed-length column store implicit record operations test.

import wiredtiger, wttest

# Fixed-length column store implicit record operations test.
class test_bug021(wttest.WiredTigerTestCase):
    uri = 'file:test_bug021'


            

Reported by Pylint.

Unused variable 'i'
Error

Line: 47 Column: 13

                      expected = [0] * (initial + middle + trailing + 2)
        expected[0] = None
        r = 0
        for i in range(initial):
            r += 1
            expected[r] = 0x00
        for i in range(middle):
            r += 1
            cursor[r] = expected[r] = 0xab

            

Reported by Pylint.

Missing module docstring
Error

Line: 1 Column: 1

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

            

Reported by Pylint.

Multiple imports on one line (wiredtiger, wttest)
Error

Line: 32 Column: 1

              # test_bug021.py
#       Fixed-length column store implicit record operations test.

import wiredtiger, wttest

# Fixed-length column store implicit record operations test.
class test_bug021(wttest.WiredTigerTestCase):
    uri = 'file:test_bug021'


            

Reported by Pylint.

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

Line: 35 Column: 1

              import wiredtiger, wttest

# Fixed-length column store implicit record operations test.
class test_bug021(wttest.WiredTigerTestCase):
    uri = 'file:test_bug021'

    def create_implicit(self, initial, middle, trailing):
        self.session.create(self.uri, 'key_format=r,value_format=8t')
        cursor = self.session.open_cursor(self.uri, None)

            

Reported by Pylint.

Missing class docstring
Error

Line: 35 Column: 1

              import wiredtiger, wttest

# Fixed-length column store implicit record operations test.
class test_bug021(wttest.WiredTigerTestCase):
    uri = 'file:test_bug021'

    def create_implicit(self, initial, middle, trailing):
        self.session.create(self.uri, 'key_format=r,value_format=8t')
        cursor = self.session.open_cursor(self.uri, None)

            

Reported by Pylint.

Missing function or method docstring
Error

Line: 38 Column: 5

              class test_bug021(wttest.WiredTigerTestCase):
    uri = 'file:test_bug021'

    def create_implicit(self, initial, middle, trailing):
        self.session.create(self.uri, 'key_format=r,value_format=8t')
        cursor = self.session.open_cursor(self.uri, None)

        # Create a set of initial implicit records, followed by a set of real
        # records, followed by a set of trailing implicit records.

            

Reported by Pylint.

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

Line: 46 Column: 9

                      # records, followed by a set of trailing implicit records.
        expected = [0] * (initial + middle + trailing + 2)
        expected[0] = None
        r = 0
        for i in range(initial):
            r += 1
            expected[r] = 0x00
        for i in range(middle):
            r += 1

            

Reported by Pylint.

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

Line: 48 Column: 13

                      expected[0] = None
        r = 0
        for i in range(initial):
            r += 1
            expected[r] = 0x00
        for i in range(middle):
            r += 1
            cursor[r] = expected[r] = 0xab
        r += trailing

            

Reported by Pylint.

site_scons/site_tools/mongo_test_execution.py
22 issues
Unable to import 'SCons'
Error

Line: 25 Column: 1

              
import os

import SCons

import auto_install_binaries

_proof_scanner_cache_key = "proof_scanner_cache"
_associated_proof = "associated_proof_key"

            

Reported by Pylint.

Unused argument 'path'
Error

Line: 32 Column: 53

              _proof_scanner_cache_key = "proof_scanner_cache"
_associated_proof = "associated_proof_key"

def proof_generator_command_scanner_func(node, env, path):
    results = getattr(node.attributes, _proof_scanner_cache_key, None)
    if results is not None:
        return results
    results = env.GetTransitivelyInstalledFiles(node)
    setattr(node.attributes, _proof_scanner_cache_key, results)

            

Reported by Pylint.

TODO: Should we enable proof at the file level?
Error

Line: 129 Column: 3

              
    setattr(installed[0].attributes, _associated_proof, proof_analyzer_alias)

    # TODO: Should we enable proof at the file level?

def exists(env):
    return True



            

Reported by Pylint.

Unused argument 'env'
Error

Line: 131 Column: 12

              
    # TODO: Should we enable proof at the file level?

def exists(env):
    return True


def generate(env):
    # Used for Ninja generator to collect the test execution aliases

            

Reported by Pylint.

TODO: Should we have some sort of prefix_xdir for the output location for these? Something like
Error

Line: 150 Column: 3

                      }
    )

    # TODO: Should we have some sort of prefix_xdir for the output location for these? Something like
    # $PREFIX_VARCACHE and which in our build is pre-populated to $PREFIX/var/cache/mongo or similar?

    if env['PLATFORM'] == 'win32':
        env["PROOF_GENERATOR_COMMAND"] = "$( $ICERUN $) ${SOURCES[0]} $UNITTEST_FLAGS > ${TARGETS[0]} 2>&1 & call echo %^errorlevel% > ${TARGETS[1]}"


            

Reported by Pylint.

TODO: Condition this on verbosity
Error

Line: 167 Column: 3

                      env["PROOF_GENERATOR_COMMAND"] = "$( $ICERUN $) ${SOURCES[0]} $UNITTEST_FLAGS > ${TARGETS[0]} 2>&1 ; echo $? > ${TARGETS[1]}"
        env["PROOF_ANALYZER_COMMAND"] = "if $$(exit $$(cat ${SOURCES[1]})) ; then touch $TARGET ; else exit 1 ; fi"

    # TODO: Condition this on verbosity
    env['PROOF_GENERATOR_COMSTR'] = "Running test ${SOURCES[0]}"
    env['PROOF_ANALYZER_COMSTR'] = "Analyzing test results in ${SOURCES[1]}"

            

Reported by Pylint.

Missing module docstring
Error

Line: 1 Column: 1

              # Copyright 2020 MongoDB Inc.
#
# 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
# the following conditions:

            

Reported by Pylint.

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

Line: 29 Column: 1

              
import auto_install_binaries

_proof_scanner_cache_key = "proof_scanner_cache"
_associated_proof = "associated_proof_key"

def proof_generator_command_scanner_func(node, env, path):
    results = getattr(node.attributes, _proof_scanner_cache_key, None)
    if results is not None:

            

Reported by Pylint.

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

Line: 30 Column: 1

              import auto_install_binaries

_proof_scanner_cache_key = "proof_scanner_cache"
_associated_proof = "associated_proof_key"

def proof_generator_command_scanner_func(node, env, path):
    results = getattr(node.attributes, _proof_scanner_cache_key, None)
    if results is not None:
        return results

            

Reported by Pylint.

Missing function or method docstring
Error

Line: 32 Column: 1

              _proof_scanner_cache_key = "proof_scanner_cache"
_associated_proof = "associated_proof_key"

def proof_generator_command_scanner_func(node, env, path):
    results = getattr(node.attributes, _proof_scanner_cache_key, None)
    if results is not None:
        return results
    results = env.GetTransitivelyInstalledFiles(node)
    setattr(node.attributes, _proof_scanner_cache_key, results)

            

Reported by Pylint.