The following issues were found

src/third_party/IntelRDFPMathLib20U1/LIBRARY/src/bid_internal.h
10400 issues
Shifting 32-bit value by 51 bits is undefined behaviour
Error

Line: 834 CWE codes: 758

                    coeff = 0;
    *pcoefficient_x = coeff;
    // get exponent
    tmp = x >> EXPONENT_SHIFT_LARGE64;
    *pexponent_x = (int) (tmp & EXPONENT_MASK64);
    return coeff;
  }
  // exponent
  tmp = x >> EXPONENT_SHIFT_SMALL64;

            

Reported by Cppcheck.

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

Line: 834 CWE codes: 758

                    coeff = 0;
    *pcoefficient_x = coeff;
    // get exponent
    tmp = x >> EXPONENT_SHIFT_LARGE64;
    *pexponent_x = (int) (tmp & EXPONENT_MASK64);
    return coeff;
  }
  // exponent
  tmp = x >> EXPONENT_SHIFT_SMALL64;

            

Reported by Cppcheck.

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

Line: 834 CWE codes: 758

                    coeff = 0;
    *pcoefficient_x = coeff;
    // get exponent
    tmp = x >> EXPONENT_SHIFT_LARGE64;
    *pexponent_x = (int) (tmp & EXPONENT_MASK64);
    return coeff;
  }
  // exponent
  tmp = x >> EXPONENT_SHIFT_SMALL64;

            

Reported by Cppcheck.

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

Line: 834 CWE codes: 758

                    coeff = 0;
    *pcoefficient_x = coeff;
    // get exponent
    tmp = x >> EXPONENT_SHIFT_LARGE64;
    *pexponent_x = (int) (tmp & EXPONENT_MASK64);
    return coeff;
  }
  // exponent
  tmp = x >> EXPONENT_SHIFT_SMALL64;

            

Reported by Cppcheck.

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

Line: 834 CWE codes: 758

                    coeff = 0;
    *pcoefficient_x = coeff;
    // get exponent
    tmp = x >> EXPONENT_SHIFT_LARGE64;
    *pexponent_x = (int) (tmp & EXPONENT_MASK64);
    return coeff;
  }
  // exponent
  tmp = x >> EXPONENT_SHIFT_SMALL64;

            

Reported by Cppcheck.

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

Line: 834 CWE codes: 758

                    coeff = 0;
    *pcoefficient_x = coeff;
    // get exponent
    tmp = x >> EXPONENT_SHIFT_LARGE64;
    *pexponent_x = (int) (tmp & EXPONENT_MASK64);
    return coeff;
  }
  // exponent
  tmp = x >> EXPONENT_SHIFT_SMALL64;

            

Reported by Cppcheck.

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

Line: 834 CWE codes: 758

                    coeff = 0;
    *pcoefficient_x = coeff;
    // get exponent
    tmp = x >> EXPONENT_SHIFT_LARGE64;
    *pexponent_x = (int) (tmp & EXPONENT_MASK64);
    return coeff;
  }
  // exponent
  tmp = x >> EXPONENT_SHIFT_SMALL64;

            

Reported by Cppcheck.

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

Line: 834 CWE codes: 758

                    coeff = 0;
    *pcoefficient_x = coeff;
    // get exponent
    tmp = x >> EXPONENT_SHIFT_LARGE64;
    *pexponent_x = (int) (tmp & EXPONENT_MASK64);
    return coeff;
  }
  // exponent
  tmp = x >> EXPONENT_SHIFT_SMALL64;

            

Reported by Cppcheck.

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

Line: 834 CWE codes: 758

                    coeff = 0;
    *pcoefficient_x = coeff;
    // get exponent
    tmp = x >> EXPONENT_SHIFT_LARGE64;
    *pexponent_x = (int) (tmp & EXPONENT_MASK64);
    return coeff;
  }
  // exponent
  tmp = x >> EXPONENT_SHIFT_SMALL64;

            

Reported by Cppcheck.

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

Line: 834 CWE codes: 758

                    coeff = 0;
    *pcoefficient_x = coeff;
    // get exponent
    tmp = x >> EXPONENT_SHIFT_LARGE64;
    *pexponent_x = (int) (tmp & EXPONENT_MASK64);
    return coeff;
  }
  // exponent
  tmp = x >> EXPONENT_SHIFT_SMALL64;

            

Reported by Cppcheck.

src/third_party/wiredtiger/tools/optrack/find-latency-spikes.py
945 issues
Unable to import 'bokeh.layouts'
Error

Line: 30 Column: 1

              # OTHER DEALINGS IN THE SOFTWARE.

import argparse
from bokeh.layouts import column
from bokeh.models import ColumnDataSource, CustomJS, HoverTool, FixedTicker
from bokeh.models import  LabelSet, Legend, LegendItem
from bokeh.models import NumeralTickFormatter, OpenURL, Range1d, TapTool
from bokeh.models.annotations import Label
from bokeh.plotting import figure, output_file, reset_output, save, show

            

Reported by Pylint.

Unable to import 'bokeh.models'
Error

Line: 31 Column: 1

              
import argparse
from bokeh.layouts import column
from bokeh.models import ColumnDataSource, CustomJS, HoverTool, FixedTicker
from bokeh.models import  LabelSet, Legend, LegendItem
from bokeh.models import NumeralTickFormatter, OpenURL, Range1d, TapTool
from bokeh.models.annotations import Label
from bokeh.plotting import figure, output_file, reset_output, save, show
from bokeh.resources import CDN

            

Reported by Pylint.

Unable to import 'bokeh.models'
Error

Line: 32 Column: 1

              import argparse
from bokeh.layouts import column
from bokeh.models import ColumnDataSource, CustomJS, HoverTool, FixedTicker
from bokeh.models import  LabelSet, Legend, LegendItem
from bokeh.models import NumeralTickFormatter, OpenURL, Range1d, TapTool
from bokeh.models.annotations import Label
from bokeh.plotting import figure, output_file, reset_output, save, show
from bokeh.resources import CDN
from multiprocessing import Process, Queue, Array

            

Reported by Pylint.

Unable to import 'bokeh.models'
Error

Line: 33 Column: 1

              from bokeh.layouts import column
from bokeh.models import ColumnDataSource, CustomJS, HoverTool, FixedTicker
from bokeh.models import  LabelSet, Legend, LegendItem
from bokeh.models import NumeralTickFormatter, OpenURL, Range1d, TapTool
from bokeh.models.annotations import Label
from bokeh.plotting import figure, output_file, reset_output, save, show
from bokeh.resources import CDN
from multiprocessing import Process, Queue, Array
import multiprocessing

            

Reported by Pylint.

Unable to import 'bokeh.models.annotations'
Error

Line: 34 Column: 1

              from bokeh.models import ColumnDataSource, CustomJS, HoverTool, FixedTicker
from bokeh.models import  LabelSet, Legend, LegendItem
from bokeh.models import NumeralTickFormatter, OpenURL, Range1d, TapTool
from bokeh.models.annotations import Label
from bokeh.plotting import figure, output_file, reset_output, save, show
from bokeh.resources import CDN
from multiprocessing import Process, Queue, Array
import multiprocessing
import numpy as np

            

Reported by Pylint.

Unable to import 'bokeh.plotting'
Error

Line: 35 Column: 1

              from bokeh.models import  LabelSet, Legend, LegendItem
from bokeh.models import NumeralTickFormatter, OpenURL, Range1d, TapTool
from bokeh.models.annotations import Label
from bokeh.plotting import figure, output_file, reset_output, save, show
from bokeh.resources import CDN
from multiprocessing import Process, Queue, Array
import multiprocessing
import numpy as np
import os

            

Reported by Pylint.

Unable to import 'bokeh.resources'
Error

Line: 36 Column: 1

              from bokeh.models import NumeralTickFormatter, OpenURL, Range1d, TapTool
from bokeh.models.annotations import Label
from bokeh.plotting import figure, output_file, reset_output, save, show
from bokeh.resources import CDN
from multiprocessing import Process, Queue, Array
import multiprocessing
import numpy as np
import os
import pandas as pd

            

Reported by Pylint.

Unable to import 'pandas'
Error

Line: 41 Column: 1

              import multiprocessing
import numpy as np
import os
import pandas as pd
import subprocess
import sys
import traceback
import time


            

Reported by Pylint.

bad operand type for unary +: str
Error

Line: 928 Column: 23

                          except ValueError:
                print(color.BOLD + color.RED +
                      "Could not parse seconds since Epoch on first line" +
                      + color.END);
            return 1;
        else:
            return 0;

def processFile(fname, dumpCleanDataBool):

            

Reported by Pylint.

bad operand type for unary -: str
Error

Line: 1225 Column: 29

                          elif (units == "ns"):
                threshold = unitsPerNanosecond * number;
            elif (units == "stdev"):
                threshold = -units;
                # We record it as negative, so that we know
                # this is a standard deviation. We will compute
                # the actual value once we know the average.
            else:
                print(color.BOLD + color.RED +

            

Reported by Pylint.

src/third_party/wiredtiger/test/3rdparty/testtools-0.9.34/testtools/tests/test_testresult.py
642 issues
Unable to import 'extras'
Error

Line: 19 Column: 1

              from unittest import TestSuite
import warnings

from extras import safe_hasattr, try_imports

Queue = try_imports(['Queue.Queue', 'queue.Queue'])

from testtools import (
    CopyStreamResult,

            

Reported by Pylint.

Instance of 'Python26Contract' has no 'makeResult' member
Error

Line: 139 Column: 18

              
    def test_fresh_result_is_successful(self):
        # A result is considered successful before any tests are run.
        result = self.makeResult()
        self.assertTrue(result.wasSuccessful())

    def test_addError_is_failure(self):
        # addError fails the test run.
        result = self.makeResult()

            

Reported by Pylint.

Instance of 'Python26Contract' has no 'assertTrue' member
Error

Line: 140 Column: 9

                  def test_fresh_result_is_successful(self):
        # A result is considered successful before any tests are run.
        result = self.makeResult()
        self.assertTrue(result.wasSuccessful())

    def test_addError_is_failure(self):
        # addError fails the test run.
        result = self.makeResult()
        result.startTest(self)

            

Reported by Pylint.

Instance of 'Python26Contract' has no 'makeResult' member
Error

Line: 144 Column: 18

              
    def test_addError_is_failure(self):
        # addError fails the test run.
        result = self.makeResult()
        result.startTest(self)
        result.addError(self, an_exc_info)
        result.stopTest(self)
        self.assertFalse(result.wasSuccessful())


            

Reported by Pylint.

Instance of 'Python26Contract' has no 'assertFalse' member
Error

Line: 148 Column: 9

                      result.startTest(self)
        result.addError(self, an_exc_info)
        result.stopTest(self)
        self.assertFalse(result.wasSuccessful())

    def test_addFailure_is_failure(self):
        # addFailure fails the test run.
        result = self.makeResult()
        result.startTest(self)

            

Reported by Pylint.

Instance of 'Python26Contract' has no 'makeResult' member
Error

Line: 152 Column: 18

              
    def test_addFailure_is_failure(self):
        # addFailure fails the test run.
        result = self.makeResult()
        result.startTest(self)
        result.addFailure(self, an_exc_info)
        result.stopTest(self)
        self.assertFalse(result.wasSuccessful())


            

Reported by Pylint.

Instance of 'Python26Contract' has no 'assertFalse' member
Error

Line: 156 Column: 9

                      result.startTest(self)
        result.addFailure(self, an_exc_info)
        result.stopTest(self)
        self.assertFalse(result.wasSuccessful())

    def test_addSuccess_is_success(self):
        # addSuccess does not fail the test run.
        result = self.makeResult()
        result.startTest(self)

            

Reported by Pylint.

Instance of 'Python26Contract' has no 'makeResult' member
Error

Line: 160 Column: 18

              
    def test_addSuccess_is_success(self):
        # addSuccess does not fail the test run.
        result = self.makeResult()
        result.startTest(self)
        result.addSuccess(self)
        result.stopTest(self)
        self.assertTrue(result.wasSuccessful())


            

Reported by Pylint.

Instance of 'Python26Contract' has no 'assertTrue' member
Error

Line: 164 Column: 9

                      result.startTest(self)
        result.addSuccess(self)
        result.stopTest(self)
        self.assertTrue(result.wasSuccessful())

    def test_stop_sets_shouldStop(self):
        result = self.makeResult()
        result.stop()
        self.assertTrue(result.shouldStop)

            

Reported by Pylint.

Instance of 'Python26Contract' has no 'makeResult' member
Error

Line: 167 Column: 18

                      self.assertTrue(result.wasSuccessful())

    def test_stop_sets_shouldStop(self):
        result = self.makeResult()
        result.stop()
        self.assertTrue(result.shouldStop)


class Python27Contract(Python26Contract):

            

Reported by Pylint.

src/third_party/scons-3.1.2/scons-local-3.1.2/SCons/Node/FS.py
545 issues
Assigning to attribute '__class__' not defined in class slots
Error

Line: 1037 Column: 13

                      """Called to make sure a Node is a Dir.  Since we're an
        Entry, we can morph into one."""
        if self.__class__ is not klass:
            self.__class__ = klass
            self._morph()
            self.clear()

    # The following methods can get called before the Taskmaster has
    # had a chance to call disambiguate() directly to see if this Entry

            

Reported by Pylint.

Instance of 'FileNodeInfo' has no 'size' member
Error

Line: 2492 Column: 82

                              setattr(self, key, value)

    def __eq__(self, other):
        return self.csig == other.csig and self.timestamp == other.timestamp and self.size == other.size

    def __ne__(self, other):
        return not self.__eq__(other)



            

Reported by Pylint.

Instance of 'FileBuildInfo' has no 'dependency_map' member
Error

Line: 2523 Column: 17

                      # heald in dependency_map. Currently only used with
        # MD5-timestamp decider
        if key != 'dependency_map' and hasattr(self, 'dependency_map'):
            del self.dependency_map

        return super(FileBuildInfo, self).__setattr__(key, value)

    def convert_to_sconsign(self):
        """

            

Reported by Pylint.

Raising int while only classes or instances are allowed
Error

Line: 3104 Column: 13

                          print("dup: removing existing target {}".format(self))
        e = Unlink(self, [], None)
        if isinstance(e, SCons.Errors.BuildError):
            raise e

    #
    # Taskmaster interface subsystem
    #


            

Reported by Pylint.

Raising int while only classes or instances are allowed
Error

Line: 3520 Column: 29

                                      if isinstance(e, SCons.Errors.BuildError):
                            # Likely this should be re-raising exception e
                            # (which would be BuildError)
                            raise e
                        SCons.Node.store_info_map[self.store_info](self)
                    if T: Trace(' 1\n')
                    return 1
            self.changed()
            if T: Trace(' None\n')

            

Reported by Pylint.

Access to member 'cachedir_csig' before its definition line 3615
Error

Line: 3608 Column: 20

                      can use its contents for the csig.
        """
        try:
            return self.cachedir_csig
        except AttributeError:
            pass

        cache = self.get_build_env().get_CacheDir()
        cachedir, cachefile = cache.cachepath(self)

            

Reported by Pylint.

Access to member 'contentsig' before its definition line 3635
Error

Line: 3629 Column: 20

                      """

        try:
            return self.contentsig
        except AttributeError:
            pass

        executor = self.get_executor()


            

Reported by Pylint.

Access to member 'cachesig' before its definition line 3666
Error

Line: 3651 Column: 20

                      Signature should normally be string of hex digits.
        """
        try:
            return self.cachesig
        except AttributeError:
            pass

        # Collect signatures for all children
        children = self.children()

            

Reported by Pylint.

Access to a protected member _sconsign of a client class
Error

Line: 72 Column: 12

              def sconsign_dir(node):
    """Return the .sconsign file info for this directory,
    creating it first if necessary."""
    if not node._sconsign:
        import SCons.SConsign
        node._sconsign = SCons.SConsign.ForDirectory(node)
    return node._sconsign

_sconsign_map = {0 : sconsign_none,

            

Reported by Pylint.

Redefining name 'SCons' from outer scope (line 48)
Error

Line: 73 Column: 9

                  """Return the .sconsign file info for this directory,
    creating it first if necessary."""
    if not node._sconsign:
        import SCons.SConsign
        node._sconsign = SCons.SConsign.ForDirectory(node)
    return node._sconsign

_sconsign_map = {0 : sconsign_none,
                 1 : sconsign_dir}

            

Reported by Pylint.

src/third_party/wiredtiger/test/3rdparty/testtools-0.9.34/testtools/tests/test_testcase.py
500 issues
Method should have "self" as first argument
Error

Line: 1028 Column: 13

              
    def test_addError(self):
        class Case(TestCase):
            def test(this):
                this.addDetail("foo", self.get_content())
                1/0
        self.assertDetailsProvided(Case("test"), "addError",
            ["foo", "traceback"])


            

Reported by Pylint.

Method should have "self" as first argument
Error

Line: 1036 Column: 13

              
    def test_addFailure(self):
        class Case(TestCase):
            def test(this):
                this.addDetail("foo", self.get_content())
                self.fail('yo')
        self.assertDetailsProvided(Case("test"), "addFailure",
            ["foo", "traceback"])


            

Reported by Pylint.

Method should have "self" as first argument
Error

Line: 1044 Column: 13

              
    def test_addSkip(self):
        class Case(TestCase):
            def test(this):
                this.addDetail("foo", self.get_content())
                self.skip('yo')
        self.assertDetailsProvided(Case("test"), "addSkip",
            ["foo", "reason"])


            

Reported by Pylint.

Method should have "self" as first argument
Error

Line: 1052 Column: 13

              
    def test_addSucccess(self):
        class Case(TestCase):
            def test(this):
                this.addDetail("foo", self.get_content())
        self.assertDetailsProvided(Case("test"), "addSuccess",
            ["foo"])

    def test_addUnexpectedSuccess(self):

            

Reported by Pylint.

Method should have "self" as first argument
Error

Line: 1059 Column: 13

              
    def test_addUnexpectedSuccess(self):
        class Case(TestCase):
            def test(this):
                this.addDetail("foo", self.get_content())
                raise testcase._UnexpectedSuccess()
        self.assertDetailsProvided(Case("test"), "addUnexpectedSuccess",
            ["foo"])


            

Reported by Pylint.

Instance of 'PlaceHolder' has no 'other' member
Error

Line: 1543 Column: 37

                      self.assertEqual('fred', case.thing)
        self.assertRaises(AttributeError, getattr, case, 'other')
        case.other = 'barbara'
        self.assertEqual('barbara', orig.other)
        del case.thing
        self.assertRaises(AttributeError, getattr, orig, 'thing')


def test_suite():

            

Reported by Pylint.

Use of exec
Error

Line: 55 Column: 5

                  LoggingResult,
    )
try:
    exec('from __future__ import with_statement')
except SyntaxError:
    pass
else:
    from testtools.tests.test_with_with import *


            

Reported by Pylint.

Use of exec detected.
Security

Line: 55
Suggestion: https://bandit.readthedocs.io/en/latest/plugins/b102_exec_used.html

                  LoggingResult,
    )
try:
    exec('from __future__ import with_statement')
except SyntaxError:
    pass
else:
    from testtools.tests.test_with_with import *


            

Reported by Bandit.

Unused import TestExpectedException from wildcard import
Error

Line: 59 Column: 5

              except SyntaxError:
    pass
else:
    from testtools.tests.test_with_with import *


class TestPlaceHolder(TestCase):

    run_test_with = FullStackRunTest

            

Reported by Pylint.

Wildcard import testtools.tests.test_with_with
Error

Line: 59 Column: 5

              except SyntaxError:
    pass
else:
    from testtools.tests.test_with_with import *


class TestPlaceHolder(TestCase):

    run_test_with = FullStackRunTest

            

Reported by Pylint.

src/third_party/scons-3.1.2/scons-local-3.1.2/SCons/Environment.py
395 issues
Instance of 'SubstitutionEnvironment' has no 'Append' member
Error

Line: 821 Column: 13

                      if not SCons.Util.is_Dict(args):
            args = self.ParseFlags(args)
        if not unique:
            self.Append(**args)
            return self
        for key, value in args.items():
            if not value:
                continue
            try:

            

Reported by Pylint.

Access to member '_last_CacheDir_path' before its definition line 1046
Error

Line: 1035 Column: 25

              
        cachedir_class = self.validate_CacheDir_class()
        try:
            if (path == self._last_CacheDir_path
                    # this checks if the cachedir class type has changed from what the
                    # instantiated cache dir type is. If the are exactly the same we
                    # can just keep using the existing one, otherwise the user is requesting
                    # something new, so we will re-instantiate below.
                    and type(self._last_CacheDir) is cachedir_class):

            

Reported by Pylint.

Access to member '_last_CacheDir' before its definition line 1047
Error

Line: 1040 Column: 30

                                  # instantiated cache dir type is. If the are exactly the same we
                    # can just keep using the existing one, otherwise the user is requesting
                    # something new, so we will re-instantiate below.
                    and type(self._last_CacheDir) is cachedir_class):
                return self._last_CacheDir
        except AttributeError:
            pass

        cd = cachedir_class(path)

            

Reported by Pylint.

Access to member '_last_CacheDir' before its definition line 1047
Error

Line: 1041 Column: 24

                                  # can just keep using the existing one, otherwise the user is requesting
                    # something new, so we will re-instantiate below.
                    and type(self._last_CacheDir) is cachedir_class):
                return self._last_CacheDir
        except AttributeError:
            pass

        cd = cachedir_class(path)
        self._last_CacheDir_path = path

            

Reported by Pylint.

Unused argument 'source'
Error

Line: 78 Column: 32

              semi_deepcopy = SCons.Util.semi_deepcopy
semi_deepcopy_dict = SCons.Util.semi_deepcopy_dict

def alias_builder(env, target, source):
    pass

AliasBuilder = SCons.Builder.Builder(action = alias_builder,
                                     target_factory = SCons.Node.Alias.default_ans.Alias,
                                     source_factory = SCons.Node.FS.Entry,

            

Reported by Pylint.

Unused argument 'target'
Error

Line: 78 Column: 24

              semi_deepcopy = SCons.Util.semi_deepcopy
semi_deepcopy_dict = SCons.Util.semi_deepcopy_dict

def alias_builder(env, target, source):
    pass

AliasBuilder = SCons.Builder.Builder(action = alias_builder,
                                     target_factory = SCons.Node.Alias.default_ans.Alias,
                                     source_factory = SCons.Node.FS.Entry,

            

Reported by Pylint.

Unused argument 'env'
Error

Line: 78 Column: 19

              semi_deepcopy = SCons.Util.semi_deepcopy
semi_deepcopy_dict = SCons.Util.semi_deepcopy_dict

def alias_builder(env, target, source):
    pass

AliasBuilder = SCons.Builder.Builder(action = alias_builder,
                                     target_factory = SCons.Node.Alias.default_ans.Alias,
                                     source_factory = SCons.Node.FS.Entry,

            

Reported by Pylint.

Redefining built-in 'dict'
Error

Line: 124 Column: 32

                  #'HOST_CPU',
    ]

def copy_non_reserved_keywords(dict):
    result = semi_deepcopy(dict)
    for k in list(result.keys()):
        if k in reserved_construction_var_names:
            msg = "Ignoring attempt to set reserved variable `$%s'"
            SCons.Warnings.warn(SCons.Warnings.ReservedVariableWarning, msg % k)

            

Reported by Pylint.

Unused argument 'value'
Error

Line: 133 Column: 29

                          del result[k]
    return result

def _set_reserved(env, key, value):
    msg = "Ignoring attempt to set reserved variable `$%s'"
    SCons.Warnings.warn(SCons.Warnings.ReservedVariableWarning, msg % key)

def _set_future_reserved(env, key, value):
    env._dict[key] = value

            

Reported by Pylint.

Unused argument 'env'
Error

Line: 133 Column: 19

                          del result[k]
    return result

def _set_reserved(env, key, value):
    msg = "Ignoring attempt to set reserved variable `$%s'"
    SCons.Warnings.warn(SCons.Warnings.ReservedVariableWarning, msg % key)

def _set_future_reserved(env, key, value):
    env._dict[key] = value

            

Reported by Pylint.

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

Line: 55 Column: 1

              import SCons.Util
import SCons.Warnings

from .MSCommon import msvc_exists, msvc_setup_env_once
from SCons.Defaults import processDefines
from SCons.compat import PICKLE_PROTOCOL

##############################################################################
# Below here are the classes and functions for generation of

            

Reported by Pylint.

Instance of '_UserGenerator' has no 'configs' member
Error

Line: 225 Column: 17

                              trg = {}
                for key in [k for k in list(self.usrdebg.keys()) if k in src]:
                    trg[key] = str(src[key])
                self.configs[var].debug = trg

    def UserHeader(self):
        encoding = self.env.subst('$MSVSENCODING')
        versionstr = self.versionstr
        self.usrfile.write(self.usrhead % locals())

            

Reported by Pylint.

Instance of '_UserGenerator' has no 'env' member
Error

Line: 228 Column: 20

                              self.configs[var].debug = trg

    def UserHeader(self):
        encoding = self.env.subst('$MSVSENCODING')
        versionstr = self.versionstr
        self.usrfile.write(self.usrhead % locals())

    def UserProject(self):
        pass

            

Reported by Pylint.

Instance of '_UserGenerator' has no 'versionstr' member
Error

Line: 229 Column: 22

              
    def UserHeader(self):
        encoding = self.env.subst('$MSVSENCODING')
        versionstr = self.versionstr
        self.usrfile.write(self.usrhead % locals())

    def UserProject(self):
        pass


            

Reported by Pylint.

Instance of '_UserGenerator' has no 'dspabs' member
Error

Line: 239 Column: 24

                      if not self.createfile:
            return
        try:
            filename = self.dspabs +'.user'
            self.usrfile = open(filename, 'w')
        except IOError as detail:
            raise SCons.Errors.InternalError('Unable to open "' + filename + '" for writing:' + str(detail))
        else:
            self.UserHeader()

            

Reported by Pylint.

Instance of '_GenerateV7User' has no 'version_num' member
Error

Line: 296 Column: 12

              class _GenerateV7User(_UserGenerator):
    """Generates a Project file for MSVS .NET"""
    def __init__(self, dspfile, source, env):
        if self.version_num >= 9.0:
            self.usrhead = V9UserHeader
            self.usrconf = V9UserConfiguration
            self.usrdebg = V9DebugSettings
        _UserGenerator.__init__(self, dspfile, source, env)


            

Reported by Pylint.

Instance of '_GenerateV7User' has no 'configs' member
Error

Line: 303 Column: 27

                      _UserGenerator.__init__(self, dspfile, source, env)

    def UserProject(self):
        confkeys = sorted(self.configs.keys())
        for kind in confkeys:
            variant = self.configs[kind].variant
            platform = self.configs[kind].platform
            debug = self.configs[kind].debug
            if debug:

            

Reported by Pylint.

Instance of '_GenerateV7User' has no 'configs' member
Error

Line: 305 Column: 23

                  def UserProject(self):
        confkeys = sorted(self.configs.keys())
        for kind in confkeys:
            variant = self.configs[kind].variant
            platform = self.configs[kind].platform
            debug = self.configs[kind].debug
            if debug:
                debug_settings = '\n'.join(['\t\t\t\t%s="%s"' % (key, xmlify(value))
                                            for key, value in debug.items()

            

Reported by Pylint.

Instance of '_GenerateV7User' has no 'configs' member
Error

Line: 306 Column: 24

                      confkeys = sorted(self.configs.keys())
        for kind in confkeys:
            variant = self.configs[kind].variant
            platform = self.configs[kind].platform
            debug = self.configs[kind].debug
            if debug:
                debug_settings = '\n'.join(['\t\t\t\t%s="%s"' % (key, xmlify(value))
                                            for key, value in debug.items()
                                            if value is not None])

            

Reported by Pylint.

Instance of '_GenerateV7User' has no 'configs' member
Error

Line: 307 Column: 21

                      for kind in confkeys:
            variant = self.configs[kind].variant
            platform = self.configs[kind].platform
            debug = self.configs[kind].debug
            if debug:
                debug_settings = '\n'.join(['\t\t\t\t%s="%s"' % (key, xmlify(value))
                                            for key, value in debug.items()
                                            if value is not None])
                self.usrfile.write(self.usrconf % locals())

            

Reported by Pylint.

src/third_party/wiredtiger/tools/optrack/optrack_to_t2.py
329 issues
Unable to import 'pandas'
Error

Line: 35 Column: 1

              from multiprocessing import Process
import numpy as np
import os
import pandas as pd
import sys
import time

# The time units used in the input files is nanoseconds. Presently the
# operation tracking code does not produce data using any other time

            

Reported by Pylint.

Unused import os
Error

Line: 34 Column: 1

              import multiprocessing
from multiprocessing import Process
import numpy as np
import os
import pandas as pd
import sys
import time

# The time units used in the input files is nanoseconds. Presently the

            

Reported by Pylint.

Unnecessary semicolon
Error

Line: 43 Column: 1

              # operation tracking code does not produce data using any other time
# units.
#
unitsPerSecond = 1000000000;

# We aggregate data for intervals with the duration specified by
# the following variable.
intervalLength = 1;


            

Reported by Pylint.

Unnecessary semicolon
Error

Line: 47 Column: 1

              
# We aggregate data for intervals with the duration specified by
# the following variable.
intervalLength = 1;

# Each file has a timestamp indicating when the logging began
perFileTimeStamps = {};

# Codes for various colors for printing of informational and error messages.

            

Reported by Pylint.

Unnecessary semicolon
Error

Line: 50 Column: 1

              intervalLength = 1;

# Each file has a timestamp indicating when the logging began
perFileTimeStamps = {};

# Codes for various colors for printing of informational and error messages.
#
class color:
    PURPLE = '\033[95m'

            

Reported by Pylint.

Unnecessary semicolon
Error

Line: 71 Column: 1

              #
def assignStackDepths(dataframe):

    stack = [];

    df = dataframe.sort_values(by=['start']);
    df = df.reset_index(drop = True);

    for i in range(len(df.index)):

            

Reported by Pylint.

Unnecessary semicolon
Error

Line: 73 Column: 1

              
    stack = [];

    df = dataframe.sort_values(by=['start']);
    df = df.reset_index(drop = True);

    for i in range(len(df.index)):

        myEndTime = df.at[i, 'end'];

            

Reported by Pylint.

Unnecessary semicolon
Error

Line: 74 Column: 1

                  stack = [];

    df = dataframe.sort_values(by=['start']);
    df = df.reset_index(drop = True);

    for i in range(len(df.index)):

        myEndTime = df.at[i, 'end'];


            

Reported by Pylint.

Unnecessary semicolon
Error

Line: 78 Column: 1

              
    for i in range(len(df.index)):

        myEndTime = df.at[i, 'end'];

        # Pop all items off stack whose end time is earlier than my
        # end time. They are not the callers on my stack, so I don't want to
        # count them.
        #

            

Reported by Pylint.

Unnecessary semicolon
Error

Line: 85 Column: 1

                      # count them.
        #
        while (len(stack) > 0 and stack[-1] < myEndTime):
            stack.pop();

        df.at[i, 'stackdepth'] = len(stack);
        stack.append(df.at[i, 'end']);

    return df;

            

Reported by Pylint.

src/third_party/scons-3.1.2/scons-time.py
325 issues
Starting a process with a shell, possible injection detected, security issue.
Security injection

Line: 422
Suggestion: https://bandit.readthedocs.io/en/latest/plugins/b605_start_process_with_a_shell.html

                      if callable(action):
            action(*args)
        else:
            os.system(action % args)

    def run_command_list(self, commands, dict):
        """
        Executes a list of commands, substituting values from the
        specified dictionary.

            

Reported by Bandit.

Starting a process with a shell, possible injection detected, security issue.
Security injection

Line: 445
Suggestion: https://bandit.readthedocs.io/en/latest/plugins/b605_start_process_with_a_shell.html

              
    def log_execute(self, command, log):
        command = self.subst(command, self.__dict__)
        p = os.popen(command)
        output = p.read()
        p.close()
        #TODO: convert to subrocess, os.popen is obsolete. This didn't work:
        #process = subprocess.Popen(command, stdout=subprocess.PIPE, shell=True)
        #output = process.stdout.read()

            

Reported by Bandit.

Method has no argument
Error

Line: 273 Column: 5

                  name = 'scons-time'
    name_spaces = ' '*len(name)

    def makedict(**kw):
        return kw

    default_settings = makedict(
        chdir               = None,
        config_file         = None,

            

Reported by Pylint.

An attribute defined in scons-time line 1172 hides this method
Error

Line: 393 Column: 5

                  def _do_not_display(self, msg, *args):
        pass

    def display(self, msg, *args):
        """
        Displays the specified message.

        Each message is prepended with a standard prefix of our name
        plus the time.

            

Reported by Pylint.

An attribute defined in scons-time line 1162 hides this method
Error

Line: 412 Column: 5

                  def _do_not_execute(self, action, *args):
        pass

    def execute(self, action, *args):
        """
        Executes the specified action.

        The action is called if it's a callable Python function, and
        otherwise passed to os.system().

            

Reported by Pylint.

Assigning result of a function call, where the function has no return
Error

Line: 433 Column: 13

                      for action, string, args in commands:
            self.display(string, *args)
            sys.stdout.flush()
            status = self.execute(action, *args)
            if status:
                sys.exit(status)

    def log_display(self, command, log):
        command = self.subst(command, self.__dict__)

            

Reported by Pylint.

bad operand type for unary -: NoneType
Error

Line: 482 Column: 27

                          files.extend(sorted(glob.glob(a)))

        if tail:
            files = files[-tail:]

        return files

    def ascii_table(self, files, columns,
                    line_function, file_function=lambda x: x,

            

Reported by Pylint.

Instance of 'SConsTimer' has no 'key_location' member
Error

Line: 559 Column: 37

                      """
        Prints out a set of results in Gnuplot format.
        """
        gp = Gnuplotter(self.title, self.key_location)

        for i in sorted(results.keys()):
            try:
                t = self.run_titles[i]
            except IndexError:

            

Reported by Pylint.

Instance of 'SConsTimer' has no 'vertical_bars' member
Error

Line: 569 Column: 26

                          results[i].sort()
            gp.line(results[i], i+1, t, None, t, fmt=fmt)

        for bar_tuple in self.vertical_bars:
            try:
                x, type, label, comment = bar_tuple
            except ValueError:
                x, type, label = bar_tuple
                comment = label

            

Reported by Pylint.

Access to member 'scons_wrapper' before its definition line 1267
Error

Line: 1252 Column: 35

                          prepare(commands, removals)

        save_scons              = self.scons
        save_scons_wrapper      = self.scons_wrapper
        save_scons_lib_dir      = self.scons_lib_dir

        if self.outdir is None:
            self.outdir = self.orig_cwd
        elif not os.path.isabs(self.outdir):

            

Reported by Pylint.

src/third_party/scons-3.1.2/scons-local-3.1.2/SCons/Script/Main.py
295 issues
Instance of 'Stats' has no 'do_append' member
Error

Line: 507 Column: 23

                      self.print_stats = self.do_nothing
    def enable(self, outfp):
        self.outfp = outfp
        self.append = self.do_append
        self.print_stats = self.do_print
    def do_nothing(self, *args, **kw):
        pass

class CountStats(Stats):

            

Reported by Pylint.

Instance of 'Stats' has no 'do_print' member
Error

Line: 508 Column: 28

                  def enable(self, outfp):
        self.outfp = outfp
        self.append = self.do_append
        self.print_stats = self.do_print
    def do_nothing(self, *args, **kw):
        pass

class CountStats(Stats):
    def do_append(self, label):

            

Reported by Pylint.

Attempted relative import beyond top-level package
Error

Line: 1373 Column: 5

                  parts.append("Copyright (c) 2001 - 2019 The SCons Foundation")
    version = ''.join(parts)

    from . import SConsOptions
    parser = SConsOptions.Parser(version)
    values = SConsOptions.SConsValues(parser.get_default_values())

    OptionsParser = parser


            

Reported by Pylint.

Redefining name 'SCons' from outer scope (line 44)
Error

Line: 94 Column: 5

                  # cause warnings about local names shadowing use of the 'SCons'
    # global in nest scopes and UnboundLocalErrors and the like in some
    # versions (2.1) of Python.
    import SCons.Platform.win32
    return SCons.Platform.win32.parallel_msg


def revert_io():
    # This call is added to revert stderr and stdout to the original

            

Reported by Pylint.

Unused argument 'node'
Error

Line: 150 Column: 23

                          self.write(' ' * length + '\r')
            self.prev = ''

    def spinner(self, node):
        self.write(self.obj[self.count % len(self.obj)])

    def string(self, node):
        self.write(self.obj)


            

Reported by Pylint.

Unused argument 'node'
Error

Line: 153 Column: 22

                  def spinner(self, node):
        self.write(self.obj[self.count % len(self.obj)])

    def string(self, node):
        self.write(self.obj)

    def replace_string(self, node):
        self.write(self.obj.replace(self.target_string, str(node)))


            

Reported by Pylint.

Using the global statement
Error

Line: 169 Column: 5

              ProgressObject = SCons.Util.Null()

def Progress(*args, **kw):
    global ProgressObject
    ProgressObject = Progressor(*args, **kw)

# Task control.
#


            

Reported by Pylint.

Using the global statement
Error

Line: 203 Column: 13

                  def execute(self):
        if print_time:
            start_time = time.time()
            global first_command_start
            if first_command_start is None:
                first_command_start = start_time
        SCons.Taskmaster.OutOfDateTask.execute(self)
        if print_time:
            global cumulative_command_time

            

Reported by Pylint.

Using the global statement
Error

Line: 208 Column: 13

                              first_command_start = start_time
        SCons.Taskmaster.OutOfDateTask.execute(self)
        if print_time:
            global cumulative_command_time
            global last_command_end
            finish_time = time.time()
            last_command_end = finish_time
            cumulative_command_time = cumulative_command_time+finish_time-start_time
            if print_action_timestamps:

            

Reported by Pylint.

Using the global statement
Error

Line: 209 Column: 13

                      SCons.Taskmaster.OutOfDateTask.execute(self)
        if print_time:
            global cumulative_command_time
            global last_command_end
            finish_time = time.time()
            last_command_end = finish_time
            cumulative_command_time = cumulative_command_time+finish_time-start_time
            if print_action_timestamps:
                sys.stdout.write("Command execution start timestamp: %s: %f\n"%(str(self.node), start_time))

            

Reported by Pylint.