The following issues were found

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

Line: 30 Column: 1

              # OTHER DEALINGS IN THE SOFTWARE.

from suite_subprocess import suite_subprocess
import fnmatch, os, time, wiredtiger, wttest

# test_debug_mode02.py
#    Test the debug mode settings. Test checkpoint_retention use.
class test_debug_mode02(wttest.WiredTigerTestCase, suite_subprocess):
    uri = 'file:test_debug'

            

Reported by Pylint.

An attribute defined in wttest line 401 hides this method
Error

Line: 43 Column: 5

                  log1 = 'WiredTigerLog.0000000001'
    log2 = 'WiredTigerLog.0000000002'

    def conn_config(self):
        return 'log=(enabled=true,file_max=100K),debug_mode=(checkpoint_retention=%d)' % self.retain

    def log_set(self):
        logs = fnmatch.filter(os.listdir(self.home), "*gerLog*")
        return set(logs)

            

Reported by Pylint.

Unused variable 'i'
Error

Line: 52 Column: 13

              
    def check_archive(self, logfile):
        archived = False
        for i in range(1,90):
            # Sleep and then see if archive ran. We do this in a loop
            # for slow machines. Max out at 90 seconds.
            time.sleep(1.0)
            if not os.path.exists(logfile):
                archived = True

            

Reported by Pylint.

Unused variable 'i'
Error

Line: 82 Column: 13

                      # No log files should be archived while we have fewer than the
        # retention number of logs. Make sure each iteration the new
        # logs are a proper superset of the previous time.
        for i in range(1, self.retain):
            cur_set = self.log_set()
            self.advance_log_checkpoint()
            # We don't accomodate slow machines here because we don't expect
            # the files the change and there is no way to know if archive ran
            # otherwise.

            

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.

Imports from package fnmatch are not grouped
Error

Line: 30 Column: 1

              # OTHER DEALINGS IN THE SOFTWARE.

from suite_subprocess import suite_subprocess
import fnmatch, os, time, wiredtiger, wttest

# test_debug_mode02.py
#    Test the debug mode settings. Test checkpoint_retention use.
class test_debug_mode02(wttest.WiredTigerTestCase, suite_subprocess):
    uri = 'file:test_debug'

            

Reported by Pylint.

Multiple imports on one line (fnmatch, os, time, wiredtiger, wttest)
Error

Line: 30 Column: 1

              # OTHER DEALINGS IN THE SOFTWARE.

from suite_subprocess import suite_subprocess
import fnmatch, os, time, wiredtiger, wttest

# test_debug_mode02.py
#    Test the debug mode settings. Test checkpoint_retention use.
class test_debug_mode02(wttest.WiredTigerTestCase, suite_subprocess):
    uri = 'file:test_debug'

            

Reported by Pylint.

standard import "import fnmatch, os, time, wiredtiger, wttest" should be placed before "from suite_subprocess import suite_subprocess"
Error

Line: 30 Column: 1

              # OTHER DEALINGS IN THE SOFTWARE.

from suite_subprocess import suite_subprocess
import fnmatch, os, time, wiredtiger, wttest

# test_debug_mode02.py
#    Test the debug mode settings. Test checkpoint_retention use.
class test_debug_mode02(wttest.WiredTigerTestCase, suite_subprocess):
    uri = 'file:test_debug'

            

Reported by Pylint.

standard import "import fnmatch, os, time, wiredtiger, wttest" should be placed before "from suite_subprocess import suite_subprocess"
Error

Line: 30 Column: 1

              # OTHER DEALINGS IN THE SOFTWARE.

from suite_subprocess import suite_subprocess
import fnmatch, os, time, wiredtiger, wttest

# test_debug_mode02.py
#    Test the debug mode settings. Test checkpoint_retention use.
class test_debug_mode02(wttest.WiredTigerTestCase, suite_subprocess):
    uri = 'file:test_debug'

            

Reported by Pylint.

standard import "import fnmatch, os, time, wiredtiger, wttest" should be placed before "from suite_subprocess import suite_subprocess"
Error

Line: 30 Column: 1

              # OTHER DEALINGS IN THE SOFTWARE.

from suite_subprocess import suite_subprocess
import fnmatch, os, time, wiredtiger, wttest

# test_debug_mode02.py
#    Test the debug mode settings. Test checkpoint_retention use.
class test_debug_mode02(wttest.WiredTigerTestCase, suite_subprocess):
    uri = 'file:test_debug'

            

Reported by Pylint.

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

Line: 30 Column: 1

              # OTHER DEALINGS IN THE SOFTWARE.
from helper import simulate_crash_restart
from test_rollback_to_stable01 import test_rollback_to_stable_base
from wiredtiger import stat
from wtdataset import SimpleDataSet
from wtscenario import make_scenarios

# test_rollback_to_stable13.py
# Test the rollback to stable should retain/restore the tombstone from

            

Reported by Pylint.

An attribute defined in wttest line 401 hides this method
Error

Line: 52 Column: 5

              
    scenarios = make_scenarios(key_format_values, prepare_values)

    def conn_config(self):
        config = 'cache_size=50MB,statistics=(all),log=(enabled=true)'
        return config

    def test_rollback_to_stable(self):
        nrows = 1000

            

Reported by Pylint.

Missing module docstring
Error

Line: 1 Column: 1

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

            

Reported by Pylint.

third party import "from wiredtiger import stat" should be placed before "from helper import simulate_crash_restart"
Error

Line: 30 Column: 1

              # OTHER DEALINGS IN THE SOFTWARE.
from helper import simulate_crash_restart
from test_rollback_to_stable01 import test_rollback_to_stable_base
from wiredtiger import stat
from wtdataset import SimpleDataSet
from wtscenario import make_scenarios

# test_rollback_to_stable13.py
# Test the rollback to stable should retain/restore the tombstone from

            

Reported by Pylint.

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

Line: 37 Column: 1

              # test_rollback_to_stable13.py
# Test the rollback to stable should retain/restore the tombstone from
# the update list or from the history store for on-disk database.
class test_rollback_to_stable13(test_rollback_to_stable_base):
    session_config = 'isolation=snapshot'

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

            

Reported by Pylint.

Missing class docstring
Error

Line: 37 Column: 1

              # test_rollback_to_stable13.py
# Test the rollback to stable should retain/restore the tombstone from
# the update list or from the history store for on-disk database.
class test_rollback_to_stable13(test_rollback_to_stable_base):
    session_config = 'isolation=snapshot'

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

            

Reported by Pylint.

Missing function or method docstring
Error

Line: 52 Column: 5

              
    scenarios = make_scenarios(key_format_values, prepare_values)

    def conn_config(self):
        config = 'cache_size=50MB,statistics=(all),log=(enabled=true)'
        return config

    def test_rollback_to_stable(self):
        nrows = 1000

            

Reported by Pylint.

Method could be a function
Error

Line: 52 Column: 5

              
    scenarios = make_scenarios(key_format_values, prepare_values)

    def conn_config(self):
        config = 'cache_size=50MB,statistics=(all),log=(enabled=true)'
        return config

    def test_rollback_to_stable(self):
        nrows = 1000

            

Reported by Pylint.

Missing function or method docstring
Error

Line: 56 Column: 5

                      config = 'cache_size=50MB,statistics=(all),log=(enabled=true)'
        return config

    def test_rollback_to_stable(self):
        nrows = 1000

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

            

Reported by Pylint.

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

Line: 61 Column: 9

              
        # Create a table without logging.
        uri = "table:rollback_to_stable13"
        ds = SimpleDataSet(
            self, uri, 0, key_format=self.key_format, value_format="S", config='split_pct=50,log=(enabled=false)')
        ds.populate()

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

            

Reported by Pylint.

src/third_party/s2/base/port.h
20 issues
_snprintf - If format strings can be influenced by an attacker, they can be exploited, and note that sprintf variations do not always \0-terminate
Security

Line: 711 Column: 18 CWE codes: 134
Suggestion: Use a constant for the format specification

              #define strtoull _strtoui64
#define safe_vsnprintf _vsnprintf
#if _MSC_VER < 1900
#define snprintf _snprintf
#endif

#endif

#ifdef COMPILER_MSVC     /* if Visual C++ */

            

Reported by FlawFinder.

snprintf - If format strings can be influenced by an attacker, they can be exploited, and note that sprintf variations do not always \0-terminate
Security

Line: 711 Column: 9 CWE codes: 134
Suggestion: Use a constant for the format specification

              #define strtoull _strtoui64
#define safe_vsnprintf _vsnprintf
#if _MSC_VER < 1900
#define snprintf _snprintf
#endif

#endif

#ifdef COMPILER_MSVC     /* if Visual C++ */

            

Reported by FlawFinder.

vsnprintf - If format strings can be influenced by an attacker, they can be exploited, and note that sprintf variations do not always \0-terminate
Security

Line: 788 Column: 9 CWE codes: 134
Suggestion: Use a constant for the format specification

              #define PATH_MAX MAX_PATH

// You say tomato, I say _tomato
#define vsnprintf _vsnprintf
#define snprintf _snprintf
#define strcasecmp _stricmp
#define strncasecmp _strnicmp

#define nextafter _nextafter

            

Reported by FlawFinder.

_snprintf - If format strings can be influenced by an attacker, they can be exploited, and note that sprintf variations do not always \0-terminate
Security

Line: 789 Column: 18 CWE codes: 134
Suggestion: Use a constant for the format specification

              
// You say tomato, I say _tomato
#define vsnprintf _vsnprintf
#define snprintf _snprintf
#define strcasecmp _stricmp
#define strncasecmp _strnicmp

#define nextafter _nextafter


            

Reported by FlawFinder.

snprintf - If format strings can be influenced by an attacker, they can be exploited, and note that sprintf variations do not always \0-terminate
Security

Line: 789 Column: 9 CWE codes: 134
Suggestion: Use a constant for the format specification

              
// You say tomato, I say _tomato
#define vsnprintf _vsnprintf
#define snprintf _snprintf
#define strcasecmp _stricmp
#define strncasecmp _strnicmp

#define nextafter _nextafter


            

Reported by FlawFinder.

tempnam - Temporary file race condition
Security

Line: 799 Column: 9 CWE codes: 377

              #define hypotf _hypotf

#define strdup _strdup
#define tempnam _tempnam
#define chdir  _chdir
#define getcwd _getcwd
#define putenv  _putenv



            

Reported by FlawFinder.

random - This function is not sufficiently random for security-related functions such as key and nonce creation
Security

Line: 806 Column: 9 CWE codes: 327
Suggestion: Use a more secure technique for acquiring random values

              

// You say tomato, I say toma
#define random() rand()
#define srandom(x) srand(x)

// You say juxtapose, I say transpose
#define bcopy(s, d, n) memcpy(d, s, n)


            

Reported by FlawFinder.

srandom - This function is not sufficiently random for security-related functions such as key and nonce creation
Security

Line: 807 Column: 9 CWE codes: 327
Suggestion: Use a more secure technique for acquiring random values

              
// You say tomato, I say toma
#define random() rand()
#define srandom(x) srand(x)

// You say juxtapose, I say transpose
#define bcopy(s, d, n) memcpy(d, s, n)

inline void *aligned_malloc(size_t size, int minimum_alignment) {

            

Reported by FlawFinder.

srand - This function is not sufficiently random for security-related functions such as key and nonce creation
Security

Line: 807 Column: 20 CWE codes: 327
Suggestion: Use a more secure technique for acquiring random values

              
// You say tomato, I say toma
#define random() rand()
#define srandom(x) srand(x)

// You say juxtapose, I say transpose
#define bcopy(s, d, n) memcpy(d, s, n)

inline void *aligned_malloc(size_t size, int minimum_alignment) {

            

Reported by FlawFinder.

setstate - This function is not sufficiently random for security-related functions such as key and nonce creation
Security

Line: 990 Column: 32 CWE codes: 327
Suggestion: Use a more secure technique for acquiring random values

              #endif

#if defined COMPILER_GCC3 || defined COMPILER_ICC
#define STREAM_SET(s, bit) (s).setstate(ios_base::bit)
#define STREAM_SETF(s, flag) (s).setf(ios_base::flag)
#else
#define STREAM_SET(s, bit) (s).set(ios::bit)
#define STREAM_SETF(s, flag) (s).setf(ios::flag)
#endif

            

Reported by FlawFinder.

src/third_party/mozjs-60/extract/js/src/jsnum.cpp
20 issues
strcpy - Does not check for buffer overflows when copying to destination [MS-banned]
Security

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

                  }
    while (tmpSrc < end) {
        MOZ_ASSERT(tmpDest - buf + ptrdiff_t(thousandsLength) <= buflen);
        strcpy(tmpDest, rt->thousandsSeparator);
        tmpDest += thousandsLength;
        MOZ_ASSERT(tmpDest - buf + *tmpGroup <= buflen);
        js_memcpy(tmpDest, tmpSrc, *tmpGroup);
        tmpDest += *tmpGroup;
        tmpSrc += *tmpGroup;

            

Reported by FlawFinder.

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

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

              
    if (*nint == '.') {
        MOZ_ASSERT(tmpDest - buf + ptrdiff_t(decimalLength) <= buflen);
        strcpy(tmpDest, rt->decimalSeparator);
        tmpDest += decimalLength;
        MOZ_ASSERT(tmpDest - buf + ptrdiff_t(strlen(nint + 1)) <= buflen);
        strcpy(tmpDest, nint + 1);
    } else {
        MOZ_ASSERT(tmpDest - buf + ptrdiff_t(strlen(nint)) <= buflen);

            

Reported by FlawFinder.

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

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

                      strcpy(tmpDest, rt->decimalSeparator);
        tmpDest += decimalLength;
        MOZ_ASSERT(tmpDest - buf + ptrdiff_t(strlen(nint + 1)) <= buflen);
        strcpy(tmpDest, nint + 1);
    } else {
        MOZ_ASSERT(tmpDest - buf + ptrdiff_t(strlen(nint)) <= buflen);
        strcpy(tmpDest, nint);
    }


            

Reported by FlawFinder.

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

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

                      strcpy(tmpDest, nint + 1);
    } else {
        MOZ_ASSERT(tmpDest - buf + ptrdiff_t(strlen(nint)) <= buflen);
        strcpy(tmpDest, nint);
    }

    if (cx->runtime()->localeCallbacks && cx->runtime()->localeCallbacks->localeToUnicode) {
        Rooted<Value> v(cx, StringValue(str));
        bool ok = !!cx->runtime()->localeCallbacks->localeToUnicode(cx, buf, &v);

            

Reported by FlawFinder.

getenv - Environment variables are untrustable input if they can be set by an attacker. They can have any content and length, and the same variable can be set more than once
Security

Line: 1142 Column: 26 CWE codes: 807 20
Suggestion: Check environment variables carefully before using them

                  decimalPoint = locale->decimal_point;
    grouping = locale->grouping;
#else
    thousandsSeparator = getenv("LOCALE_THOUSANDS_SEP");
    decimalPoint = getenv("LOCALE_DECIMAL_POINT");
    grouping = getenv("LOCALE_GROUPING");
#endif
    if (!thousandsSeparator)
        thousandsSeparator = "'";

            

Reported by FlawFinder.

getenv - Environment variables are untrustable input if they can be set by an attacker. They can have any content and length, and the same variable can be set more than once
Security

Line: 1143 Column: 20 CWE codes: 807 20
Suggestion: Check environment variables carefully before using them

                  grouping = locale->grouping;
#else
    thousandsSeparator = getenv("LOCALE_THOUSANDS_SEP");
    decimalPoint = getenv("LOCALE_DECIMAL_POINT");
    grouping = getenv("LOCALE_GROUPING");
#endif
    if (!thousandsSeparator)
        thousandsSeparator = "'";
    if (!decimalPoint)

            

Reported by FlawFinder.

getenv - Environment variables are untrustable input if they can be set by an attacker. They can have any content and length, and the same variable can be set more than once
Security

Line: 1144 Column: 16 CWE codes: 807 20
Suggestion: Check environment variables carefully before using them

              #else
    thousandsSeparator = getenv("LOCALE_THOUSANDS_SEP");
    decimalPoint = getenv("LOCALE_DECIMAL_POINT");
    grouping = getenv("LOCALE_GROUPING");
#endif
    if (!thousandsSeparator)
        thousandsSeparator = "'";
    if (!decimalPoint)
        decimalPoint = ".";

            

Reported by FlawFinder.

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

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

                  if (JSFlatString* str = LookupInt32ToString(cx, si))
        return js::AtomizeString(cx, str);

    char buffer[JSFatInlineString::MAX_LENGTH_TWO_BYTE + 1];
    size_t length;
    char* start = BackfillInt32InBuffer(si, buffer, JSFatInlineString::MAX_LENGTH_TWO_BYTE + 1, &length);

    Maybe<uint32_t> indexValue;
    if (si >= 0)

            

Reported by FlawFinder.

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

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

                  if (!EnsureDtoaState(cx))
        return false;

    char buf[DTOSTR_VARIABLE_BUFFER_SIZE(MAX_PRECISION + 1)];
    char* numStr = js_dtostr(cx->dtoaState, buf, sizeof buf, mode, precision, d);
    if (!numStr) {
        JS_ReportOutOfMemory(cx);
        return false;
    }

            

Reported by FlawFinder.

strlen - Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected)
Security

Line: 787 Column: 30 CWE codes: 126

                  }

    JSRuntime* rt = cx->runtime();
    size_t thousandsLength = strlen(rt->thousandsSeparator);
    size_t decimalLength = strlen(rt->decimalSeparator);

    /* Figure out how long resulting string will be. */
    int buflen = strlen(num);
    if (*nint == '.')

            

Reported by FlawFinder.

src/third_party/wiredtiger/test/csuite/incr_backup/main.c
20 issues
Using argument active that points at uninitialized variable active
Error

Line: 233 CWE codes: 908

              static void
active_files_init(ACTIVE_FILES *active)
{
    WT_CLEAR(*active);
}

/*
 * active_files_print --
 *     Print the set of active files for debugging.

            

Reported by Cppcheck.

printf - If format strings can be influenced by an attacker, they can be exploited
Security

Line: 73 Column: 13 CWE codes: 134
Suggestion: Use a constant for the format specification

              #define VERBOSE(level, fmt, ...)      \
    do {                              \
        if (level <= verbose_level)   \
            printf(fmt, __VA_ARGS__); \
    } while (0)

/*
 * We keep an array of tables, each one may or may not be in use. "In use" means it has been
 * created, and will be updated from time to time.

            

Reported by FlawFinder.

system - This causes a new program to execute and is difficult to use safely
Security

Line: 532 Column: 20 CWE codes: 78
Suggestion: try using a library call that implements the same functionality if available

                  testutil_check(
      __wt_snprintf(buf, sizeof(buf), "rm -rf %s && mkdir %s", backup_home, backup_home));
    VERBOSE(3, " => %s\n", buf);
    testutil_check(system(buf));

    testutil_check(conn->open_session(conn, NULL, NULL, &session));
    tinfo->full_backup_number = tinfo->incr_backup_number++;

    /* Half of the runs with very low granularity to stress bitmaps */

            

Reported by FlawFinder.

system - This causes a new program to execute and is difficult to use safely
Security

Line: 563 Column: 24 CWE codes: 78
Suggestion: try using a library call that implements the same functionality if available

                      testutil_check(
          __wt_snprintf(buf, sizeof(buf), "cp %s/%s %s/%s", home, filename, backup_home, filename));
        VERBOSE(3, " => %s\n", buf);
        testutil_check(system(buf));
    }
    testutil_assert(ret == WT_NOTFOUND);
    testutil_check(cursor->close(cursor));
    testutil_check(session->close(session, NULL));
    active_files_sort(active);

            

Reported by FlawFinder.

system - This causes a new program to execute and is difficult to use safely
Security

Line: 634 Column: 28 CWE codes: 78
Suggestion: try using a library call that implements the same functionality if available

                          testutil_check(__wt_snprintf(
              buf, sizeof(buf), "cp %s/%s %s/%s", home, filename, backup_home, filename));
            VERBOSE(3, " => %s\n", buf);
            testutil_check(system(buf));
        } else {
            /*
             * Here is the normal incremental backup. Now that we know what file has changed, we get
             * the specific changes
             */

            

Reported by FlawFinder.

system - This causes a new program to execute and is difficult to use safely
Security

Line: 667 Column: 36 CWE codes: 78
Suggestion: try using a library call that implements the same functionality if available

                                  testutil_check(__wt_snprintf(
                      buf, sizeof(buf), "cp %s/%s %s/%s", home, filename, backup_home, filename));
                    VERBOSE(3, " => %s\n", buf);
                    testutil_check(system(buf));
                }
            }
            testutil_assert(ret == WT_NOTFOUND);
            testutil_check(file_cursor->close(file_cursor));
        }

            

Reported by FlawFinder.

sscanf - The scanf() family's %s operation, without a limit specification, permits buffer overflows
Security

Line: 740 Column: 25 CWE codes: 120 20
Suggestion: Specify a limit to %s, or use a different input function

                       * Reconstruct the change number from the key. See key_value() for details on how the key is
         * constructed.
         */
        testutil_assert(sscanf(got_key, KEY_FORMAT, &keylow, &keyhigh) == 2);
        change_count = (u_int)keyhigh * 100 + (u_int)keylow;
        item.data = value;
        item.size = table->max_value_size;
        if (op_type == INSERT || (op_type == UPDATE && change_count < boundary))
            change_count += 0;

            

Reported by FlawFinder.

system - This causes a new program to execute and is difficult to use safely
Security

Line: 779 Column: 20 CWE codes: 78
Suggestion: try using a library call that implements the same functionality if available

              
    testutil_check(__wt_snprintf(
      buf, sizeof(buf), "rm -rf %s && cp -r %s %s", backup_check, backup_home, backup_check));
    testutil_check(system(buf));

    testutil_check(wiredtiger_open(backup_check, NULL, CONN_CONFIG_COMMON, &conn));
    testutil_check(conn->open_session(conn, NULL, NULL, &session));

    for (slot = 0; slot < tinfo->table_count; slot++) {

            

Reported by FlawFinder.

system - This causes a new program to execute and is difficult to use safely
Security

Line: 845 Column: 19 CWE codes: 78
Suggestion: try using a library call that implements the same functionality if available

              
    testutil_check(
      __wt_snprintf(command, sizeof(command), "rm -rf %s %s; mkdir %s", home, backup_dir, home));
    if ((status = system(command)) < 0)
        testutil_die(status, "system: %s", command);

    backup_verbose = (verbose_level >= 4) ? "verbose=(backup)" : "";

    /*

            

Reported by FlawFinder.

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

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

              {
    uint32_t curpos, prevpos;
    int cmp;
    char filename[1024];

    active_files_print(prev, "computing removals: previous list of active files");
    active_files_print(cur, "computing removals: current list of active files");
    curpos = 0;
    /*

            

Reported by FlawFinder.

src/third_party/scons-3.1.2/scons-local-3.1.2/SCons/Tool/dvipdf.py
20 issues
Attempted relative import beyond top-level package
Error

Line: 103 Column: 5

                  if DVIPDFAction is None:
        DVIPDFAction = SCons.Action.Action(DviPdfFunction, strfunction = DviPdfStrFunction)

    from . import pdf
    pdf.generate(env)

    bld = env['BUILDERS']['PDF']
    bld.add_action('.dvi', DVIPDFAction)
    bld.add_emitter('.dvi', PDFEmitter)

            

Reported by Pylint.

Access to a protected member _null of a client class
Error

Line: 41 Column: 9

              import SCons.Tool.tex
import SCons.Util

_null = SCons.Scanner.LaTeX._null

def DviPdfPsFunction(XXXDviAction, target = None, source= None, env=None):
    """A builder for DVI files that sets the TEXPICTS environment
       variable before running dvi2ps or dvipdf."""


            

Reported by Pylint.

Unused argument 'env'
Error

Line: 82 Column: 32

              PDFAction = None
DVIPDFAction = None

def PDFEmitter(target, source, env):
    """Strips any .aux or .log files from the input source list.
    These are created by the TeX Builder that in all likelihood was
    used to generate the .dvi file we're using as input, and we only
    care about the .dvi file.
    """

            

Reported by Pylint.

Using the global statement
Error

Line: 95 Column: 5

              
def generate(env):
    """Add Builders and construction variables for dvipdf to an Environment."""
    global PDFAction
    if PDFAction is None:
        PDFAction = SCons.Action.Action('$DVIPDFCOM', '$DVIPDFCOMSTR')

    global DVIPDFAction
    if DVIPDFAction is None:

            

Reported by Pylint.

Using the global statement
Error

Line: 99 Column: 5

                  if PDFAction is None:
        PDFAction = SCons.Action.Action('$DVIPDFCOM', '$DVIPDFCOMSTR')

    global DVIPDFAction
    if DVIPDFAction is None:
        DVIPDFAction = SCons.Action.Action(DviPdfFunction, strfunction = DviPdfStrFunction)

    from . import pdf
    pdf.generate(env)

            

Reported by Pylint.

Line too long (117/100)
Error

Line: 33 Column: 1

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

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

import SCons.Action
import SCons.Defaults
import SCons.Tool.pdf
import SCons.Tool.tex

            

Reported by Pylint.

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

Line: 43 Column: 1

              
_null = SCons.Scanner.LaTeX._null

def DviPdfPsFunction(XXXDviAction, target = None, source= None, env=None):
    """A builder for DVI files that sets the TEXPICTS environment
       variable before running dvi2ps or dvipdf."""

    try:
        abspath = source[0].attributes.path

            

Reported by Pylint.

Argument name "XXXDviAction" doesn't conform to snake_case naming style
Error

Line: 43 Column: 1

              
_null = SCons.Scanner.LaTeX._null

def DviPdfPsFunction(XXXDviAction, target = None, source= None, env=None):
    """A builder for DVI files that sets the TEXPICTS environment
       variable before running dvi2ps or dvipdf."""

    try:
        abspath = source[0].attributes.path

            

Reported by Pylint.

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

Line: 66 Column: 1

              
    return result

def DviPdfFunction(target = None, source= None, env=None):
    result = DviPdfPsFunction(PDFAction,target,source,env)
    return result

def DviPdfStrFunction(target = None, source= None, env=None):
    """A strfunction for dvipdf that returns the appropriate

            

Reported by Pylint.

Missing function or method docstring
Error

Line: 66 Column: 1

              
    return result

def DviPdfFunction(target = None, source= None, env=None):
    result = DviPdfPsFunction(PDFAction,target,source,env)
    return result

def DviPdfStrFunction(target = None, source= None, env=None):
    """A strfunction for dvipdf that returns the appropriate

            

Reported by Pylint.

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

              }

void
MacroAssemblerCompat::wasmLoadImpl(const wasm::MemoryAccessDesc& access, Register memoryBase_,
                                   Register ptr_, Register ptrScratch_, AnyRegister outany,
                                   Register64 out64)
{
    uint32_t offset = access.offset();
    MOZ_ASSERT(offset < wasm::OffsetGuardLimit);

            

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

                                                 Register ptr_, Register ptrScratch_, AnyRegister outany,
                                   Register64 out64)
{
    uint32_t offset = access.offset();
    MOZ_ASSERT(offset < wasm::OffsetGuardLimit);

    MOZ_ASSERT(ptr_ == ptrScratch_);

    ARMRegister memoryBase(memoryBase_, 64);

            

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

                  if (offset)
        Add(ptr, ptr, Operand(offset));

    asMasm().memoryBarrierBefore(access.sync());

    MemOperand srcAddr(memoryBase, ptr);
    size_t loadOffset = asMasm().currentOffset();
    switch (access.type()) {
      case Scalar::Int8:

            

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

              
    MemOperand srcAddr(memoryBase, ptr);
    size_t loadOffset = asMasm().currentOffset();
    switch (access.type()) {
      case Scalar::Int8:
        Ldrsb(SelectGPReg(outany, out64), srcAddr);
        break;
      case Scalar::Uint8:
        Ldrb(SelectGPReg(outany, out64), srcAddr);

            

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

                    case Scalar::Int16x8:
        MOZ_CRASH("unexpected array type");
    }
    append(access, loadOffset, framePushed());

    asMasm().memoryBarrierAfter(access.sync());
}

void

            

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

                  }
    append(access, loadOffset, framePushed());

    asMasm().memoryBarrierAfter(access.sync());
}

void
MacroAssemblerCompat::wasmStoreImpl(const wasm::MemoryAccessDesc& access, AnyRegister valany,
                                    Register64 val64, Register memoryBase_, Register ptr_,

            

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

              }

void
MacroAssemblerCompat::wasmStoreImpl(const wasm::MemoryAccessDesc& access, AnyRegister valany,
                                    Register64 val64, Register memoryBase_, Register ptr_,
                                    Register ptrScratch_)
{
    uint32_t offset = access.offset();
    MOZ_ASSERT(offset < wasm::OffsetGuardLimit);

            

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

                                                  Register64 val64, Register memoryBase_, Register ptr_,
                                    Register ptrScratch_)
{
    uint32_t offset = access.offset();
    MOZ_ASSERT(offset < wasm::OffsetGuardLimit);

    MOZ_ASSERT(ptr_ == ptrScratch_);

    ARMRegister memoryBase(memoryBase_, 64);

            

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

                  if (offset)
        Add(ptr, ptr, Operand(offset));

    asMasm().memoryBarrierBefore(access.sync());

    MemOperand dstAddr(memoryBase, ptr);
    size_t storeOffset = asMasm().currentOffset();
    switch (access.type()) {
      case Scalar::Int8:

            

Reported by FlawFinder.

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

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

              
    MemOperand dstAddr(memoryBase, ptr);
    size_t storeOffset = asMasm().currentOffset();
    switch (access.type()) {
      case Scalar::Int8:
      case Scalar::Uint8:
        Strb(SelectGPReg(valany, val64), dstAddr);
        break;
      case Scalar::Int16:

            

Reported by FlawFinder.

src/third_party/pcre-8.42/pcrecpp_unittest.cc
20 issues
sprintf - Potential format string problem
Security

Line: 979 Column: 5 CWE codes: 134
Suggestion: Make format string constant

                  CHECK(RE("(-?\\d+)").FullMatch("100", &v)); CHECK_EQ(v, 100);
    CHECK(RE("(-?\\d+)").FullMatch("-100",&v)); CHECK_EQ(v, -100);

    sprintf(buf, LLD, max_value);
    CHECK(RE("(-?\\d+)").FullMatch(buf,&v)); CHECK_EQ(v, max_value);

    sprintf(buf, LLD, min_value);
    CHECK(RE("(-?\\d+)").FullMatch(buf,&v)); CHECK_EQ(v, min_value);


            

Reported by FlawFinder.

sprintf - Potential format string problem
Security

Line: 982 Column: 5 CWE codes: 134
Suggestion: Make format string constant

                  sprintf(buf, LLD, max_value);
    CHECK(RE("(-?\\d+)").FullMatch(buf,&v)); CHECK_EQ(v, max_value);

    sprintf(buf, LLD, min_value);
    CHECK(RE("(-?\\d+)").FullMatch(buf,&v)); CHECK_EQ(v, min_value);

    sprintf(buf, LLD, max_value);
    assert(buf[strlen(buf)-1] != '9');
    buf[strlen(buf)-1]++;

            

Reported by FlawFinder.

sprintf - Potential format string problem
Security

Line: 985 Column: 5 CWE codes: 134
Suggestion: Make format string constant

                  sprintf(buf, LLD, min_value);
    CHECK(RE("(-?\\d+)").FullMatch(buf,&v)); CHECK_EQ(v, min_value);

    sprintf(buf, LLD, max_value);
    assert(buf[strlen(buf)-1] != '9');
    buf[strlen(buf)-1]++;
    CHECK(!RE("(-?\\d+)").FullMatch(buf, &v));

    sprintf(buf, LLD, min_value);

            

Reported by FlawFinder.

sprintf - Potential format string problem
Security

Line: 990 Column: 5 CWE codes: 134
Suggestion: Make format string constant

                  buf[strlen(buf)-1]++;
    CHECK(!RE("(-?\\d+)").FullMatch(buf, &v));

    sprintf(buf, LLD, min_value);
    assert(buf[strlen(buf)-1] != '9');
    buf[strlen(buf)-1]++;
    CHECK(!RE("(-?\\d+)").FullMatch(buf, &v));
  }
#endif

            

Reported by FlawFinder.

sprintf - Potential format string problem
Security

Line: 1006 Column: 5 CWE codes: 134
Suggestion: Make format string constant

                  CHECK(RE("(-?\\d+)").FullMatch("100",&v)); CHECK_EQ(v, 100);
    CHECK(RE("(-?\\d+)").FullMatch("-100",&v2)); CHECK_EQ(v2, -100);

    sprintf(buf, LLU, max_value);
    CHECK(RE("(-?\\d+)").FullMatch(buf,&v)); CHECK_EQ(v, max_value);

    assert(buf[strlen(buf)-1] != '9');
    buf[strlen(buf)-1]++;
    CHECK(!RE("(-?\\d+)").FullMatch(buf, &v));

            

Reported by FlawFinder.

getenv - Environment variables are untrustable input if they can be set by an attacker. They can have any content and length, and the same variable can be set more than once
Security

Line: 1318 Column: 7 CWE codes: 807 20
Suggestion: Check environment variables carefully before using them

                TestRecursion();

  // Test Options
  if (getenv("VERBOSE_TEST") != NULL)
    VERBOSE_TEST  = true;
  TestOptions();

  // Test the constructors
  TestConstructors();

            

Reported by FlawFinder.

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

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

                    initial_size = VirtualProcessSize();
      printf("Size after 50000: %llu\n", initial_size);
    }
    char buf[100];  // definitely big enough
    sprintf(buf, "pat%09d", i);
    RE newre(buf);
  }
  uint64 final_size = VirtualProcessSize();
  printf("Size after 100000: %llu\n", final_size);

            

Reported by FlawFinder.

sprintf - Does not check for buffer overflows
Security

Line: 116 Column: 5 CWE codes: 120
Suggestion: Use sprintf_s, snprintf, or vsnprintf

                    printf("Size after 50000: %llu\n", initial_size);
    }
    char buf[100];  // definitely big enough
    sprintf(buf, "pat%09d", i);
    RE newre(buf);
  }
  uint64 final_size = VirtualProcessSize();
  printf("Size after 100000: %llu\n", final_size);
  const double growth = double(final_size - initial_size) / final_size;

            

Reported by FlawFinder.

atoi - Unless checked, the resulting number can exceed the expected range
Security

Line: 822 Column: 23 CWE codes: 190
Suggestion: If source untrusted, check both minimum and maximum, even if the input had no minus sign (large numbers can roll over into negative number; consider saving to an unsigned value if that is intended)

                }

  if (argc > 1) {
    if ( argc == 2 || atoi(argv[2]) == 0) {
      printf("timing mode needs a num-iters argument\n");
      return 1;
    }
    if (!strcmp(argv[1], "timing1"))
      Timing1(atoi(argv[2]));

            

Reported by FlawFinder.

atoi - Unless checked, the resulting number can exceed the expected range
Security

Line: 827 Column: 15 CWE codes: 190
Suggestion: If source untrusted, check both minimum and maximum, even if the input had no minus sign (large numbers can roll over into negative number; consider saving to an unsigned value if that is intended)

                    return 1;
    }
    if (!strcmp(argv[1], "timing1"))
      Timing1(atoi(argv[2]));
    else if (!strcmp(argv[1], "timing2"))
      Timing2(atoi(argv[2]));
    else if (!strcmp(argv[1], "timing3"))
      Timing3(atoi(argv[2]));
    else

            

Reported by FlawFinder.

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

Line: 227 Column: 4 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

                  }
#ifdef UCURR_DEBUG_EQUIV
 {
   char tmp[200];
   s.extract(0,s.length(),tmp, "UTF-8");
   printf("CountEquivalent('%s') = %d\n", tmp, result);
 }
#endif
    return result;

            

Reported by FlawFinder.

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

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

                  }

    // Look up our currency, or if that's not available, then DEFAULT
    char buf[ISO_CURRENCY_CODE_LENGTH+1];
    UErrorCode ec2 = U_ZERO_ERROR; // local error code: soft failure
    UResourceBundle* rb = ures_getByKey(currencyMeta, myUCharsToChars(buf, currency), NULL, &ec2);
      if (U_FAILURE(ec2)) {
        ures_close(rb);
        rb = ures_getByKey(currencyMeta,DEFAULT_META, NULL, &ec);

            

Reported by FlawFinder.

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

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

                  // !!! this is internal only, assumes buffer is not null and capacity is sufficient
    // Extract the country name and variant name.  We only
    // recognize two variant names, EURO and PREEURO.
    char variant[ULOC_FULLNAME_CAPACITY];
    ulocimp_getRegionForSupplementalData(locale, FALSE, countryAndVariant, capacity, ec);
    uloc_getVariant(locale, variant, sizeof(variant), ec);
    if (variant[0] != 0) {
        variantType = (uint32_t)(0 == uprv_strcmp(variant, VAR_EURO))
                   | ((uint32_t)(0 == uprv_strcmp(variant, VAR_PRE_EURO)) << 1);

            

Reported by FlawFinder.

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

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

              struct CReg : public icu::UMemory {
    CReg *next;
    UChar iso[ISO_CURRENCY_CODE_LENGTH+1];
    char  id[ULOC_FULLNAME_CAPACITY];

    CReg(const UChar* _iso, const char* _id)
        : next(0)
    {
        int32_t len = (int32_t)uprv_strlen(_id);

            

Reported by FlawFinder.

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

Line: 494 Column: 9 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

              ucurr_register(const UChar* isoCode, const char* locale, UErrorCode *status)
{
    if (status && U_SUCCESS(*status)) {
        char id[ULOC_FULLNAME_CAPACITY];
        idForLocale(locale, id, sizeof(id), status);
        return CReg::reg(isoCode, id, status);
    }
    return NULL;
}

            

Reported by FlawFinder.

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

Line: 553 Column: 13 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

                  if (ec != NULL && U_SUCCESS(*ec)) {
        if ((buff && buffCapacity) || !buffCapacity) {
            UErrorCode localStatus = U_ZERO_ERROR;
            char id[ULOC_FULLNAME_CAPACITY];
            if ((resLen = uloc_getKeywordValue(locale, "currency", id, ULOC_FULLNAME_CAPACITY, &localStatus))) {
                // there is a currency keyword. Try to see if it's valid
                if(buffCapacity > resLen) {
                    /* Normalize the currency keyword value to upper case. */
                    T_CString_toUpperCase(id);

            

Reported by FlawFinder.

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

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

                  // this function.
    UErrorCode ec2 = U_ZERO_ERROR;

    char loc[ULOC_FULLNAME_CAPACITY];
    uloc_getName(locale, loc, sizeof(loc), &ec2);
    if (U_FAILURE(ec2) || ec2 == U_STRING_NOT_TERMINATED_WARNING) {
        *ec = U_ILLEGAL_ARGUMENT_ERROR;
        return 0;
    }

            

Reported by FlawFinder.

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

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

                      return 0;
    }

    char buf[ISO_CURRENCY_CODE_LENGTH+1];
    myUCharsToChars(buf, currency);
    
    /* Normalize the keyword value to uppercase */
    T_CString_toUpperCase(buf);
    

            

Reported by FlawFinder.

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

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

                  // this function.
    UErrorCode ec2 = U_ZERO_ERROR;

    char loc[ULOC_FULLNAME_CAPACITY];
    uloc_getName(locale, loc, sizeof(loc), &ec2);
    if (U_FAILURE(ec2) || ec2 == U_STRING_NOT_TERMINATED_WARNING) {
        *ec = U_ILLEGAL_ARGUMENT_ERROR;
        return 0;
    }

            

Reported by FlawFinder.

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

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

                      return 0;
    }

    char buf[ISO_CURRENCY_CODE_LENGTH+1];
    myUCharsToChars(buf, currency);

    const UChar* s = NULL;
    ec2 = U_ZERO_ERROR;
    UResourceBundle* rb = ures_open(U_ICUDATA_CURR, loc, &ec2);

            

Reported by FlawFinder.

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

Line: 33 Column: 1

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

            

Reported by Pylint.

Unable to import 'wiredtiger'
Error

Line: 34 Column: 1

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

            

Reported by Pylint.

Unused import shutil
Error

Line: 30 Column: 1

              # OTHER DEALINGS IN THE SOFTWARE.

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

            

Reported by Pylint.

Unused import string
Error

Line: 31 Column: 1

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

            

Reported by Pylint.

No exception type(s) specified
Error

Line: 40 Column: 1

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

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

            

Reported by Pylint.

Statement seems to have no effect
Error

Line: 41 Column: 5

                  # module load.
    import resource
except:
    None

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

            

Reported by Pylint.

Cell variable i defined in loop
Error

Line: 133 Column: 43

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

            

Reported by Pylint.

Cell variable i defined in loop
Error

Line: 135 Column: 45

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

            

Reported by Pylint.

Missing module docstring
Error

Line: 1 Column: 1

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

            

Reported by Pylint.

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

Line: 33 Column: 1

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

            

Reported by Pylint.