The following issues were found

src/third_party/scons-3.1.2/scons-local-3.1.2/SCons/Platform/aix.py
17 issues
Attempted relative import beyond top-level package
Error

Line: 38 Column: 1

              import os
import subprocess

from . import posix

import SCons.Util
import SCons.Action

def get_xlc(env, xlc=None, packages=[]):

            

Reported by Pylint.

Unused import os
Error

Line: 35 Column: 1

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

import os
import subprocess

from . import posix

import SCons.Util

            

Reported by Pylint.

Dangerous default value [] as argument
Error

Line: 43 Column: 1

              import SCons.Util
import SCons.Action

def get_xlc(env, xlc=None, packages=[]):
    # Use the AIX package installer tool lslpp to figure out where a
    # given xl* compiler is installed and what version it is.
    xlcPath = None
    xlcVersion = None


            

Reported by Pylint.

Access to a protected member _subproc of a client class
Error

Line: 55 Column: 16

                      xlc = xlc[0]
    for package in packages:
        # find the installed filename, which may be a symlink as well
        pipe = SCons.Action._subproc(env, ['lslpp', '-fc', package],
                stdin = 'devnull',
                stderr = 'devnull',
                stdout = subprocess.PIPE)
        # output of lslpp is something like this:
        #     #Path:Fileset:File

            

Reported by Pylint.

Unused variable 'sep'
Error

Line: 71 Column: 26

                          if ('/' in xlc and filename == xlc) \
            or ('/' not in xlc and filename.endswith('/' + xlc)):
                xlcVersion = fileset.split()[1]
                xlcPath, sep, xlc = filename.rpartition('/')
            pass
        pass
    return (xlcPath, xlc, xlcVersion)

def generate(env):

            

Reported by Pylint.

Unnecessary pass statement
Error

Line: 72 Column: 13

                          or ('/' not in xlc and filename.endswith('/' + xlc)):
                xlcVersion = fileset.split()[1]
                xlcPath, sep, xlc = filename.rpartition('/')
            pass
        pass
    return (xlcPath, xlc, xlcVersion)

def generate(env):
    posix.generate(env)

            

Reported by Pylint.

Unnecessary pass statement
Error

Line: 73 Column: 9

                              xlcVersion = fileset.split()[1]
                xlcPath, sep, xlc = filename.rpartition('/')
            pass
        pass
    return (xlcPath, xlc, xlcVersion)

def generate(env):
    posix.generate(env)
    #Based on AIX 5.2: ARG_MAX=24576 - 3000 for environment expansion

            

Reported by Pylint.

Line too long (118/100)
Error

Line: 33 Column: 1

              # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#

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

import os
import subprocess

from . import posix

            

Reported by Pylint.

Consider possible security implications associated with subprocess module.
Security blacklist

Line: 36
Suggestion: https://bandit.readthedocs.io/en/latest/blacklists/blacklist_imports.html#b404-import-subprocess

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

import os
import subprocess

from . import posix

import SCons.Util
import SCons.Action

            

Reported by Bandit.

third party import "import SCons.Util" should be placed before "from . import posix"
Error

Line: 40 Column: 1

              
from . import posix

import SCons.Util
import SCons.Action

def get_xlc(env, xlc=None, packages=[]):
    # Use the AIX package installer tool lslpp to figure out where a
    # given xl* compiler is installed and what version it is.

            

Reported by Pylint.

src/third_party/wiredtiger/examples/c/ex_col_store.c
17 issues
srand - This function is not sufficiently random for security-related functions such as key and nonce creation
Security

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

                  WEATHER w;
    int country, day;

    srand((unsigned int)getpid());

    for (int i = 0; i < NUM_ENTRIES; i++) {
        day = rand() % 7;
        switch (day) {
        case 0:

            

Reported by FlawFinder.

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

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

                  uint8_t humidity;
    uint8_t wind;
    uint8_t feels_like_temp;
    char day[5];
    char country[5];
} WEATHER;

/*! [col-store decl] */


            

Reported by FlawFinder.

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

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

                  uint8_t wind;
    uint8_t feels_like_temp;
    char day[5];
    char country[5];
} WEATHER;

/*! [col-store decl] */

static void update_celsius_to_fahrenheit(WT_SESSION *session);

            

Reported by FlawFinder.

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

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

                      day = rand() % 7;
        switch (day) {
        case 0:
            strcpy(w.day, "MON");
            break;
        case 1:
            strcpy(w.day, "TUE");
            break;
        case 2:

            

Reported by FlawFinder.

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

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

                          strcpy(w.day, "MON");
            break;
        case 1:
            strcpy(w.day, "TUE");
            break;
        case 2:
            strcpy(w.day, "WED");
            break;
        case 3:

            

Reported by FlawFinder.

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

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

                          strcpy(w.day, "TUE");
            break;
        case 2:
            strcpy(w.day, "WED");
            break;
        case 3:
            strcpy(w.day, "THU");
            break;
        case 4:

            

Reported by FlawFinder.

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

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

                          strcpy(w.day, "WED");
            break;
        case 3:
            strcpy(w.day, "THU");
            break;
        case 4:
            strcpy(w.day, "FRI");
            break;
        case 5:

            

Reported by FlawFinder.

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

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

                          strcpy(w.day, "THU");
            break;
        case 4:
            strcpy(w.day, "FRI");
            break;
        case 5:
            strcpy(w.day, "SAT");
            break;
        case 6:

            

Reported by FlawFinder.

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

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

                          strcpy(w.day, "FRI");
            break;
        case 5:
            strcpy(w.day, "SAT");
            break;
        case 6:
            strcpy(w.day, "SUN");
            break;
        default:

            

Reported by FlawFinder.

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

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

                          strcpy(w.day, "SAT");
            break;
        case 6:
            strcpy(w.day, "SUN");
            break;
        default:
            assert(false);
        }
        /* 24-hour-time 0-2400. */

            

Reported by FlawFinder.

src/third_party/boost/libs/regex/src/w32_regex_traits.cpp
17 issues
char - Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues
Security

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

                 //
   // fill in lower case map:
   //
   char char_map[1 << CHAR_BIT];
   for(int ii = 0; ii < (1 << CHAR_BIT); ++ii)
      char_map[ii] = static_cast<char>(ii);
#ifndef BOOST_NO_ANSI_APIS
   int r = ::LCMapStringA(this->m_locale, LCMAP_LOWERCASE, char_map, 1 << CHAR_BIT, this->m_lower_map, 1 << CHAR_BIT);
   BOOST_ASSERT(r != 0);

            

Reported by FlawFinder.

MultiByteToWideChar - Requires maximum length in CHARACTERS, not bytes
Security

Line: 131 Column: 19 CWE codes: 120

                 BOOST_ASSERT(code_page != 0);

   WCHAR wide_char_map[1 << CHAR_BIT];
   int conv_r = ::MultiByteToWideChar(code_page, 0,  char_map, 1 << CHAR_BIT,  wide_char_map, 1 << CHAR_BIT);
   BOOST_ASSERT(conv_r != 0);

   WCHAR wide_lower_map[1 << CHAR_BIT];
   int r = ::LCMapStringW(this->m_locale, LCMAP_LOWERCASE,  wide_char_map, 1 << CHAR_BIT,  wide_lower_map, 1 << CHAR_BIT);
   BOOST_ASSERT(r != 0);

            

Reported by FlawFinder.

MultiByteToWideChar - Requires maximum length in CHARACTERS, not bytes
Security

Line: 175 Column: 10 CWE codes: 120

                     return false;

   WCHAR wide_c;
   if (::MultiByteToWideChar(code_page, 0,  &c, 1,  &wide_c, 1) == 0)
       return false;

   WORD mask;
   if(::GetStringTypeExW(idx, CT_CTYPE1, &wide_c, 1, &mask) && (mask & C1_LOWER))
      return true;

            

Reported by FlawFinder.

MultiByteToWideChar - Requires maximum length in CHARACTERS, not bytes
Security

Line: 216 Column: 10 CWE codes: 120

                     return false;

   WCHAR wide_c;
   if (::MultiByteToWideChar(code_page, 0,  &c, 1,  &wide_c, 1) == 0)
       return false;

   WORD mask;
   if(::GetStringTypeExW(idx, CT_CTYPE1, &wide_c, 1, &mask) && (mask & C1_UPPER))
      return true;

            

Reported by FlawFinder.

MultiByteToWideChar - Requires maximum length in CHARACTERS, not bytes
Security

Line: 256 Column: 10 CWE codes: 120

                 return result;
#else
   LPWSTR wide_name = (LPWSTR)_alloca( (name.size() + 1) * sizeof(WCHAR) );
   if (::MultiByteToWideChar(CP_ACP, 0,  name.c_str(), name.size(),  wide_name, name.size() + 1) == 0)
       return cat_type();

   cat_type result(::LoadLibraryW(wide_name), &free_module);
   return result;
#endif

            

Reported by FlawFinder.

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

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

              BOOST_REGEX_DECL std::string BOOST_REGEX_CALL w32_cat_get(const cat_type& cat, lcid_type, int i, const std::string& def)
{
#ifndef BOOST_NO_ANSI_APIS
   char buf[256];
   if(0 == ::LoadStringA(
      static_cast<HMODULE>(cat.get()),
      i,
      buf,
      256

            

Reported by FlawFinder.

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

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

              #ifndef BOOST_NO_WREGEX
BOOST_REGEX_DECL std::wstring BOOST_REGEX_CALL w32_cat_get(const cat_type& cat, lcid_type, int i, const std::wstring& def)
{
   wchar_t buf[256];
   if(0 == ::LoadStringW(
      static_cast<HMODULE>(cat.get()),
      i,
      buf,
      256

            

Reported by FlawFinder.

MultiByteToWideChar - Requires maximum length in CHARACTERS, not bytes
Security

Line: 358 Column: 9 CWE codes: 120

              
   int src_len = static_cast<int>(p2 - p1);
   LPWSTR wide_p1 = (LPWSTR)_alloca( (src_len + 1) * 2 );
   if(::MultiByteToWideChar(code_page, 0,  p1, src_len,  wide_p1, src_len + 1) == 0)
      return std::string(p1, p2);

   int bytes = ::LCMapStringW(
      idx,       // locale identifier
      LCMAP_SORTKEY,  // mapping transformation type

            

Reported by FlawFinder.

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

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

              #endif
BOOST_REGEX_DECL char BOOST_REGEX_CALL w32_tolower(char c, lcid_type idx)
{
   char result[2];
#ifndef BOOST_NO_ANSI_APIS
   int b = ::LCMapStringA(
      idx,       // locale identifier
      LCMAP_LOWERCASE,  // mapping transformation type
      &c,  // source string

            

Reported by FlawFinder.

MultiByteToWideChar - Requires maximum length in CHARACTERS, not bytes
Security

Line: 477 Column: 10 CWE codes: 120

                    return c;

   WCHAR wide_c;
   if (::MultiByteToWideChar(code_page, 0,  &c, 1,  &wide_c, 1) == 0)
      return c;

   WCHAR wide_result;
   int b = ::LCMapStringW(
      idx,       // locale identifier

            

Reported by FlawFinder.

src/third_party/wiredtiger/test/suite/test_hs05.py
17 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 wiredtiger import stat
from wtdataset import SimpleDataSet
from wtscenario import make_scenarios

# test_hs05.py

            

Reported by Pylint.

Unable to import 'wiredtiger'
Error

Line: 31 Column: 1

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

# test_hs05.py
# Verify hs_score reflects cache pressure due to history

            

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 wiredtiger import stat
from wtdataset import SimpleDataSet
from wtscenario import make_scenarios


            

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 wiredtiger import stat
from wtdataset import SimpleDataSet
from wtscenario import make_scenarios

# test_hs05.py

            

Reported by Pylint.

Redefining name 'stat' from outer scope (line 31)
Error

Line: 52 Column: 24

                  ]
    scenarios = make_scenarios(key_format_values)

    def get_stat(self, stat):
        stat_cursor = self.session.open_cursor('statistics:')
        val = stat_cursor[stat][2]
        stat_cursor.close()
        return val


            

Reported by Pylint.

Missing module docstring
Error

Line: 1 Column: 1

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

            

Reported by Pylint.

Multiple imports on one line (wiredtiger, wttest)
Error

Line: 30 Column: 1

              # OTHER DEALINGS IN THE SOFTWARE.

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

# test_hs05.py

            

Reported by Pylint.

third party import "import wiredtiger, wttest" should be placed before "from helper import copy_wiredtiger_home"
Error

Line: 30 Column: 1

              # OTHER DEALINGS IN THE SOFTWARE.

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

# test_hs05.py

            

Reported by Pylint.

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

Line: 31 Column: 1

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

# test_hs05.py
# Verify hs_score reflects cache pressure due to history

            

Reported by Pylint.

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

Line: 38 Column: 1

              # test_hs05.py
# Verify hs_score reflects cache pressure due to history
# even if we're not yet actively pushing into the history store file.
class test_hs05(wttest.WiredTigerTestCase):
    # Force a small cache, but disable eviction of dirty pages until the cache is full.
    conn_config = 'cache_size=50MB,statistics=(fast),'
    conn_config += 'eviction_dirty_target=100,eviction_dirty_trigger=100,'
    conn_config += 'eviction_updates_target=100,eviction_updates_trigger=100'
    session_config = 'isolation=snapshot'

            

Reported by Pylint.

src/third_party/wiredtiger/examples/c/ex_backup.c
17 issues
system - This causes a new program to execute and is difficult to use safely
Security

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

                  else
        (void)snprintf(
          buf, sizeof(buf), "../../wt -R -h %s.%d dump logtest > %s.%d", home_full, i, full_out, i);
    error_check(system(buf));
    /*
     * Now run dump on the incremental directory.
     */
    (void)snprintf(
      buf, sizeof(buf), "../../wt -R -h %s.%d dump logtest > %s.%d", home_incr, i, incr_out, i);

            

Reported by FlawFinder.

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

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

                   */
    (void)snprintf(
      buf, sizeof(buf), "../../wt -R -h %s.%d dump logtest > %s.%d", home_incr, i, incr_out, i);
    error_check(system(buf));

    /*
     * Compare the files.
     */
    (void)snprintf(buf, sizeof(buf), "cmp %s.%d %s.%d", full_out, i, incr_out, i);

            

Reported by FlawFinder.

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

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

                   * Compare the files.
     */
    (void)snprintf(buf, sizeof(buf), "cmp %s.%d %s.%d", full_out, i, incr_out, i);
    ret = system(buf);
    if (i == 0)
        (void)snprintf(msg, sizeof(msg), "%s", "MAIN");
    else
        (void)snprintf(msg, sizeof(msg), "%d", i);
    printf("Iteration %s: Tables %s.%d and %s.%d %s\n", msg, full_out, i, incr_out, i,

            

Reported by FlawFinder.

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

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

                  if (i != 0) {
        (void)snprintf(buf, sizeof(buf), "rm -rf %s.%d %s.%d %s.%d %s.%d", home_full, i, home_incr,
          i, full_out, i, incr_out, i);
        error_check(system(buf));
    }
    return (ret);
}

/*

            

Reported by FlawFinder.

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

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

                       * original at the end.
         */
        (void)snprintf(buf, sizeof(buf), "rm -rf %s.%d && mkdir %s.%d", home_incr, i, home_incr, i);
        error_check(system(buf));
        if (i == 0)
            continue;
        /*
         * For full backups we need 1-N.
         */

            

Reported by FlawFinder.

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

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

                       * For full backups we need 1-N.
         */
        (void)snprintf(buf, sizeof(buf), "rm -rf %s.%d && mkdir %s.%d", home_full, i, home_full, i);
        error_check(system(buf));
    }
}

static void
add_work(WT_SESSION *session, int iter)

            

Reported by FlawFinder.

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

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

                          for (j = 0; j < MAX_ITERATIONS; j++) {
                (void)snprintf(h, sizeof(h), "%s.%d", home_incr, j);
                (void)snprintf(buf, sizeof(buf), "cp %s/%s %s/%s", home, filename, h, filename);
                error_check(system(buf));
            }
        else {
            (void)snprintf(h, sizeof(h), "%s.%d", home_full, i);
            (void)snprintf(buf, sizeof(buf), "cp %s/%s %s/%s", home, filename, hdir, filename);
            error_check(system(buf));

            

Reported by FlawFinder.

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

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

                      else {
            (void)snprintf(h, sizeof(h), "%s.%d", home_full, i);
            (void)snprintf(buf, sizeof(buf), "cp %s/%s %s/%s", home, filename, hdir, filename);
            error_check(system(buf));
        }
    }
    scan_end_check(ret == WT_NOTFOUND);
    error_check(cursor->close(cursor));
}

            

Reported by FlawFinder.

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

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

                       */
        (void)snprintf(h, sizeof(h), "%s.0", home_incr);
        (void)snprintf(buf, sizeof(buf), "cp %s/%s %s/%s", home, filename, h, filename);
        error_check(system(buf));
        for (j = i; j < MAX_ITERATIONS; j++) {
            (void)snprintf(h, sizeof(h), "%s.%d", home_incr, j);
            (void)snprintf(buf, sizeof(buf), "cp %s/%s %s/%s", home, filename, h, filename);
            error_check(system(buf));
        }

            

Reported by FlawFinder.

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

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

                      for (j = i; j < MAX_ITERATIONS; j++) {
            (void)snprintf(h, sizeof(h), "%s.%d", home_incr, j);
            (void)snprintf(buf, sizeof(buf), "cp %s/%s %s/%s", home, filename, h, filename);
            error_check(system(buf));
        }
    }
    scan_end_check(ret == WT_NOTFOUND);

    /*

            

Reported by FlawFinder.

src/third_party/wiredtiger/dist/dist.py
17 issues
Unused variable 'file_re'
Error

Line: 20 Column: 5

              # all_c_files --
#       Return list of all WiredTiger C source file names.
def all_c_files():
    file_re = re.compile(r'^\w')
    for line in glob.iglob('../src/*/*.c'):
        yield line
    for line in glob.iglob('../src/*/*_inline.h'):
        yield line
    files = list()

            

Reported by Pylint.

Unused variable 'dirnames'
Error

Line: 26 Column: 19

                  for line in glob.iglob('../src/*/*_inline.h'):
        yield line
    files = list()
    for (dirpath, dirnames, filenames) in os.walk('../test'):
        files += [os.path.join(dirpath, file) for file in filenames]
    for file in files:
        if fnmatch.fnmatch(file, '*.c'):
            yield file
        if fnmatch.fnmatch(file, '*_inline.h'):

            

Reported by Pylint.

Unused variable 'file_re'
Error

Line: 37 Column: 5

              # all_h_files --
#       Return list of all WiredTiger C include file names.
def all_h_files():
    file_re = re.compile(r'^\w')
    for line in glob.iglob('../src/*/*.h'):
        yield line
    yield "../src/include/wiredtiger.in"
    files = list()
    for (dirpath, dirnames, filenames) in os.walk('../test'):

            

Reported by Pylint.

Unused variable 'dirnames'
Error

Line: 42 Column: 19

                      yield line
    yield "../src/include/wiredtiger.in"
    files = list()
    for (dirpath, dirnames, filenames) in os.walk('../test'):
        files += [os.path.join(dirpath, file) for file in filenames]
    for file in files:
        if fnmatch.fnmatch(file, '*.h'):
            yield file


            

Reported by Pylint.

Missing module docstring
Error

Line: 1 Column: 1

              from __future__ import print_function
import filecmp, fnmatch, glob, os, re, shutil, subprocess

# source_files --
#    Return a list of the WiredTiger source file names.
def source_files():
    file_re = re.compile(r'^\w')
    for line in glob.iglob('../src/include/*.h'):
        yield line

            

Reported by Pylint.

Consider possible security implications associated with subprocess module.
Security blacklist

Line: 2
Suggestion: https://bandit.readthedocs.io/en/latest/blacklists/blacklist_imports.html#b404-import-subprocess

              from __future__ import print_function
import filecmp, fnmatch, glob, os, re, shutil, subprocess

# source_files --
#    Return a list of the WiredTiger source file names.
def source_files():
    file_re = re.compile(r'^\w')
    for line in glob.iglob('../src/include/*.h'):
        yield line

            

Reported by Bandit.

Multiple imports on one line (filecmp, fnmatch, glob, os, re, shutil, subprocess)
Error

Line: 2 Column: 1

              from __future__ import print_function
import filecmp, fnmatch, glob, os, re, shutil, subprocess

# source_files --
#    Return a list of the WiredTiger source file names.
def source_files():
    file_re = re.compile(r'^\w')
    for line in glob.iglob('../src/include/*.h'):
        yield line

            

Reported by Pylint.

Missing function or method docstring
Error

Line: 6 Column: 1

              
# source_files --
#    Return a list of the WiredTiger source file names.
def source_files():
    file_re = re.compile(r'^\w')
    for line in glob.iglob('../src/include/*.h'):
        yield line
    for line in open('filelist', 'r'):
        if file_re.match(line):

            

Reported by Pylint.

Missing function or method docstring
Error

Line: 19 Column: 1

              
# all_c_files --
#       Return list of all WiredTiger C source file names.
def all_c_files():
    file_re = re.compile(r'^\w')
    for line in glob.iglob('../src/*/*.c'):
        yield line
    for line in glob.iglob('../src/*/*_inline.h'):
        yield line

            

Reported by Pylint.

Missing function or method docstring
Error

Line: 36 Column: 1

              
# all_h_files --
#       Return list of all WiredTiger C include file names.
def all_h_files():
    file_re = re.compile(r'^\w')
    for line in glob.iglob('../src/*/*.h'):
        yield line
    yield "../src/include/wiredtiger.in"
    files = list()

            

Reported by Pylint.

src/third_party/wiredtiger/test/suite/test_prepare04.py
17 issues
Unable to import 'wiredtiger'
Error

Line: 35 Column: 1

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

def timestamp_str(t):
    return '%x' % t


            

Reported by Pylint.

Lambda may not be necessary
Error

Line: 110 Column: 68

                      c_other.set_key(1)
        if self.ignore == False and self.after_ts == True:
            # Make sure we get the expected prepare conflict message.
            self.assertRaisesException(wiredtiger.WiredTigerError, lambda:c_other.search(), preparemsg)
        else:
            c_other.search()
            self.assertTrue(c_other.get_value() == 1)

        c_other.set_value(3)

            

Reported by Pylint.

Lambda may not be necessary
Error

Line: 118 Column: 64

                      c_other.set_value(3)

        # Make sure we detect the conflict between operations.
        self.assertRaisesException(wiredtiger.WiredTigerError, lambda:c_other.update(), conflictmsg)
        s_other.rollback_transaction()

        self.session.timestamp_transaction('commit_timestamp=' + timestamp_str(300))
        self.session.timestamp_transaction('durable_timestamp=' + timestamp_str(300))
        self.session.commit_transaction()

            

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 suite_subprocess import suite_subprocess"
Error

Line: 35 Column: 1

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

def timestamp_str(t):
    return '%x' % t


            

Reported by Pylint.

Multiple imports on one line (wiredtiger, wttest)
Error

Line: 35 Column: 1

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

def timestamp_str(t):
    return '%x' % t


            

Reported by Pylint.

Missing function or method docstring
Error

Line: 38 Column: 1

              import wiredtiger, wttest
from wtscenario import make_scenarios

def timestamp_str(t):
    return '%x' % t

class test_prepare04(wttest.WiredTigerTestCase, suite_subprocess):
    tablename = 'test_prepare_cursor'
    uri = 'table:' + tablename

            

Reported by Pylint.

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

Line: 38 Column: 1

              import wiredtiger, wttest
from wtscenario import make_scenarios

def timestamp_str(t):
    return '%x' % t

class test_prepare04(wttest.WiredTigerTestCase, suite_subprocess):
    tablename = 'test_prepare_cursor'
    uri = 'table:' + tablename

            

Reported by Pylint.

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

Line: 41 Column: 1

              def timestamp_str(t):
    return '%x' % t

class test_prepare04(wttest.WiredTigerTestCase, suite_subprocess):
    tablename = 'test_prepare_cursor'
    uri = 'table:' + tablename
    session_config = 'isolation=snapshot'

    before_ts = timestamp_str(150)

            

Reported by Pylint.

Missing class docstring
Error

Line: 41 Column: 1

              def timestamp_str(t):
    return '%x' % t

class test_prepare04(wttest.WiredTigerTestCase, suite_subprocess):
    tablename = 'test_prepare_cursor'
    uri = 'table:' + tablename
    session_config = 'isolation=snapshot'

    before_ts = timestamp_str(150)

            

Reported by Pylint.

src/third_party/wiredtiger/test/suite/test_bug016.py
17 issues
Unable to import 'wiredtiger'
Error

Line: 29 Column: 1

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

import wiredtiger, wttest

# test_bug016.py
#       WT-2757: WT_CURSOR.get_key() fails after WT_CURSOR.insert unless the
# cursor has a record number key with append configured.
class test_bug016(wttest.WiredTigerTestCase):

            

Reported by Pylint.

Using deprecated method assertEquals()
Error

Line: 44 Column: 9

                      cursor = self.session.open_cursor(uri, None, 'append')
        cursor.set_value('value')
        cursor.insert()
        self.assertEquals(cursor.get_key(), 1)

    # Insert a row into a simple column-store table.
    # WT_CURSOR.get_key should fail.
    def test_simple_column_store(self):
        uri='file:bug016'

            

Reported by Pylint.

Lambda may not be necessary
Error

Line: 56 Column: 13

                      cursor.set_value('value')
        cursor.insert()
        self.assertRaisesWithMessage(wiredtiger.WiredTigerError,
            lambda: cursor.get_key(), "/requires key be set/")

    # Insert a row into a simple row-store table.
    # WT_CURSOR.get_key should fail.
    def test_simple_row_store(self):
        uri='file:bug016'

            

Reported by Pylint.

Lambda may not be necessary
Error

Line: 68 Column: 13

                      cursor.set_value('value')
        cursor.insert()
        self.assertRaisesWithMessage(wiredtiger.WiredTigerError,
            lambda: cursor.get_key(), "/requires key be set/")

    # Insert a row into a complex column-store table configured to append.
    # WT_CURSOR.get_key should succeed.
    def test_complex_column_store_append(self):
        uri='table:bug016'

            

Reported by Pylint.

Using deprecated method assertEquals()
Error

Line: 79 Column: 9

                      cursor = self.session.open_cursor(uri, None, 'append')
        cursor.set_value('value')
        cursor.insert()
        self.assertEquals(cursor.get_key(), 1)

    # Insert a row into a complex column-store table.
    # WT_CURSOR.get_key should fail.
    def test_complex_column_store(self):
        uri='table:bug016'

            

Reported by Pylint.

Lambda may not be necessary
Error

Line: 92 Column: 13

                      cursor.set_value('value')
        cursor.insert()
        self.assertRaisesWithMessage(wiredtiger.WiredTigerError,
            lambda: cursor.get_key(), "/requires key be set/")

    # Insert a row into a complex row-store table.
    # WT_CURSOR.get_key should fail.
    def test_complex_row_store(self):
        uri='table:bug016'

            

Reported by Pylint.

Lambda may not be necessary
Error

Line: 105 Column: 13

                      cursor.set_value('value')
        cursor.insert()
        self.assertRaisesWithMessage(wiredtiger.WiredTigerError,
            lambda: cursor.get_key(), "/requires key be set/")

if __name__ == '__main__':
    wttest.run()

            

Reported by Pylint.

Missing module docstring
Error

Line: 1 Column: 1

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

            

Reported by Pylint.

Multiple imports on one line (wiredtiger, wttest)
Error

Line: 29 Column: 1

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

import wiredtiger, wttest

# test_bug016.py
#       WT-2757: WT_CURSOR.get_key() fails after WT_CURSOR.insert unless the
# cursor has a record number key with append configured.
class test_bug016(wttest.WiredTigerTestCase):

            

Reported by Pylint.

Missing class docstring
Error

Line: 34 Column: 1

              # test_bug016.py
#       WT-2757: WT_CURSOR.get_key() fails after WT_CURSOR.insert unless the
# cursor has a record number key with append configured.
class test_bug016(wttest.WiredTigerTestCase):

    # Insert a row into a simple column-store table configured to append.
    # WT_CURSOR.get_key should succeed.
    def test_simple_column_store_append(self):
        uri='file:bug016'

            

Reported by Pylint.

src/third_party/wiredtiger/test/suite/test_timestamp09.py
17 issues
Unable to import 'wiredtiger'
Error

Line: 34 Column: 1

              #

from suite_subprocess import suite_subprocess
import wiredtiger, wttest

class test_timestamp09(wttest.WiredTigerTestCase, suite_subprocess):
    tablename = 'test_timestamp09'
    uri = 'table:' + tablename
    session_config = 'isolation=snapshot'

            

Reported by Pylint.

Anomalous backslash in string: '\('. String constant might be missing an r prefix.
Error

Line: 105 Column: 36

                      self.assertRaisesWithMessage(wiredtiger.WiredTigerError,
            lambda: self.conn.set_timestamp('oldest_timestamp=' +
                self.timestamp_str(3) + ',stable_timestamp=' + self.timestamp_str(1)),
                '/oldest timestamp \(0, 3\) must not be later than stable timestamp \(0, 1\)/')

        # Oldest timestamp is 3 at the moment, trying to set it to an earlier
        # timestamp is a no-op.
        self.conn.set_timestamp('oldest_timestamp=' + self.timestamp_str(1))
        self.assertTimestampsEqual(self.conn.query_timestamp('get=oldest'), self.timestamp_str(3))

            

Reported by Pylint.

Anomalous backslash in string: '\)'. String constant might be missing an r prefix.
Error

Line: 105 Column: 91

                      self.assertRaisesWithMessage(wiredtiger.WiredTigerError,
            lambda: self.conn.set_timestamp('oldest_timestamp=' +
                self.timestamp_str(3) + ',stable_timestamp=' + self.timestamp_str(1)),
                '/oldest timestamp \(0, 3\) must not be later than stable timestamp \(0, 1\)/')

        # Oldest timestamp is 3 at the moment, trying to set it to an earlier
        # timestamp is a no-op.
        self.conn.set_timestamp('oldest_timestamp=' + self.timestamp_str(1))
        self.assertTimestampsEqual(self.conn.query_timestamp('get=oldest'), self.timestamp_str(3))

            

Reported by Pylint.

Anomalous backslash in string: '\('. String constant might be missing an r prefix.
Error

Line: 105 Column: 85

                      self.assertRaisesWithMessage(wiredtiger.WiredTigerError,
            lambda: self.conn.set_timestamp('oldest_timestamp=' +
                self.timestamp_str(3) + ',stable_timestamp=' + self.timestamp_str(1)),
                '/oldest timestamp \(0, 3\) must not be later than stable timestamp \(0, 1\)/')

        # Oldest timestamp is 3 at the moment, trying to set it to an earlier
        # timestamp is a no-op.
        self.conn.set_timestamp('oldest_timestamp=' + self.timestamp_str(1))
        self.assertTimestampsEqual(self.conn.query_timestamp('get=oldest'), self.timestamp_str(3))

            

Reported by Pylint.

Anomalous backslash in string: '\)'. String constant might be missing an r prefix.
Error

Line: 105 Column: 42

                      self.assertRaisesWithMessage(wiredtiger.WiredTigerError,
            lambda: self.conn.set_timestamp('oldest_timestamp=' +
                self.timestamp_str(3) + ',stable_timestamp=' + self.timestamp_str(1)),
                '/oldest timestamp \(0, 3\) must not be later than stable timestamp \(0, 1\)/')

        # Oldest timestamp is 3 at the moment, trying to set it to an earlier
        # timestamp is a no-op.
        self.conn.set_timestamp('oldest_timestamp=' + self.timestamp_str(1))
        self.assertTimestampsEqual(self.conn.query_timestamp('get=oldest'), self.timestamp_str(3))

            

Reported by Pylint.

Anomalous backslash in string: '\('. String constant might be missing an r prefix.
Error

Line: 124 Column: 85

                      self.assertRaisesWithMessage(wiredtiger.WiredTigerError,
            lambda: self.conn.set_timestamp('oldest_timestamp=' +
                self.timestamp_str(6)),
                '/oldest timestamp \(0, 6\) must not be later than stable timestamp \(0, 5\)/')

        # Commit timestamp >= Stable timestamp.
        # Check both timestamp_transaction and commit_transaction APIs.
        # Oldest and stable timestamp are set to 5 at the moment.
        self.conn.set_timestamp('stable_timestamp=' + self.timestamp_str(6))

            

Reported by Pylint.

Anomalous backslash in string: '\('. String constant might be missing an r prefix.
Error

Line: 124 Column: 36

                      self.assertRaisesWithMessage(wiredtiger.WiredTigerError,
            lambda: self.conn.set_timestamp('oldest_timestamp=' +
                self.timestamp_str(6)),
                '/oldest timestamp \(0, 6\) must not be later than stable timestamp \(0, 5\)/')

        # Commit timestamp >= Stable timestamp.
        # Check both timestamp_transaction and commit_transaction APIs.
        # Oldest and stable timestamp are set to 5 at the moment.
        self.conn.set_timestamp('stable_timestamp=' + self.timestamp_str(6))

            

Reported by Pylint.

Anomalous backslash in string: '\)'. String constant might be missing an r prefix.
Error

Line: 124 Column: 42

                      self.assertRaisesWithMessage(wiredtiger.WiredTigerError,
            lambda: self.conn.set_timestamp('oldest_timestamp=' +
                self.timestamp_str(6)),
                '/oldest timestamp \(0, 6\) must not be later than stable timestamp \(0, 5\)/')

        # Commit timestamp >= Stable timestamp.
        # Check both timestamp_transaction and commit_transaction APIs.
        # Oldest and stable timestamp are set to 5 at the moment.
        self.conn.set_timestamp('stable_timestamp=' + self.timestamp_str(6))

            

Reported by Pylint.

Anomalous backslash in string: '\)'. String constant might be missing an r prefix.
Error

Line: 124 Column: 91

                      self.assertRaisesWithMessage(wiredtiger.WiredTigerError,
            lambda: self.conn.set_timestamp('oldest_timestamp=' +
                self.timestamp_str(6)),
                '/oldest timestamp \(0, 6\) must not be later than stable timestamp \(0, 5\)/')

        # Commit timestamp >= Stable timestamp.
        # Check both timestamp_transaction and commit_transaction APIs.
        # Oldest and stable timestamp are set to 5 at the moment.
        self.conn.set_timestamp('stable_timestamp=' + self.timestamp_str(6))

            

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_reconfig02.py
17 issues
Unable to import 'wiredtiger'
Error

Line: 34 Column: 1

              # [END_TAGS]

import fnmatch, os, time
import wiredtiger, wttest

# test_reconfig02.py
#    Smoke-test the connection reconfiguration operations.
class test_reconfig02(wttest.WiredTigerTestCase):
    init_config = 'log=(archive=false,enabled,file_max=100K,prealloc=false,zero_fill=false)'

            

Reported by Pylint.

Redefining built-in 'dir'
Error

Line: 43 Column: 35

                  uri = "table:reconfig02"
    entries = 1000

    def setUpConnectionOpen(self, dir):
        self.conn_config = self.init_config
        return wttest.WiredTigerTestCase.setUpConnectionOpen(self, dir)

    # Logging: reconfigure the things we can reconfigure.
    def test_reconfig02_simple(self):

            

Reported by Pylint.

Parameters differ from overridden 'setUpConnectionOpen' method
Error

Line: 43 Column: 5

                  uri = "table:reconfig02"
    entries = 1000

    def setUpConnectionOpen(self, dir):
        self.conn_config = self.init_config
        return wttest.WiredTigerTestCase.setUpConnectionOpen(self, dir)

    # Logging: reconfigure the things we can reconfigure.
    def test_reconfig02_simple(self):

            

Reported by Pylint.

Unused variable 'x'
Error

Line: 88 Column: 13

                      #
        # Potentially loop a few times in case it is a very slow system.
        self.conn.reconfigure("log=(prealloc=true)")
        for x in range(0, 100):
            time.sleep(1)
            prep_logs = fnmatch.filter(os.listdir('.'), "*Prep*")
            if len(prep_logs) != 0:
                break


            

Reported by Pylint.

Missing module docstring
Error

Line: 1 Column: 1

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

            

Reported by Pylint.

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

Line: 33 Column: 1

              # connection_api:reconfigure
# [END_TAGS]

import fnmatch, os, time
import wiredtiger, wttest

# test_reconfig02.py
#    Smoke-test the connection reconfiguration operations.
class test_reconfig02(wttest.WiredTigerTestCase):

            

Reported by Pylint.

Multiple imports on one line (wiredtiger, wttest)
Error

Line: 34 Column: 1

              # [END_TAGS]

import fnmatch, os, time
import wiredtiger, wttest

# test_reconfig02.py
#    Smoke-test the connection reconfiguration operations.
class test_reconfig02(wttest.WiredTigerTestCase):
    init_config = 'log=(archive=false,enabled,file_max=100K,prealloc=false,zero_fill=false)'

            

Reported by Pylint.

Missing class docstring
Error

Line: 38 Column: 1

              
# test_reconfig02.py
#    Smoke-test the connection reconfiguration operations.
class test_reconfig02(wttest.WiredTigerTestCase):
    init_config = 'log=(archive=false,enabled,file_max=100K,prealloc=false,zero_fill=false)'
    uri = "table:reconfig02"
    entries = 1000

    def setUpConnectionOpen(self, dir):

            

Reported by Pylint.

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

Line: 38 Column: 1

              
# test_reconfig02.py
#    Smoke-test the connection reconfiguration operations.
class test_reconfig02(wttest.WiredTigerTestCase):
    init_config = 'log=(archive=false,enabled,file_max=100K,prealloc=false,zero_fill=false)'
    uri = "table:reconfig02"
    entries = 1000

    def setUpConnectionOpen(self, dir):

            

Reported by Pylint.

Missing function or method docstring
Error

Line: 48 Column: 5

                      return wttest.WiredTigerTestCase.setUpConnectionOpen(self, dir)

    # Logging: reconfigure the things we can reconfigure.
    def test_reconfig02_simple(self):
        self.conn.reconfigure("log=(archive=false)")
        self.conn.reconfigure("log=(prealloc=false)")
        self.conn.reconfigure("log=(zero_fill=false)")

        self.conn.reconfigure("log=(archive=true)")

            

Reported by Pylint.