The following issues were found

src/third_party/wiredtiger/src/utilities/util_dump.c
12 issues
Uninitialized variable: tret
Error

Line: 289 CWE codes: 908

                      ret = util_err(session, ret, "%s", uri);

    if ((tret = mcursor->close(mcursor)) != 0) {
        tret = util_cerr(mcursor, "close", tret);
        if (ret == 0)
            ret = tret;
    }

    return (ret);

            

Reported by Cppcheck.

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

Line: 351 Column: 33 CWE codes: 134
Suggestion: Use a constant for the format specification

               */
static int
dump_add_config(WT_SESSION *session, char **bufp, size_t *leftp, const char *fmt, ...)
  WT_GCC_FUNC_ATTRIBUTE((format(printf, 4, 5)))
{
    WT_DECL_RET;
    size_t n;
    va_list ap;


            

Reported by FlawFinder.

fopen - Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents?
Security

Line: 129 Column: 20 CWE codes: 362

                  /* Open any optional output file. */
    if (ofile == NULL)
        fp = stdout;
    else if ((fp = fopen(ofile, "w")) == NULL)
        return (util_err(session, errno, "%s: open", ofile));

    if (json && (dump_json_begin(session) != 0 || dump_prefix(session, pretty, hex, json) != 0))
        goto err;


            

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: 383 Column: 59 CWE codes: 126

                  char *newconfig;
    const char *keyformat, *p;

    len = strlen(config) + strlen(cursor->value_format) + strlen(cursor->uri) + 20;
    if ((newconfig = malloc(len)) == NULL)
        return (util_err(session, errno, NULL));
    *newconfigp = newconfig;
    wt_api = session->connection->get_extension_api(session->connection);
    if ((ret = wt_api->config_parser_open(wt_api, session, config, strlen(config), &parser)) != 0)

            

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: 383 Column: 11 CWE codes: 126

                  char *newconfig;
    const char *keyformat, *p;

    len = strlen(config) + strlen(cursor->value_format) + strlen(cursor->uri) + 20;
    if ((newconfig = malloc(len)) == NULL)
        return (util_err(session, errno, NULL));
    *newconfigp = newconfig;
    wt_api = session->connection->get_extension_api(session->connection);
    if ((ret = wt_api->config_parser_open(wt_api, session, config, strlen(config), &parser)) != 0)

            

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: 383 Column: 28 CWE codes: 126

                  char *newconfig;
    const char *keyformat, *p;

    len = strlen(config) + strlen(cursor->value_format) + strlen(cursor->uri) + 20;
    if ((newconfig = malloc(len)) == NULL)
        return (util_err(session, errno, NULL));
    *newconfigp = newconfig;
    wt_api = session->connection->get_extension_api(session->connection);
    if ((ret = wt_api->config_parser_open(wt_api, session, config, strlen(config), &parser)) != 0)

            

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: 388 Column: 68 CWE codes: 126

                      return (util_err(session, errno, NULL));
    *newconfigp = newconfig;
    wt_api = session->connection->get_extension_api(session->connection);
    if ((ret = wt_api->config_parser_open(wt_api, session, config, strlen(config), &parser)) != 0)
        return (util_err(session, ret, "WT_EXTENSION_API.config_parser_open"));
    keyformat = cursor->key_format;
    for (nkeys = 0; *keyformat; keyformat++)
        if (!__wt_isdigit((u_char)*keyformat))
            nkeys++;

            

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: 418 Column: 22 CWE codes: 126

                          /* copy names of projected values */
            p = strchr(cursor->uri, '(');
            assert(p != NULL);
            assert(p[strlen(p) - 1] == ')');
            p++;
            if (*p != ')')
                WT_RET(dump_add_config(session, &newconfig, &len, "%s", ","));
            WT_RET(dump_add_config(session, &newconfig, &len, "%.*s),", (int)(strlen(p) - 1), p));
        } else if (value.type == WT_CONFIG_ITEM_STRING && value.len != 0)

            

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: 422 Column: 79 CWE codes: 126

                          p++;
            if (*p != ')')
                WT_RET(dump_add_config(session, &newconfig, &len, "%s", ","));
            WT_RET(dump_add_config(session, &newconfig, &len, "%.*s),", (int)(strlen(p) - 1), p));
        } else if (value.type == WT_CONFIG_ITEM_STRING && value.len != 0)
            WT_RET(
              dump_add_config(session, &newconfig, &len, "\"%.*s\",", (int)value.len, value.str));
        else
            WT_RET(dump_add_config(session, &newconfig, &len, "%.*s,", (int)value.len, value.str));

            

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: 514 Column: 27 CWE codes: 126

                          return (util_err(session, EIO, NULL));
    }

    len = strlen(entry) + strlen(name) + 1;
    if ((uriprefix = malloc(len)) == NULL)
        return (util_err(session, errno, NULL));
    if ((ret = __wt_snprintf(uriprefix, len, "%s%s", entry, name)) != 0) {
        free(uriprefix);
        return (util_err(session, ret, NULL));

            

Reported by FlawFinder.

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

Line: 65 Column: 5

              
    env.AppendUnique(LATEXSUFFIXES=SCons.Tool.LaTeXSuffixes)

    from . import pdf
    pdf.generate(env)

    bld = env['BUILDERS']['PDF']
    bld.add_action('.ltx', PDFLaTeXAuxAction)
    bld.add_action('.latex', PDFLaTeXAuxAction)

            

Reported by Pylint.

Using the global statement
Error

Line: 54 Column: 5

              
def generate(env):
    """Add Builders and construction variables for pdflatex to an Environment."""
    global PDFLaTeXAction
    if PDFLaTeXAction is None:
        PDFLaTeXAction = SCons.Action.Action('$PDFLATEXCOM', '$PDFLATEXCOMSTR')

    global PDFLaTeXAuxAction
    if PDFLaTeXAuxAction is None:

            

Reported by Pylint.

Using the global statement
Error

Line: 58 Column: 5

                  if PDFLaTeXAction is None:
        PDFLaTeXAction = SCons.Action.Action('$PDFLATEXCOM', '$PDFLATEXCOMSTR')

    global PDFLaTeXAuxAction
    if PDFLaTeXAuxAction is None:
        PDFLaTeXAuxAction = SCons.Action.Action(PDFLaTeXAuxFunction,
                              strfunction=SCons.Tool.tex.TeXLaTeXStrFunction)

    env.AppendUnique(LATEXSUFFIXES=SCons.Tool.LaTeXSuffixes)

            

Reported by Pylint.

Line too long (119/100)
Error

Line: 35 Column: 1

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

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

import SCons.Action
import SCons.Util
import SCons.Tool.pdf
import SCons.Tool.tex

            

Reported by Pylint.

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

Line: 42 Column: 1

              import SCons.Tool.pdf
import SCons.Tool.tex

PDFLaTeXAction = None

def PDFLaTeXAuxFunction(target = None, source= None, env=None):
    result = SCons.Tool.tex.InternalLaTeXAuxAction( PDFLaTeXAction, target, source, env )
    if result != 0:
        SCons.Tool.tex.check_file_error_message(env['PDFLATEX'])

            

Reported by Pylint.

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

Line: 44 Column: 1

              
PDFLaTeXAction = None

def PDFLaTeXAuxFunction(target = None, source= None, env=None):
    result = SCons.Tool.tex.InternalLaTeXAuxAction( PDFLaTeXAction, target, source, env )
    if result != 0:
        SCons.Tool.tex.check_file_error_message(env['PDFLATEX'])
    return result


            

Reported by Pylint.

Missing function or method docstring
Error

Line: 44 Column: 1

              
PDFLaTeXAction = None

def PDFLaTeXAuxFunction(target = None, source= None, env=None):
    result = SCons.Tool.tex.InternalLaTeXAuxAction( PDFLaTeXAction, target, source, env )
    if result != 0:
        SCons.Tool.tex.check_file_error_message(env['PDFLATEX'])
    return result


            

Reported by Pylint.

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

Line: 50 Column: 1

                      SCons.Tool.tex.check_file_error_message(env['PDFLATEX'])
    return result

PDFLaTeXAuxAction = None

def generate(env):
    """Add Builders and construction variables for pdflatex to an Environment."""
    global PDFLaTeXAction
    if PDFLaTeXAction is None:

            

Reported by Pylint.

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

Line: 54 Column: 5

              
def generate(env):
    """Add Builders and construction variables for pdflatex to an Environment."""
    global PDFLaTeXAction
    if PDFLaTeXAction is None:
        PDFLaTeXAction = SCons.Action.Action('$PDFLATEXCOM', '$PDFLATEXCOMSTR')

    global PDFLaTeXAuxAction
    if PDFLaTeXAuxAction is None:

            

Reported by Pylint.

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

Line: 58 Column: 5

                  if PDFLaTeXAction is None:
        PDFLaTeXAction = SCons.Action.Action('$PDFLATEXCOM', '$PDFLATEXCOMSTR')

    global PDFLaTeXAuxAction
    if PDFLaTeXAuxAction is None:
        PDFLaTeXAuxAction = SCons.Action.Action(PDFLaTeXAuxFunction,
                              strfunction=SCons.Tool.tex.TeXLaTeXStrFunction)

    env.AppendUnique(LATEXSUFFIXES=SCons.Tool.LaTeXSuffixes)

            

Reported by Pylint.

src/third_party/wiredtiger/src/support/timestamp.c
12 issues
char - Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues
Security

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

              __wt_time_point_to_string(
  wt_timestamp_t ts, wt_timestamp_t durable_ts, uint64_t txn_id, char *tp_string)
{
    char ts_string[WT_TS_INT_STRING_SIZE];

    WT_IGNORE_RET(__wt_snprintf(tp_string, WT_TP_STRING_SIZE, "%s/%s/%" PRIu64,
      __wt_timestamp_to_string(ts, ts_string), __wt_timestamp_to_string(durable_ts, ts_string),
      txn_id));
    return (tp_string);

            

Reported by FlawFinder.

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

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

              char *
__wt_time_window_to_string(WT_TIME_WINDOW *tw, char *tw_string)
{
    char ts_string[4][WT_TS_INT_STRING_SIZE];

    WT_IGNORE_RET(__wt_snprintf(tw_string, WT_TIME_STRING_SIZE,
      "start: %s/%s/%" PRIu64 " stop: %s/%s/%" PRIu64 "%s",
      __wt_timestamp_to_string(tw->durable_start_ts, ts_string[0]),
      __wt_timestamp_to_string(tw->start_ts, ts_string[1]), tw->start_txn,

            

Reported by FlawFinder.

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

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

              char *
__wt_time_aggregate_to_string(WT_TIME_AGGREGATE *ta, char *ta_string)
{
    char ts_string[4][WT_TS_INT_STRING_SIZE];

    WT_IGNORE_RET(__wt_snprintf(ta_string, WT_TIME_STRING_SIZE,
      "newest durable: %s/%s oldest start: %s/%" PRIu64 " newest stop %s/%" PRIu64 "%s",
      __wt_timestamp_to_string(ta->newest_start_durable_ts, ts_string[0]),
      __wt_timestamp_to_string(ta->newest_stop_durable_ts, ts_string[1]),

            

Reported by FlawFinder.

memcpy - Does not check for buffer overflows when copying to destination
Security

Line: 93 Column: 15 CWE codes: 120
Suggestion: Make sure destination can always hold the source data

                  }
    if (ts == WT_TS_MAX) {
#define WT_TS_MAX_HEX_STRING "ffffffffffffffff"
        (void)memcpy(hex_timestamp, WT_TS_MAX_HEX_STRING, strlen(WT_TS_MAX_HEX_STRING) + 1);
        return;
    }

    for (p = hex_timestamp; ts != 0; ts >>= 4)
        *p++ = (char)__wt_hex((u_char)(ts & 0x0f));

            

Reported by FlawFinder.

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

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

              void
__wt_verbose_timestamp(WT_SESSION_IMPL *session, wt_timestamp_t ts, const char *msg)
{
    char ts_string[WT_TS_INT_STRING_SIZE];

    __wt_verbose(
      session, WT_VERB_TIMESTAMP, "Timestamp %s: %s", __wt_timestamp_to_string(ts, ts_string), msg);
}


            

Reported by FlawFinder.

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

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

                WT_SESSION_IMPL *session, WT_TIME_AGGREGATE *ta, bool silent)
{
    wt_timestamp_t stable;
    char time_string[WT_TIME_STRING_SIZE], ts_string[WT_TS_INT_STRING_SIZE];

    stable = __time_stable(session);

    if (ta->newest_start_durable_ts > stable)
        WT_TIME_ERROR("a newest start durable time after");

            

Reported by FlawFinder.

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

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

              __time_aggregate_validate_parent(
  WT_SESSION_IMPL *session, WT_TIME_AGGREGATE *ta, WT_TIME_AGGREGATE *parent, bool silent)
{
    char time_string[2][WT_TIME_STRING_SIZE];

    if (ta->newest_start_durable_ts > parent->newest_start_durable_ts)
        WT_TIME_VALIDATE_RET(session,
          "aggregate time window has a newest start durable time after its parent's; time "
          "aggregate %s, parent %s",

            

Reported by FlawFinder.

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

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

              __wt_time_aggregate_validate(
  WT_SESSION_IMPL *session, WT_TIME_AGGREGATE *ta, WT_TIME_AGGREGATE *parent, bool silent)
{
    char time_string[2][WT_TIME_STRING_SIZE];

    if (ta->oldest_start_ts > ta->newest_stop_ts)
        WT_TIME_VALIDATE_RET(session,
          "aggregate time window has an oldest start time after its newest stop time; time "
          "aggregate %s",

            

Reported by FlawFinder.

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

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

              __time_value_validate_parent_stable(WT_SESSION_IMPL *session, WT_TIME_WINDOW *tw, bool silent)
{
    wt_timestamp_t stable;
    char time_string[WT_TIME_STRING_SIZE], ts_string[WT_TS_INT_STRING_SIZE];

    stable = __time_stable(session);

    if (tw->durable_start_ts > stable)
        WT_TIME_ERROR("a durable start time after");

            

Reported by FlawFinder.

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

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

              __time_value_validate_parent(
  WT_SESSION_IMPL *session, WT_TIME_WINDOW *tw, WT_TIME_AGGREGATE *parent, bool silent)
{
    char time_string[2][WT_TIME_STRING_SIZE];

    if (parent->newest_start_durable_ts != WT_TS_NONE &&
      tw->durable_start_ts > parent->newest_start_durable_ts)
        WT_TIME_VALIDATE_RET(session,
          "value time window has a durable start time after its parent's newest durable start "

            

Reported by FlawFinder.

src/third_party/wiredtiger/src/support/err.c
12 issues
vfprintf - If format strings can be influenced by an attacker, they can be exploited
Security

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

                      if (fprintf(stderr, "WiredTiger Error%s%s: ", error == 0 ? "" : ": ",
              error == 0 ? "" : __wt_strerror(session, error, NULL, 0)) < 0)
            WT_TRET(EIO);
        if (vfprintf(stderr, fmt, ap) < 0)
            WT_TRET(EIO);
        if (fprintf(stderr, "\n") < 0)
            WT_TRET(EIO);
        if (fflush(stderr) != 0)
            WT_TRET(EIO);

            

Reported by FlawFinder.

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

Line: 299 Column: 63 CWE codes: 134
Suggestion: Use a constant for the format specification

               */
void
__wt_err_func(WT_SESSION_IMPL *session, int error, const char *func, int line, const char *fmt, ...)
  WT_GCC_FUNC_ATTRIBUTE((cold)) WT_GCC_FUNC_ATTRIBUTE((format(printf, 5, 6)))
    WT_GCC_FUNC_ATTRIBUTE((visibility("default")))
{
    va_list ap;

    /*

            

Reported by FlawFinder.

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

Line: 319 Column: 63 CWE codes: 134
Suggestion: Use a constant for the format specification

               */
void
__wt_errx_func(WT_SESSION_IMPL *session, const char *func, int line, const char *fmt, ...)
  WT_GCC_FUNC_ATTRIBUTE((cold)) WT_GCC_FUNC_ATTRIBUTE((format(printf, 4, 5)))
    WT_GCC_FUNC_ATTRIBUTE((visibility("default")))
{
    va_list ap;

    /*

            

Reported by FlawFinder.

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

Line: 339 Column: 68 CWE codes: 134
Suggestion: Use a constant for the format specification

               */
int
__wt_panic_func(WT_SESSION_IMPL *session, int error, const char *func, int line, const char *fmt,
  ...) WT_GCC_FUNC_ATTRIBUTE((cold)) WT_GCC_FUNC_ATTRIBUTE((format(printf, 5, 6)))
  WT_GCC_FUNC_ATTRIBUTE((visibility("default")))
{
    WT_CONNECTION_IMPL *conn;
    va_list ap;


            

Reported by FlawFinder.

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

Line: 424 Column: 33 CWE codes: 134
Suggestion: Use a constant for the format specification

               */
int
__wt_ext_err_printf(WT_EXTENSION_API *wt_api, WT_SESSION *wt_session, const char *fmt, ...)
  WT_GCC_FUNC_ATTRIBUTE((format(printf, 3, 4)))
{
    WT_DECL_RET;
    WT_SESSION_IMPL *session;
    va_list ap;


            

Reported by FlawFinder.

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

Line: 445 Column: 33 CWE codes: 134
Suggestion: Use a constant for the format specification

               */
void
__wt_verbose_worker(WT_SESSION_IMPL *session, const char *fmt, ...)
  WT_GCC_FUNC_ATTRIBUTE((format(printf, 2, 3))) WT_GCC_FUNC_ATTRIBUTE((cold))
{
    va_list ap;

    va_start(ap, fmt);
    WT_IGNORE_RET(__eventv(session, true, 0, NULL, 0, fmt, ap));

            

Reported by FlawFinder.

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

Line: 460 Column: 33 CWE codes: 134
Suggestion: Use a constant for the format specification

               */
int
__wt_msg(WT_SESSION_IMPL *session, const char *fmt, ...) WT_GCC_FUNC_ATTRIBUTE((cold))
  WT_GCC_FUNC_ATTRIBUTE((format(printf, 2, 3)))
{
    WT_DECL_ITEM(buf);
    WT_DECL_RET;
    WT_EVENT_HANDLER *handler;
    WT_SESSION *wt_session;

            

Reported by FlawFinder.

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

Line: 486 Column: 33 CWE codes: 134
Suggestion: Use a constant for the format specification

               */
int
__wt_ext_msg_printf(WT_EXTENSION_API *wt_api, WT_SESSION *wt_session, const char *fmt, ...)
  WT_GCC_FUNC_ATTRIBUTE((format(printf, 3, 4)))
{
    WT_DECL_ITEM(buf);
    WT_DECL_RET;
    WT_EVENT_HANDLER *handler;
    WT_SESSION_IMPL *session;

            

Reported by FlawFinder.

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

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

                   * SECURITY:
     * Buffer placed at the end of the stack in case snprintf overflows.
     */
    char s[256];

    if (__wt_snprintf(s, sizeof(s), "application %s event handler failed: %s", which,
          __wt_strerror(session, error, NULL, 0)) != 0)
        return;


            

Reported by FlawFinder.

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

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

                  WT_EVENT_HANDLER *handler;
    WT_SESSION *wt_session;
    size_t len, remain;
    char *p, tid[128];
    const char *err, *prefix;

    /*
     * We're using a stack buffer because we want error messages no matter
     * what, and allocating a WT_ITEM, or the memory it needs, might fail.

            

Reported by FlawFinder.

src/third_party/wiredtiger/test/suite/test_bug011.py
12 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 random, wiredtiger, wttest
from wtdataset import SimpleDataSet

# test_bug011.py
#    Eviction working on more trees than the eviction server can walk
#    simultaneously.  There is a builtin limit of 1000 trees, we open double

            

Reported by Pylint.

An attribute defined in wttest line 401 hides this method
Error

Line: 46 Column: 5

                  nrows = 10000
    nops = 10000
    # Add connection configuration for this test.
    def conn_config(self):
        return 'cache_size=1GB'

    @wttest.longtest("Eviction copes with lots of files")
    def test_eviction(self):
        cursors = []

            

Reported by Pylint.

Unused 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 random, wiredtiger, wttest
from wtdataset import SimpleDataSet

# test_bug011.py
#    Eviction working on more trees than the eviction server can walk
#    simultaneously.  There is a builtin limit of 1000 trees, we open double

            

Reported by Pylint.

Redefining name 'i' from outer scope (line 69)
Error

Line: 70 Column: 13

              
        # Make use of the cache.
        for i in range(0, self.nops):
            for i in range(0, self.ntables):
                cursors[i].set_key(ds.key(random.randint(0, self.nrows - 1)))
                cursors[i].search()
                cursors[i].reset()

if __name__ == '__main__':

            

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 (random, 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 random, wiredtiger, wttest
from wtdataset import SimpleDataSet

# test_bug011.py
#    Eviction working on more trees than the eviction server can walk
#    simultaneously.  There is a builtin limit of 1000 trees, we open double

            

Reported by Pylint.

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

Line: 36 Column: 1

              #    Eviction working on more trees than the eviction server can walk
#    simultaneously.  There is a builtin limit of 1000 trees, we open double
#    that, which makes this a long-running test.
class test_bug011(wttest.WiredTigerTestCase):
    """
    Test having eviction working on more files than the number of
    allocated hazard pointers.
    """
    table_name = 'test_bug011'

            

Reported by Pylint.

Missing function or method docstring
Error

Line: 46 Column: 5

                  nrows = 10000
    nops = 10000
    # Add connection configuration for this test.
    def conn_config(self):
        return 'cache_size=1GB'

    @wttest.longtest("Eviction copes with lots of files")
    def test_eviction(self):
        cursors = []

            

Reported by Pylint.

Method could be a function
Error

Line: 46 Column: 5

                  nrows = 10000
    nops = 10000
    # Add connection configuration for this test.
    def conn_config(self):
        return 'cache_size=1GB'

    @wttest.longtest("Eviction copes with lots of files")
    def test_eviction(self):
        cursors = []

            

Reported by Pylint.

Missing function or method docstring
Error

Line: 50 Column: 5

                      return 'cache_size=1GB'

    @wttest.longtest("Eviction copes with lots of files")
    def test_eviction(self):
        cursors = []
        datasets = []
        for i in range(0, self.ntables):
            this_uri = 'table:%s-%05d' % (self.table_name, i)
            ds = SimpleDataSet(self, this_uri, self.nrows,

            

Reported by Pylint.

src/third_party/wiredtiger/test/suite/test_txn18.py
12 issues
Unable to import 'wiredtiger'
Error

Line: 35 Column: 1

              
import fnmatch, os, shutil, time
from suite_subprocess import suite_subprocess
import wiredtiger, wttest
from wtscenario import make_scenarios

class test_txn18(wttest.WiredTigerTestCase, suite_subprocess):
    t1 = 'table:test_txn18'
    conn_config = 'log=(archive=false,enabled,file_max=100K),' + \

            

Reported by Pylint.

Unused import time
Error

Line: 33 Column: 1

              #   Transactions: test recovery settings
#

import fnmatch, os, shutil, time
from suite_subprocess import suite_subprocess
import wiredtiger, wttest
from wtscenario import make_scenarios

class test_txn18(wttest.WiredTigerTestCase, suite_subprocess):

            

Reported by Pylint.

Unused import fnmatch
Error

Line: 33 Column: 1

              #   Transactions: test recovery settings
#

import fnmatch, os, shutil, time
from suite_subprocess import suite_subprocess
import wiredtiger, wttest
from wtscenario import make_scenarios

class test_txn18(wttest.WiredTigerTestCase, suite_subprocess):

            

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, shutil, time)
Error

Line: 33 Column: 1

              #   Transactions: test recovery settings
#

import fnmatch, os, shutil, time
from suite_subprocess import suite_subprocess
import wiredtiger, wttest
from wtscenario import make_scenarios

class test_txn18(wttest.WiredTigerTestCase, suite_subprocess):

            

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 fnmatch, os, shutil, time
from suite_subprocess import suite_subprocess
import wiredtiger, wttest
from wtscenario import make_scenarios

class test_txn18(wttest.WiredTigerTestCase, suite_subprocess):
    t1 = 'table:test_txn18'
    conn_config = 'log=(archive=false,enabled,file_max=100K),' + \

            

Reported by Pylint.

Multiple imports on one line (wiredtiger, wttest)
Error

Line: 35 Column: 1

              
import fnmatch, os, shutil, time
from suite_subprocess import suite_subprocess
import wiredtiger, wttest
from wtscenario import make_scenarios

class test_txn18(wttest.WiredTigerTestCase, suite_subprocess):
    t1 = 'table:test_txn18'
    conn_config = 'log=(archive=false,enabled,file_max=100K),' + \

            

Reported by Pylint.

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

Line: 38 Column: 1

              import wiredtiger, wttest
from wtscenario import make_scenarios

class test_txn18(wttest.WiredTigerTestCase, suite_subprocess):
    t1 = 'table:test_txn18'
    conn_config = 'log=(archive=false,enabled,file_max=100K),' + \
                'transaction_sync=(method=dsync,enabled)'
    conn_recerror = conn_config + ',log=(recover=error)'
    conn_recon = conn_config + ',log=(recover=on)'

            

Reported by Pylint.

Missing class docstring
Error

Line: 38 Column: 1

              import wiredtiger, wttest
from wtscenario import make_scenarios

class test_txn18(wttest.WiredTigerTestCase, suite_subprocess):
    t1 = 'table:test_txn18'
    conn_config = 'log=(archive=false,enabled,file_max=100K),' + \
                'transaction_sync=(method=dsync,enabled)'
    conn_recerror = conn_config + ',log=(recover=error)'
    conn_recon = conn_config + ',log=(recover=on)'

            

Reported by Pylint.

Method could be a function
Error

Line: 51 Column: 5

                  ]
    scenarios = make_scenarios(key_format_values)

    def simulate_crash(self, olddir, newdir):
        ''' Simulate a crash from olddir and restart in newdir. '''
        # with the connection still open, copy files to new directory
        shutil.rmtree(newdir, ignore_errors=True)
        os.mkdir(newdir)
        for fname in os.listdir(olddir):

            

Reported by Pylint.

src/third_party/wiredtiger/test/suite/test_txn24.py
12 issues
Unable to import 'wiredtiger'
Error

Line: 34 Column: 1

              #   cache stuck issue.
#

import wiredtiger, wttest
import time
from wtscenario import make_scenarios

class test_txn24(wttest.WiredTigerTestCase):


            

Reported by Pylint.

An attribute defined in wttest line 401 hides this method
Error

Line: 48 Column: 5

                  ]
    scenarios = make_scenarios(key_format_values)

    def conn_config(self):
        # We want to either eliminate or keep the application thread role in eviction to minimum.
        # This will ensure that the dedicated eviction threads are doing the heavy lifting.
        return 'cache_size=100MB,eviction_target=80,eviction_dirty_target=5,eviction_trigger=100,\
                eviction_updates_target=5,eviction_dirty_trigger=99,eviction_updates_trigger=100,\
                eviction=(threads_max=4)'

            

Reported by Pylint.

Unused import wiredtiger
Error

Line: 34 Column: 1

              #   cache stuck issue.
#

import wiredtiger, wttest
import time
from wtscenario import make_scenarios

class test_txn24(wttest.WiredTigerTestCase):


            

Reported by Pylint.

Unused import time
Error

Line: 35 Column: 1

              #

import wiredtiger, wttest
import time
from wtscenario import make_scenarios

class test_txn24(wttest.WiredTigerTestCase):

    session_config = 'isolation=snapshot'

            

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: 34 Column: 1

              #   cache stuck issue.
#

import wiredtiger, wttest
import time
from wtscenario import make_scenarios

class test_txn24(wttest.WiredTigerTestCase):


            

Reported by Pylint.

standard import "import time" should be placed before "import wiredtiger, wttest"
Error

Line: 35 Column: 1

              #

import wiredtiger, wttest
import time
from wtscenario import make_scenarios

class test_txn24(wttest.WiredTigerTestCase):

    session_config = 'isolation=snapshot'

            

Reported by Pylint.

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

Line: 38 Column: 1

              import time
from wtscenario import make_scenarios

class test_txn24(wttest.WiredTigerTestCase):

    session_config = 'isolation=snapshot'

    key_format_values = [
        ('integer-row', dict(key_format='i')),

            

Reported by Pylint.

Missing class docstring
Error

Line: 38 Column: 1

              import time
from wtscenario import make_scenarios

class test_txn24(wttest.WiredTigerTestCase):

    session_config = 'isolation=snapshot'

    key_format_values = [
        ('integer-row', dict(key_format='i')),

            

Reported by Pylint.

Missing function or method docstring
Error

Line: 48 Column: 5

                  ]
    scenarios = make_scenarios(key_format_values)

    def conn_config(self):
        # We want to either eliminate or keep the application thread role in eviction to minimum.
        # This will ensure that the dedicated eviction threads are doing the heavy lifting.
        return 'cache_size=100MB,eviction_target=80,eviction_dirty_target=5,eviction_trigger=100,\
                eviction_updates_target=5,eviction_dirty_trigger=99,eviction_updates_trigger=100,\
                eviction=(threads_max=4)'

            

Reported by Pylint.

src/third_party/boost/boost/xpressive/detail/core/state.hpp
12 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: 106 Column: 35 CWE codes: 362/367!
Suggestion: Set up the correct permissions (e.g., using setuid()) and try to open the file directly

                : noncopyable
{
    typedef BidiIter iterator;
    typedef core_access<BidiIter> access;
    typedef detail::match_context<BidiIter> match_context;
    typedef detail::results_extras<BidiIter> results_extras;
    typedef detail::regex_impl<BidiIter> regex_impl;
    typedef detail::matchable<BidiIter> matchable;
    typedef xpressive::match_results<BidiIter> match_results;

            

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

                      this->init_(impl, what);

        // move all the nested match_results structs into the match_results cache
        this->extras_->results_cache_.reclaim_all(access::get_nested_results(what));
    }

    ///////////////////////////////////////////////////////////////////////////////
    // reset
    void reset(match_results &what, regex_impl const &impl)

            

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

                      this->found_partial_match_ = false;
        this->extras_->sub_match_stack_.unwind();
        this->init_(impl, what);
        this->extras_->results_cache_.reclaim_all(access::get_nested_results(what));
    }

    ///////////////////////////////////////////////////////////////////////////////
    // push_context
    //  called to prepare the state object for a regex match

            

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

                      match_context context = this->context_;

        // create a new nested match_results for this regex
        nested_results<BidiIter> &nested = access::get_nested_results(*context.results_ptr_);
        match_results &what = this->extras_->results_cache_.append_new(nested);

        // (re)initialize the match context
        this->init_(impl, what);


            

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

                          this->uninit_(impl, what);

            // send the match_results struct back to the cache
            nested_results<BidiIter> &nested = access::get_nested_results(what);
            this->extras_->results_cache_.reclaim_last(nested);
        }

        // restore the state
        this->context_ = context;

            

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

                      // restore the state
        this->context_ = context;
        match_results &results = *this->context_.results_ptr_;
        this->sub_matches_ = access::get_sub_matches(access::get_sub_match_vector(results));
        this->mark_count_ = results.size();
        return success;
    }

    ///////////////////////////////////////////////////////////////////////////////

            

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

                      // restore the state
        this->context_ = context;
        match_results &results = *this->context_.results_ptr_;
        this->sub_matches_ = access::get_sub_matches(access::get_sub_match_vector(results));
        this->mark_count_ = results.size();
        return success;
    }

    ///////////////////////////////////////////////////////////////////////////////

            

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

                  {
        std::swap(this->context_, context);
        match_results &results = *this->context_.results_ptr_;
        this->sub_matches_ = access::get_sub_matches(access::get_sub_match_vector(results));
        this->mark_count_ = results.size();
    }

    // beginning of buffer
    bool bos() const

            

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

                  {
        std::swap(this->context_, context);
        match_results &results = *this->context_.results_ptr_;
        this->sub_matches_ = access::get_sub_matches(access::get_sub_match_vector(results));
        this->mark_count_ = results.size();
    }

    // beginning of buffer
    bool bos() const

            

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

                      this->sub_matches_ += impl.hidden_mark_count_;

        // initialize the match_results struct
        access::init_match_results(what, id, impl.traits_, this->sub_matches_, this->mark_count_, impl.named_marks_);
    }

    void uninit_(regex_impl const &impl, match_results &)
    {
        extras_->sub_match_stack_.unwind_to(this->sub_matches_ - impl.hidden_mark_count_);

            

Reported by FlawFinder.

src/third_party/wiredtiger/test/suite/test_backup02.py
12 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 queue, threading, time, wiredtiger, wttest
from wtthread import backup_thread, checkpoint_thread, op_thread

# test_backup02.py
#   Run background checkpoints and backups repeatedly while doing inserts
#   in another thread

            

Reported by Pylint.

Unused 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 queue, threading, time, wiredtiger, wttest
from wtthread import backup_thread, checkpoint_thread, op_thread

# test_backup02.py
#   Run background checkpoints and backups repeatedly while doing inserts
#   in another thread

            

Reported by Pylint.

Unused checkpoint_thread imported from wtthread
Error

Line: 30 Column: 1

              # OTHER DEALINGS IN THE SOFTWARE.

import queue, threading, time, wiredtiger, wttest
from wtthread import backup_thread, checkpoint_thread, op_thread

# test_backup02.py
#   Run background checkpoints and backups repeatedly while doing inserts
#   in another thread
class test_backup02(wttest.WiredTigerTestCase):

            

Reported by Pylint.

TODO: Ideally we'd like a checkpoint thread, separate to the backup
Error

Line: 52 Column: 3

                      for this_uri in uris:
            self.session.create(this_uri,
                "key_format=" + self.fmt + ",value_format=S")
        # TODO: Ideally we'd like a checkpoint thread, separate to the backup
        # thread. Need a way to stop checkpoints while doing backups.
#        ckpt = checkpoint_thread(self.conn, done)
#        ckpt.start()
        bkp = backup_thread(self.conn, 'backup.dir', done)
        work_queue = queue.Queue()

            

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 (queue, threading, time, 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 queue, threading, time, wiredtiger, wttest
from wtthread import backup_thread, checkpoint_thread, op_thread

# test_backup02.py
#   Run background checkpoints and backups repeatedly while doing inserts
#   in another thread

            

Reported by Pylint.

Imports from package queue are not grouped
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 queue, threading, time, wiredtiger, wttest
from wtthread import backup_thread, checkpoint_thread, op_thread

# test_backup02.py
#   Run background checkpoints and backups repeatedly while doing inserts
#   in another thread

            

Reported by Pylint.

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

Line: 35 Column: 1

              # test_backup02.py
#   Run background checkpoints and backups repeatedly while doing inserts
#   in another thread
class test_backup02(wttest.WiredTigerTestCase):
    uri = 'table:test_backup02'
    fmt = 'L'
    dsize = 100
    nops = 200
    nthreads = 1

            

Reported by Pylint.

Missing class docstring
Error

Line: 35 Column: 1

              # test_backup02.py
#   Run background checkpoints and backups repeatedly while doing inserts
#   in another thread
class test_backup02(wttest.WiredTigerTestCase):
    uri = 'table:test_backup02'
    fmt = 'L'
    dsize = 100
    nops = 200
    nthreads = 1

            

Reported by Pylint.

Missing function or method docstring
Error

Line: 43 Column: 5

                  nthreads = 1
    time = 60 if wttest.islongtest() else 10

    def test_backup02(self):
        done = threading.Event()
        uris = list()
        uris.append(self.uri + str(1))
        uris.append(self.uri + str(2))
        uris.append(self.uri + str(3))

            

Reported by Pylint.

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

Line: 20 Column: 1

              
"""Encoder/decoder for http style chunked encoding."""

from testtools.compat import _b

empty = _b('')

class Decoder(object):
    """Decode chunked content to a byte stream."""

            

Reported by Pylint.

Comparing against a callable, did you omit the parenthesis?
Error

Line: 60 Column: 12

              
        :raises ValueError: If the stream is incomplete ValueError is raised.
        """
        if self.state != self._finished:
            raise ValueError("incomplete stream")

    def _finished(self):
        """Finished reading, return any remaining bytes."""
        if self.buffered_bytes:

            

Reported by Pylint.

Redefining built-in 'bytes'
Error

Line: 93 Column: 13

                  def _read_length(self):
        """Try to decode a length from the bytes."""
        count_chars = []
        for bytes in self.buffered_bytes:
            for pos in range(len(bytes)):
                byte = bytes[pos:pos+1]
                if byte not in self._match_chars:
                    break
                count_chars.append(byte)

            

Reported by Pylint.

Redefining built-in 'bytes'
Error

Line: 129 Column: 21

                          self.state = self._read_body
        return self.state()

    def write(self, bytes):
        """Decode bytes to the output stream.

        :raises ValueError: If the stream has already seen the end of file
            marker.
        :returns: None, or the excess bytes beyond the end of file marker.

            

Reported by Pylint.

Redefining built-in 'bytes'
Error

Line: 172 Column: 21

                          self.output.write(empty.join(buffered_bytes))
        return True

    def write(self, bytes):
        """Encode bytes to the output stream."""
        bytes_len = len(bytes)
        if self.buffer_size + bytes_len >= 65536:
            self.flush(bytes_len)
            self.output.write(bytes)

            

Reported by Pylint.

Too many instance attributes (10/7)
Error

Line: 24 Column: 1

              
empty = _b('')

class Decoder(object):
    """Decode chunked content to a byte stream."""

    def __init__(self, output, strict=True):
        """Create a decoder decoding to output.


            

Reported by Pylint.

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

Line: 24 Column: 1

              
empty = _b('')

class Decoder(object):
    """Decode chunked content to a byte stream."""

    def __init__(self, output, strict=True):
        """Create a decoder decoding to output.


            

Reported by Pylint.

Unnecessary "else" after "return"
Error

Line: 65 Column: 9

              
    def _finished(self):
        """Finished reading, return any remaining bytes."""
        if self.buffered_bytes:
            buffered_bytes = self.buffered_bytes
            self.buffered_bytes = []
            return empty.join(buffered_bytes)
        else:
            raise ValueError("stream is finished")

            

Reported by Pylint.

Either all return statements in a function should return an expression, or none of them should.
Error

Line: 90 Column: 5

                              self.state = self._read_length
                return self.state()

    def _read_length(self):
        """Try to decode a length from the bytes."""
        count_chars = []
        for bytes in self.buffered_bytes:
            for pos in range(len(bytes)):
                byte = bytes[pos:pos+1]

            

Reported by Pylint.

Too many branches (15/12)
Error

Line: 90 Column: 5

                              self.state = self._read_length
                return self.state()

    def _read_length(self):
        """Try to decode a length from the bytes."""
        count_chars = []
        for bytes in self.buffered_bytes:
            for pos in range(len(bytes)):
                byte = bytes[pos:pos+1]

            

Reported by Pylint.