The following issues were found
src/third_party/scons-3.1.2/scons-local-3.1.2/SCons/Tool/swig.py
31 issues
Line: 128
Column: 32
if outdir:
java_files = [os.path.join(outdir, j) for j in java_files]
java_files = list(map(env.fs.File, java_files))
def t_from_s(t, p, s, x):
return t.dir
tsm = SCons.Node._target_from_source_map
tkey = len(tsm)
tsm[tkey] = t_from_s
for jf in java_files:
Reported by Pylint.
Line: 128
Column: 29
if outdir:
java_files = [os.path.join(outdir, j) for j in java_files]
java_files = list(map(env.fs.File, java_files))
def t_from_s(t, p, s, x):
return t.dir
tsm = SCons.Node._target_from_source_map
tkey = len(tsm)
tsm[tkey] = t_from_s
for jf in java_files:
Reported by Pylint.
Line: 128
Column: 35
if outdir:
java_files = [os.path.join(outdir, j) for j in java_files]
java_files = list(map(env.fs.File, java_files))
def t_from_s(t, p, s, x):
return t.dir
tsm = SCons.Node._target_from_source_map
tkey = len(tsm)
tsm[tkey] = t_from_s
for jf in java_files:
Reported by Pylint.
Line: 130
Column: 19
java_files = list(map(env.fs.File, java_files))
def t_from_s(t, p, s, x):
return t.dir
tsm = SCons.Node._target_from_source_map
tkey = len(tsm)
tsm[tkey] = t_from_s
for jf in java_files:
jf._func_target_from_source = tkey
target.extend(java_files)
Reported by Pylint.
Line: 134
Column: 17
tkey = len(tsm)
tsm[tkey] = t_from_s
for jf in java_files:
jf._func_target_from_source = tkey
target.extend(java_files)
return (target, source)
def _get_swig_version(env, swig):
"""Run the SWIG command line tool to get and return the version number"""
Reported by Pylint.
Line: 144
Column: 12
swig = env.subst(swig)
if not swig:
return version
pipe = SCons.Action._subproc(env, SCons.Util.CLVar(swig) + ['-version'],
stdin = 'devnull',
stderr = 'devnull',
stdout = subprocess.PIPE)
if pipe.wait() != 0:
return version
Reported by Pylint.
Line: 35
Column: 1
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#
__revision__ = "src/engine/SCons/Tool/swig.py bee7caf9defd6e108fc2998a2520ddb36a967691 2019-12-17 02:07:09 bdeegan"
import os.path
import sys
import re
import subprocess
Reported by Pylint.
Line: 40
Suggestion:
https://bandit.readthedocs.io/en/latest/blacklists/blacklist_imports.html#b404-import-subprocess
import os.path
import sys
import re
import subprocess
import SCons.Action
import SCons.Defaults
import SCons.Tool
import SCons.Util
Reported by Bandit.
Line: 48
Column: 1
import SCons.Util
import SCons.Node
verbose = False
swigs = [ 'swig', 'swig3.0', 'swig2.0' ]
SwigAction = SCons.Action.Action('$SWIGCOM', '$SWIGCOMSTR')
Reported by Pylint.
Line: 54
Column: 1
SwigAction = SCons.Action.Action('$SWIGCOM', '$SWIGCOMSTR')
def swigSuffixEmitter(env, source):
if '-c++' in SCons.Util.CLVar(env.subst("$SWIGFLAGS", source=source)):
return '$SWIGCXXFILESUFFIX'
else:
return '$SWIGCFILESUFFIX'
Reported by Pylint.
src/third_party/IntelRDFPMathLib20U1/LIBRARY/src/bid128_next.c
30 issues
Line: 132
CWE codes:
758
if (C1.w[0] >= 0x0020000000000000ull) { // x >= 2^53
// split the 64-bit value in two 32-bit halves to avoid rnd errors
if (C1.w[0] >= 0x0000000100000000ull) { // x >= 2^32
tmp1.d = (double) (C1.w[0] >> 32); // exact conversion
x_nr_bits =
33 + ((((unsigned int) (tmp1.ui64 >> 52)) & 0x7ff) -
0x3ff);
} else { // x < 2^32
tmp1.d = (double) (C1.w[0]); // exact conversion
Reported by Cppcheck.
Line: 134
CWE codes:
758
if (C1.w[0] >= 0x0000000100000000ull) { // x >= 2^32
tmp1.d = (double) (C1.w[0] >> 32); // exact conversion
x_nr_bits =
33 + ((((unsigned int) (tmp1.ui64 >> 52)) & 0x7ff) -
0x3ff);
} else { // x < 2^32
tmp1.d = (double) (C1.w[0]); // exact conversion
x_nr_bits =
1 + ((((unsigned int) (tmp1.ui64 >> 52)) & 0x7ff) -
Reported by Cppcheck.
Line: 139
CWE codes:
758
} else { // x < 2^32
tmp1.d = (double) (C1.w[0]); // exact conversion
x_nr_bits =
1 + ((((unsigned int) (tmp1.ui64 >> 52)) & 0x7ff) -
0x3ff);
}
} else { // if x < 2^53
tmp1.d = (double) C1.w[0]; // exact conversion
x_nr_bits =
Reported by Cppcheck.
Line: 145
CWE codes:
758
} else { // if x < 2^53
tmp1.d = (double) C1.w[0]; // exact conversion
x_nr_bits =
1 + ((((unsigned int) (tmp1.ui64 >> 52)) & 0x7ff) - 0x3ff);
}
} else { // C1.w[1] != 0 => nr. bits = 64 + nr_bits (C1.w[1])
tmp1.d = (double) C1.w[1]; // exact conversion
x_nr_bits =
65 + ((((unsigned int) (tmp1.ui64 >> 52)) & 0x7ff) - 0x3ff);
Reported by Cppcheck.
Line: 150
CWE codes:
758
} else { // C1.w[1] != 0 => nr. bits = 64 + nr_bits (C1.w[1])
tmp1.d = (double) C1.w[1]; // exact conversion
x_nr_bits =
65 + ((((unsigned int) (tmp1.ui64 >> 52)) & 0x7ff) - 0x3ff);
}
q1 = bid_nr_digits[x_nr_bits - 1].digits;
if (q1 == 0) {
q1 = bid_nr_digits[x_nr_bits - 1].digits1;
if (C1.w[1] > bid_nr_digits[x_nr_bits - 1].threshold_hi
Reported by Cppcheck.
Line: 162
CWE codes:
758
}
// if q1 < P34 then pad the significand with zeros
if (q1 < P34) {
exp = (x_exp >> 49) - 6176;
if (exp + 6176 > P34 - q1) {
ind = P34 - q1; // 1 <= ind <= P34 - 1
// pad with P34 - q1 zeros, until exponent = emin
// C1 = C1 * 10^ind
if (q1 <= 19) { // 64-bit C1
Reported by Cppcheck.
Line: 169
CWE codes:
758
// C1 = C1 * 10^ind
if (q1 <= 19) { // 64-bit C1
if (ind <= 19) { // 64-bit 10^ind and 64-bit C1
__mul_64x64_to_128MACH (C1, C1.w[0], bid_ten2k64[ind]);
} else { // 128-bit 10^ind and 64-bit C1
__mul_128x64_to_128 (C1, C1.w[0], bid_ten2k128[ind - 20]);
}
} else { // C1 is (most likely) 128-bit
if (ind <= 14) { // 64-bit 10^ind and 128-bit C1 (most likely)
Reported by Cppcheck.
Line: 171
CWE codes:
758
if (ind <= 19) { // 64-bit 10^ind and 64-bit C1
__mul_64x64_to_128MACH (C1, C1.w[0], bid_ten2k64[ind]);
} else { // 128-bit 10^ind and 64-bit C1
__mul_128x64_to_128 (C1, C1.w[0], bid_ten2k128[ind - 20]);
}
} else { // C1 is (most likely) 128-bit
if (ind <= 14) { // 64-bit 10^ind and 128-bit C1 (most likely)
__mul_128x64_to_128 (C1, bid_ten2k64[ind], C1);
} else if (ind <= 19) { // 64-bit 10^ind and 64-bit C1 (q1 <= 19)
Reported by Cppcheck.
Line: 175
CWE codes:
758
}
} else { // C1 is (most likely) 128-bit
if (ind <= 14) { // 64-bit 10^ind and 128-bit C1 (most likely)
__mul_128x64_to_128 (C1, bid_ten2k64[ind], C1);
} else if (ind <= 19) { // 64-bit 10^ind and 64-bit C1 (q1 <= 19)
__mul_64x64_to_128MACH (C1, C1.w[0], bid_ten2k64[ind]);
} else { // 128-bit 10^ind and 64-bit C1 (C1 must be 64-bit)
__mul_128x64_to_128 (C1, C1.w[0], bid_ten2k128[ind - 20]);
}
Reported by Cppcheck.
Line: 177
CWE codes:
758
if (ind <= 14) { // 64-bit 10^ind and 128-bit C1 (most likely)
__mul_128x64_to_128 (C1, bid_ten2k64[ind], C1);
} else if (ind <= 19) { // 64-bit 10^ind and 64-bit C1 (q1 <= 19)
__mul_64x64_to_128MACH (C1, C1.w[0], bid_ten2k64[ind]);
} else { // 128-bit 10^ind and 64-bit C1 (C1 must be 64-bit)
__mul_128x64_to_128 (C1, C1.w[0], bid_ten2k128[ind - 20]);
}
}
x_exp = x_exp - ((BID_UINT64) ind << 49);
Reported by Cppcheck.
jstests/free_mon/libs/mock_http_server.py
30 issues
Line: 13
Column: 1
import sys
import urllib.parse
import bson
from bson.codec_options import CodecOptions
from bson.json_util import dumps
import mock_http_common
# Pass this data out of band instead of storing it in FreeMonHandler since the
Reported by Pylint.
Line: 14
Column: 1
import urllib.parse
import bson
from bson.codec_options import CodecOptions
from bson.json_util import dumps
import mock_http_common
# Pass this data out of band instead of storing it in FreeMonHandler since the
# BaseHTTPRequestHandler does not call the methods as object methods but as class methods. This
Reported by Pylint.
Line: 15
Column: 1
import bson
from bson.codec_options import CodecOptions
from bson.json_util import dumps
import mock_http_common
# Pass this data out of band instead of storing it in FreeMonHandler since the
# BaseHTTPRequestHandler does not call the methods as object methods but as class methods. This
# means there is not self.
Reported by Pylint.
Line: 5
Column: 1
"""Mock Free Monitoring Endpoint."""
import argparse
import collections
import http.server
import json
import logging
import socketserver
import sys
Reported by Pylint.
Line: 7
Column: 1
import argparse
import collections
import http.server
import json
import logging
import socketserver
import sys
import urllib.parse
Reported by Pylint.
Line: 9
Column: 1
import http.server
import json
import logging
import socketserver
import sys
import urllib.parse
import bson
from bson.codec_options import CodecOptions
Reported by Pylint.
Line: 14
Column: 1
import urllib.parse
import bson
from bson.codec_options import CodecOptions
from bson.json_util import dumps
import mock_http_common
# Pass this data out of band instead of storing it in FreeMonHandler since the
# BaseHTTPRequestHandler does not call the methods as object methods but as class methods. This
Reported by Pylint.
Line: 99
Column: 9
self.end_headers()
def _do_registration(self):
global stats
global last_register
clen = int(self.headers.get('content-length'))
stats.register_calls += 1
Reported by Pylint.
Line: 100
Column: 9
def _do_registration(self):
global stats
global last_register
clen = int(self.headers.get('content-length'))
stats.register_calls += 1
raw_input = self.rfile.read(clen)
Reported by Pylint.
Line: 159
Column: 9
self.wfile.write(data)
def _do_metrics(self):
global stats
global last_metrics
clen = int(self.headers.get('content-length'))
stats.metrics_calls += 1
Reported by Pylint.
src/third_party/wiredtiger/lang/python/wiredtiger/intpacking.py
30 issues
Line: 32
Column: 1
from __future__ import print_function
import math, struct, sys
from wiredtiger.packutil import _chr, _ord, x00_entry, xff_entry
# Variable-length integer packing
# need: up to 64 bits, both signed and unsigned
#
# Try hard for small values (up to ~2 bytes), after that, just encode the
Reported by Pylint.
Line: 141
Column: 31
r1 = random.randint(-big, big)
r2 = random.randint(-big, big)
print("\rChecking %d, %d" % (r1, r2))
if cmp(r1, r2) != cmp(pack_int(r1), pack_int(r2)):
print("\nFound a problem with %d, %d" % (r1, r2))
break
print
Reported by Pylint.
Line: 141
Column: 16
r1 = random.randint(-big, big)
r2 = random.randint(-big, big)
print("\rChecking %d, %d" % (r1, r2))
if cmp(r1, r2) != cmp(pack_int(r1), pack_int(r2)):
print("\nFound a problem with %d, %d" % (r1, r2))
break
print
Reported by Pylint.
Line: 31
Column: 1
#
from __future__ import print_function
import math, struct, sys
from wiredtiger.packutil import _chr, _ord, x00_entry, xff_entry
# Variable-length integer packing
# need: up to 64 bits, both signed and unsigned
#
Reported by Pylint.
Line: 31
Column: 1
#
from __future__ import print_function
import math, struct, sys
from wiredtiger.packutil import _chr, _ord, x00_entry, xff_entry
# Variable-length integer packing
# need: up to 64 bits, both signed and unsigned
#
Reported by Pylint.
Line: 72
Column: 5
return (x & ((1 << start) - 1)) >> (end)
def get_int(b, size):
r = 0
for i in range(size):
r = (r << 8) | _ord(b[i])
return r
def pack_int(x):
Reported by Pylint.
Line: 73
Column: 9
def get_int(b, size):
r = 0
for i in range(size):
r = (r << 8) | _ord(b[i])
return r
def pack_int(x):
if x < NEG_2BYTE_MIN:
Reported by Pylint.
Line: 135
Column: 9
print("\nFound a problem with %d" % r)
break
print
for i in range(1000):
r1 = random.randint(-big, big)
r2 = random.randint(-big, big)
print("\rChecking %d, %d" % (r1, r2))
Reported by Pylint.
Line: 145
Column: 9
print("\nFound a problem with %d, %d" % (r1, r2))
break
print
Reported by Pylint.
Line: 1
Column: 1
#!/usr/bin/env python
#
# Public Domain 2014-present MongoDB, Inc.
# Public Domain 2008-2014 WiredTiger, Inc.
#
# This is free and unencumbered software released into the public domain.
#
# Anyone is free to copy, modify, publish, use, compile, sell, or
# distribute this software, either in source code form or as a compiled
Reported by Pylint.
src/third_party/wiredtiger/test/suite/test_checkpoint_snapshot02.py
30 issues
Line: 35
Column: 1
import wttest
from wtdataset import SimpleDataSet
from wtscenario import make_scenarios
from wiredtiger import stat
# test_checkpoint_snapshot02.py
# This test is to run checkpoint and eviction in parallel with timing
# stress for checkpoint and let eviction write more data than checkpoint.
#
Reported by Pylint.
Line: 54
Column: 5
scenarios = make_scenarios(key_format_values)
def conn_config(self):
config = 'cache_size=10MB,statistics=(all),statistics_log=(json,on_close,wait=1),log=(enabled=true),timing_stress_for_test=[checkpoint_slow]'
return config
def large_updates(self, uri, value, ds, nrows, commit_ts):
# Update a large number of records.
Reported by Pylint.
Line: 29
Column: 1
# ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
# OTHER DEALINGS IN THE SOFTWARE.
import fnmatch, os, shutil, threading, time
from wtthread import checkpoint_thread, op_thread
from helper import simulate_crash_restart
import wttest
from wtdataset import SimpleDataSet
from wtscenario import make_scenarios
Reported by Pylint.
Line: 29
Column: 1
# ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
# OTHER DEALINGS IN THE SOFTWARE.
import fnmatch, os, shutil, threading, time
from wtthread import checkpoint_thread, op_thread
from helper import simulate_crash_restart
import wttest
from wtdataset import SimpleDataSet
from wtscenario import make_scenarios
Reported by Pylint.
Line: 29
Column: 1
# ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
# OTHER DEALINGS IN THE SOFTWARE.
import fnmatch, os, shutil, threading, time
from wtthread import checkpoint_thread, op_thread
from helper import simulate_crash_restart
import wttest
from wtdataset import SimpleDataSet
from wtscenario import make_scenarios
Reported by Pylint.
Line: 30
Column: 1
# OTHER DEALINGS IN THE SOFTWARE.
import fnmatch, os, shutil, threading, time
from wtthread import checkpoint_thread, op_thread
from helper import simulate_crash_restart
import wttest
from wtdataset import SimpleDataSet
from wtscenario import make_scenarios
from wiredtiger import stat
Reported by Pylint.
Line: 79
Column: 13
session.begin_transaction('read_timestamp=' + self.timestamp_str(read_ts))
cursor = session.open_cursor(uri)
count = 0
for k, v in cursor:
self.assertEqual(v, check_value)
count += 1
session.commit_transaction()
self.assertEqual(count, nrows)
Reported by Pylint.
Line: 188
Column: 9
ds = SimpleDataSet(self, self.uri, 0, key_format="S", value_format="S",config='log=(enabled=false)')
ds.populate()
valuea = "aaaaa" * 100
valueb = "bbbbb" * 100
# Pin oldest and stable timestamps to 10.
self.conn.set_timestamp('oldest_timestamp=' + self.timestamp_str(10) +
',stable_timestamp=' + self.timestamp_str(10))
Reported by Pylint.
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.
Line: 29
Column: 1
# ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
# OTHER DEALINGS IN THE SOFTWARE.
import fnmatch, os, shutil, threading, time
from wtthread import checkpoint_thread, op_thread
from helper import simulate_crash_restart
import wttest
from wtdataset import SimpleDataSet
from wtscenario import make_scenarios
Reported by Pylint.
src/third_party/IntelRDFPMathLib20U1/LIBRARY/src/bid32_to_uint64.c
30 issues
Line: 131
CWE codes:
758
// <=> C * 10^(21-q) >= 0x9fffffffffffffffb, 1<=q<=7
if (q == 1) {
// C * 10^20 >= 0x9fffffffffffffffb
__mul_128x64_to_128 (C, (BID_UINT64)C1, bid_ten2k128[0]); // 10^20 * C
if (C.w[1] > 0x09 ||
(C.w[1] == 0x09 && C.w[0] >= 0xfffffffffffffffbull)) {
// set invalid flag
*pfpsf |= BID_INVALID_EXCEPTION;
// return Integer Indefinite
Reported by Cppcheck.
Line: 145
CWE codes:
758
} else { // if (2 <= q <= 7) => 14 <= 21 - q <= 19
// Note: C * 10^(21-q) has 20 or 21 digits; 0x9fffffffffffffffb
// has 21 digits
__mul_64x64_to_128MACH (C, (BID_UINT64)C1, bid_ten2k64[21 - q]);
if (C.w[1] > 0x09 ||
(C.w[1] == 0x09 && C.w[0] >= 0xfffffffffffffffbull)) {
// set invalid flag
*pfpsf |= BID_INVALID_EXCEPTION;
// return Integer Indefinite
Reported by Cppcheck.
Line: 207
CWE codes:
758
// kx = 10^(-x) = bid_ten2mk64[ind - 1]
// C* = (C1 + 1/2 * 10^x) * 10^(-x)
// the approximation of 10^(-x) was rounded up to 54 bits
__mul_64x64_to_128MACH (P128, (BID_UINT64)C1, bid_ten2mk64[ind - 1]);
Cstar = P128.w[1];
fstar.w[1] = P128.w[1] & bid_maskhigh128[ind - 1];
fstar.w[0] = P128.w[0];
// the top Ex bits of 10^(-x) are T* = bid_ten2mk128trunc[ind].w[0], e.g.
// if x=1, T*=bid_ten2mk128trunc[0].w[0]=0x1999999999999999
Reported by Cppcheck.
Line: 353
CWE codes:
758
// <=> C * 10^(21-q) >= 0x9fffffffffffffffb, 1<=q<=7
if (q == 1) {
// C * 10^20 >= 0x9fffffffffffffffb
__mul_128x64_to_128 (C, (BID_UINT64)C1, bid_ten2k128[0]); // 10^20 * C
if (C.w[1] > 0x09 ||
(C.w[1] == 0x09 && C.w[0] >= 0xfffffffffffffffbull)) {
// set invalid flag
*pfpsf |= BID_INVALID_EXCEPTION;
// return Integer Indefinite
Reported by Cppcheck.
Line: 367
CWE codes:
758
} else { // if (2 <= q <= 7) => 14 <= 21 - q <= 19
// Note: C * 10^(21-q) has 20 or 21 digits; 0x9fffffffffffffffb
// has 21 digits
__mul_64x64_to_128MACH (C, (BID_UINT64)C1, bid_ten2k64[21 - q]);
if (C.w[1] > 0x09 ||
(C.w[1] == 0x09 && C.w[0] >= 0xfffffffffffffffbull)) {
// set invalid flag
*pfpsf |= BID_INVALID_EXCEPTION;
// return Integer Indefinite
Reported by Cppcheck.
Line: 433
CWE codes:
758
// kx = 10^(-x) = bid_ten2mk64[ind - 1]
// C* = (C1 + 1/2 * 10^x) * 10^(-x)
// the approximation of 10^(-x) was rounded up to 54 bits
__mul_64x64_to_128MACH (P128, (BID_UINT64)C1, bid_ten2mk64[ind - 1]);
Cstar = P128.w[1];
fstar.w[1] = P128.w[1] & bid_maskhigh128[ind - 1];
fstar.w[0] = P128.w[0];
// the top Ex bits of 10^(-x) are T* = bid_ten2mk128trunc[ind].w[0], e.g.
// if x=1, T*=bid_ten2mk128trunc[0].w[0]=0x1999999999999999
Reported by Cppcheck.
Line: 614
CWE codes:
758
// <=> C * 10^(21-q) >= 0xa0000000000000000, 1<=q<=7
if (q == 1) {
// C * 10^20 >= 0xa0000000000000000
__mul_128x64_to_128 (C, (BID_UINT64)C1, bid_ten2k128[0]); // 10^20 * C
if (C.w[1] >= 0x0a) {
// actually C.w[1] == 0x0a && C.w[0] >= 0x0000000000000000ull) {
// set invalid flag
*pfpsf |= BID_INVALID_EXCEPTION;
// return Integer Indefinite
Reported by Cppcheck.
Line: 628
CWE codes:
758
} else { // if (2 <= q <= 7) => 14 <= 21 - q <= 19
// Note: C * 10^(21-q) has 20 or 21 digits; 0xa0000000000000000
// has 21 digits
__mul_64x64_to_128MACH (C, (BID_UINT64)C1, bid_ten2k64[21 - q]);
if (C.w[1] >= 0x0a) {
// actually C.w[1] == 0x0a && C.w[0] >= 0x0000000000000000ull) {
// set invalid flag
*pfpsf |= BID_INVALID_EXCEPTION;
// return Integer Indefinite
Reported by Cppcheck.
Line: 662
CWE codes:
758
// kx = 10^(-x) = bid_ten2mk64[ind - 1]
// C* = C1 * 10^(-x)
// the approximation of 10^(-x) was rounded up to 54 bits
__mul_64x64_to_128MACH (P128, (BID_UINT64)C1, bid_ten2mk64[ind - 1]);
Cstar = P128.w[1];
// the top Ex bits of 10^(-x) are T* = bid_ten2mk128trunc[ind].w[0], e.g.
// if x=1, T*=bid_ten2mk128trunc[0].w[0]=0x1999999999999999
// C* = floor(C*) (logical right shift; C has p decimal digits,
// correct by Property 1)
Reported by Cppcheck.
Line: 786
CWE codes:
758
// <=> C * 10^(21-q) >= 0xa0000000000000000, 1<=q<=7
if (q == 1) {
// C * 10^20 >= 0xa0000000000000000
__mul_128x64_to_128 (C, (BID_UINT64)C1, bid_ten2k128[0]); // 10^20 * C
if (C.w[1] >= 0x0a) {
// actually C.w[1] == 0x0a && C.w[0] >= 0x0000000000000000ull) {
// set invalid flag
*pfpsf |= BID_INVALID_EXCEPTION;
// return Integer Indefinite
Reported by Cppcheck.
src/third_party/wiredtiger/test/suite/test_checkpoint_snapshot03.py
30 issues
Line: 36
Column: 1
import fnmatch, os, shutil, threading, time
from wtthread import checkpoint_thread, op_thread
from helper import simulate_crash_restart
import wiredtiger, wttest
from wtdataset import SimpleDataSet
from wtscenario import make_scenarios
from wiredtiger import stat
# test_checkpoint_snapshot03.py
Reported by Pylint.
Line: 39
Column: 1
import wiredtiger, wttest
from wtdataset import SimpleDataSet
from wtscenario import make_scenarios
from wiredtiger import stat
# test_checkpoint_snapshot03.py
# This test is to check RTS skips the unnecessary pages when the table has more than the
# checkpoint snapshot.
class test_checkpoint_snapshot03(wttest.WiredTigerTestCase):
Reported by Pylint.
Line: 50
Column: 5
uri = "table:test_checkpoint_snapshot03"
nrows = 500000
def conn_config(self):
config = 'cache_size=250MB,statistics=(all),statistics_log=(json,on_close,wait=1),log=(enabled=true)'
return config
def large_updates(self, uri, value, ds, nrows):
# Update a large number of records.
Reported by Pylint.
Line: 33
Column: 1
# rollback_to_stable
# [END_TAGS]
import fnmatch, os, shutil, threading, time
from wtthread import checkpoint_thread, op_thread
from helper import simulate_crash_restart
import wiredtiger, wttest
from wtdataset import SimpleDataSet
from wtscenario import make_scenarios
Reported by Pylint.
Line: 33
Column: 1
# rollback_to_stable
# [END_TAGS]
import fnmatch, os, shutil, threading, time
from wtthread import checkpoint_thread, op_thread
from helper import simulate_crash_restart
import wiredtiger, wttest
from wtdataset import SimpleDataSet
from wtscenario import make_scenarios
Reported by Pylint.
Line: 33
Column: 1
# rollback_to_stable
# [END_TAGS]
import fnmatch, os, shutil, threading, time
from wtthread import checkpoint_thread, op_thread
from helper import simulate_crash_restart
import wiredtiger, wttest
from wtdataset import SimpleDataSet
from wtscenario import make_scenarios
Reported by Pylint.
Line: 33
Column: 1
# rollback_to_stable
# [END_TAGS]
import fnmatch, os, shutil, threading, time
from wtthread import checkpoint_thread, op_thread
from helper import simulate_crash_restart
import wiredtiger, wttest
from wtdataset import SimpleDataSet
from wtscenario import make_scenarios
Reported by Pylint.
Line: 33
Column: 1
# rollback_to_stable
# [END_TAGS]
import fnmatch, os, shutil, threading, time
from wtthread import checkpoint_thread, op_thread
from helper import simulate_crash_restart
import wiredtiger, wttest
from wtdataset import SimpleDataSet
from wtscenario import make_scenarios
Reported by Pylint.
Line: 34
Column: 1
# [END_TAGS]
import fnmatch, os, shutil, threading, time
from wtthread import checkpoint_thread, op_thread
from helper import simulate_crash_restart
import wiredtiger, wttest
from wtdataset import SimpleDataSet
from wtscenario import make_scenarios
from wiredtiger import stat
Reported by Pylint.
Line: 34
Column: 1
# [END_TAGS]
import fnmatch, os, shutil, threading, time
from wtthread import checkpoint_thread, op_thread
from helper import simulate_crash_restart
import wiredtiger, wttest
from wtdataset import SimpleDataSet
from wtscenario import make_scenarios
from wiredtiger import stat
Reported by Pylint.
src/third_party/wiredtiger/test/suite/test_schema06.py
30 issues
Line: 29
Column: 1
# ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
# OTHER DEALINGS IN THE SOFTWARE.
import wiredtiger, wttest
from wtscenario import make_scenarios
# test_schema06.py
# Repeatedly create and drop indices
class test_schema06(wttest.WiredTigerTestCase):
Reported by Pylint.
Line: 29
Column: 1
# ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
# OTHER DEALINGS IN THE SOFTWARE.
import wiredtiger, wttest
from wtscenario import make_scenarios
# test_schema06.py
# Repeatedly create and drop indices
class test_schema06(wttest.WiredTigerTestCase):
Reported by Pylint.
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.
Line: 29
Column: 1
# ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
# OTHER DEALINGS IN THE SOFTWARE.
import wiredtiger, wttest
from wtscenario import make_scenarios
# test_schema06.py
# Repeatedly create and drop indices
class test_schema06(wttest.WiredTigerTestCase):
Reported by Pylint.
Line: 34
Column: 1
# test_schema06.py
# Repeatedly create and drop indices
class test_schema06(wttest.WiredTigerTestCase):
"""
Test basic operations
"""
nentries = 1000
Reported by Pylint.
Line: 45
Column: 5
('lsm', { 'idx_config' : ',type=lsm' }),
])
def flip(self, inum, val):
"""
Defines a unique transformation of values for each index number.
We reverse digits so the generated values are not perfectly ordered.
"""
newval = str((inum + 1) * val)
Reported by Pylint.
Line: 53
Column: 5
newval = str((inum + 1) * val)
return newval[::-1] # reversed digits
def unflip(self, inum, flipped):
"""
The inverse of flip.
"""
newval = flipped[::-1]
return int(newval)/(inum + 1)
Reported by Pylint.
Line: 60
Column: 5
newval = flipped[::-1]
return int(newval)/(inum + 1)
def create_index(self, inum):
colname = "s" + str(inum)
self.session.create("index:schema06:" + colname,
"columns=(" + colname + ")" + self.idx_config)
def drop_index(self, inum):
Reported by Pylint.
Line: 65
Column: 5
self.session.create("index:schema06:" + colname,
"columns=(" + colname + ")" + self.idx_config)
def drop_index(self, inum):
colname = "s" + str(inum)
self.session.drop("index:schema06:" + colname, None)
def test_index_stress(self):
self.session.create("table:schema06",
Reported by Pylint.
Line: 69
Column: 5
colname = "s" + str(inum)
self.session.drop("index:schema06:" + colname, None)
def test_index_stress(self):
self.session.create("table:schema06",
"key_format=S,value_format=SSSSSS," +
"columns=(key,s0,s1,s2,s3,s4,s5),colgroups=(c1,c2)")
self.create_index(0)
Reported by Pylint.
src/third_party/IntelRDFPMathLib20U1/LIBRARY/src/bid32_to_int64.c
30 issues
Line: 124
CWE codes:
758
// <=> 0.c(0)c(1)...c(q-1) * 10^20 > 0x50000000000000005, 1<=q<=7
// <=> C * 10^(20-q) > 0x50000000000000005, 1<=q<=7
// 1 <= q <= 7 => 13 <= 20-q <= 19 => 10^(20-q) is 64-bit, and so is C1
__mul_64x64_to_128MACH (C, (BID_UINT64)C1, bid_ten2k64[20 - q]);
// Note: C1 * 10^(11-q) has 19 or 20 digits; 0x50000000000000005, has 20
if (C.w[1] > 0x05ull || (C.w[1] == 0x05ull && C.w[0] > 0x05ull)) {
// set invalid flag
*pfpsf |= BID_INVALID_EXCEPTION;
// return Integer Indefinite
Reported by Cppcheck.
Line: 143
CWE codes:
758
C.w[1] = 0x0000000000000004ull;
C.w[0] = 0xfffffffffffffffbull;
// 1 <= q <= 7 => 13 <= 20-q <= 19 => 10^(20-q) is 64-bit, and so is C1
__mul_64x64_to_128MACH (C, (BID_UINT64)C1, bid_ten2k64[20 - q]);
if (C.w[1] > 0x04ull ||
(C.w[1] == 0x04ull && C.w[0] >= 0xfffffffffffffffbull)) {
// set invalid flag
*pfpsf |= BID_INVALID_EXCEPTION;
// return Integer Indefinite
Reported by Cppcheck.
Line: 192
CWE codes:
758
// kx = 10^(-x) = bid_ten2mk64[ind - 1]
// C* = (C1 + 1/2 * 10^x) * 10^(-x)
// the approximation of 10^(-x) was rounded up to 54 bits
__mul_64x64_to_128MACH (P128, (BID_UINT64)C1, bid_ten2mk64[ind - 1]);
Cstar = P128.w[1];
fstar.w[1] = P128.w[1] & bid_maskhigh128[ind - 1];
fstar.w[0] = P128.w[0];
// the top Ex bits of 10^(-x) are T* = bid_ten2mk128trunc[ind].w[0], e.g.
// if x=1, T*=bid_ten2mk128trunc[0].w[0]=0x1999999999999999
Reported by Cppcheck.
Line: 342
CWE codes:
758
// <=> 0.c(0)c(1)...c(q-1) * 10^20 > 0x50000000000000005, 1<=q<=7
// <=> C * 10^(20-q) > 0x50000000000000005, 1<=q<=7
// 1 <= q <= 7 => 13 <= 20-q <= 19 => 10^(20-q) is 64-bit, and so is C1
__mul_64x64_to_128MACH (C, (BID_UINT64)C1, bid_ten2k64[20 - q]);
// Note: C1 * 10^(11-q) has 19 or 20 digits; 0x50000000000000005, has 20
if (C.w[1] > 0x05ull || (C.w[1] == 0x05ull && C.w[0] > 0x05ull)) {
// set invalid flag
*pfpsf |= BID_INVALID_EXCEPTION;
// return Integer Indefinite
Reported by Cppcheck.
Line: 361
CWE codes:
758
C.w[1] = 0x0000000000000004ull;
C.w[0] = 0xfffffffffffffffbull;
// 1 <= q <= 7 => 13 <= 20-q <= 19 => 10^(20-q) is 64-bit, and so is C1
__mul_64x64_to_128MACH (C, (BID_UINT64)C1, bid_ten2k64[20 - q]);
if (C.w[1] > 0x04ull ||
(C.w[1] == 0x04ull && C.w[0] >= 0xfffffffffffffffbull)) {
// set invalid flag
*pfpsf |= BID_INVALID_EXCEPTION;
// return Integer Indefinite
Reported by Cppcheck.
Line: 414
CWE codes:
758
// kx = 10^(-x) = bid_ten2mk64[ind - 1]
// C* = (C1 + 1/2 * 10^x) * 10^(-x)
// the approximation of 10^(-x) was rounded up to 54 bits
__mul_64x64_to_128MACH (P128, (BID_UINT64)C1, bid_ten2mk64[ind - 1]);
Cstar = P128.w[1];
fstar.w[1] = P128.w[1] & bid_maskhigh128[ind - 1];
fstar.w[0] = P128.w[0];
// the top Ex bits of 10^(-x) are T* = bid_ten2mk128trunc[ind].w[0], e.g.
// if x=1, T*=bid_ten2mk128trunc[0].w[0]=0x1999999999999999
Reported by Cppcheck.
Line: 599
CWE codes:
758
// <=> 0.c(0)c(1)...c(q-1) * 10^20 > 0x50000000000000000, 1<=q<=7
// <=> C * 10^(20-q) > 0x50000000000000000, 1<=q<=7
// 1 <= q <= 7 => 13 <= 20-q <= 19 => 10^(20-q) is 64-bit, and so is C1
__mul_64x64_to_128MACH (C, (BID_UINT64)C1, bid_ten2k64[20 - q]);
// Note: C1 * 10^(11-q) has 19 or 20 digits; 0x5000000000000000a, has 20
if (C.w[1] > 0x05ull || (C.w[1] == 0x05ull && C.w[0] != 0)) {
// set invalid flag
*pfpsf |= BID_INVALID_EXCEPTION;
// return Integer Indefinite
Reported by Cppcheck.
Line: 618
CWE codes:
758
C.w[1] = 0x0000000000000005ull;
C.w[0] = 0x0000000000000000ull;
// 1 <= q <= 7 => 13 <= 20-q <= 19 => 10^(20-q) is 64-bit, and so is C1
__mul_64x64_to_128MACH (C, (BID_UINT64)C1, bid_ten2k64[20 - q]);
if (C.w[1] >= 0x05ull) {
// actually C.w[1] == 0x05ull && C.w[0] >= 0x0000000000000000ull) {
// set invalid flag
*pfpsf |= BID_INVALID_EXCEPTION;
// return Integer Indefinite
Reported by Cppcheck.
Line: 656
CWE codes:
758
// kx = 10^(-x) = bid_ten2mk64[ind - 1]
// C* = C1 * 10^(-x)
// the approximation of 10^(-x) was rounded up to 54 bits
__mul_64x64_to_128MACH (P128, (BID_UINT64)C1, bid_ten2mk64[ind - 1]);
Cstar = P128.w[1];
fstar.w[1] = P128.w[1] & bid_maskhigh128[ind - 1];
fstar.w[0] = P128.w[0];
// the top Ex bits of 10^(-x) are T* = bid_ten2mk128trunc[ind].w[0], e.g.
// if x=1, T*=bid_ten2mk128trunc[0].w[0]=0x1999999999999999
Reported by Cppcheck.
Line: 808
CWE codes:
758
// <=> 0.c(0)c(1)...c(q-1) * 10^20 > 0x50000000000000000, 1<=q<=7
// <=> C * 10^(20-q) > 0x50000000000000000, 1<=q<=7
// 1 <= q <= 7 => 13 <= 20-q <= 19 => 10^(20-q) is 64-bit, and so is C1
__mul_64x64_to_128MACH (C, (BID_UINT64)C1, bid_ten2k64[20 - q]);
// Note: C1 * 10^(11-q) has 19 or 20 digits; 0x5000000000000000a, has 20
if (C.w[1] > 0x05ull || (C.w[1] == 0x05ull && C.w[0] != 0)) {
// set invalid flag
*pfpsf |= BID_INVALID_EXCEPTION;
// return Integer Indefinite
Reported by Cppcheck.
src/third_party/wiredtiger/test/suite/wtthread.py
30 issues
Line: 29
Column: 1
# ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
# OTHER DEALINGS IN THE SOFTWARE.
import os, queue, shutil, sys, threading, time, wiredtiger, wttest
from helper import compare_tables
class checkpoint_thread(threading.Thread):
def __init__(self, conn, done):
self.conn = conn
Reported by Pylint.
Line: 29
Column: 1
# ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
# OTHER DEALINGS IN THE SOFTWARE.
import os, queue, shutil, sys, threading, time, wiredtiger, wttest
from helper import compare_tables
class checkpoint_thread(threading.Thread):
def __init__(self, conn, done):
self.conn = conn
Reported by Pylint.
Line: 161
Column: 25
sess = self.conn.open_session()
c = sess.open_cursor(self.uris[0], None, None)
elif op == 'd': # Drop a table. The uri identifier is in key
for i in range(10):
try:
sess.drop(self.uris[0] + str(key))
break
except wiredtiger.WiredTigerError as e:
continue
Reported by Pylint.
Line: 165
Column: 25
try:
sess.drop(self.uris[0] + str(key))
break
except wiredtiger.WiredTigerError as e:
continue
elif op == 't': # Create a table, add an entry
sess.create(self.uris[0] + str(key),
"key_format=" + self.key_fmt + ",value_format=S")
try:
Reported by Pylint.
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.
Line: 29
Column: 1
# ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
# OTHER DEALINGS IN THE SOFTWARE.
import os, queue, shutil, sys, threading, time, wiredtiger, wttest
from helper import compare_tables
class checkpoint_thread(threading.Thread):
def __init__(self, conn, done):
self.conn = conn
Reported by Pylint.
Line: 29
Column: 1
# ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
# OTHER DEALINGS IN THE SOFTWARE.
import os, queue, shutil, sys, threading, time, wiredtiger, wttest
from helper import compare_tables
class checkpoint_thread(threading.Thread):
def __init__(self, conn, done):
self.conn = conn
Reported by Pylint.
Line: 32
Column: 1
import os, queue, shutil, sys, threading, time, wiredtiger, wttest
from helper import compare_tables
class checkpoint_thread(threading.Thread):
def __init__(self, conn, done):
self.conn = conn
self.done = done
threading.Thread.__init__(self)
Reported by Pylint.
Line: 32
Column: 1
import os, queue, shutil, sys, threading, time, wiredtiger, wttest
from helper import compare_tables
class checkpoint_thread(threading.Thread):
def __init__(self, conn, done):
self.conn = conn
self.done = done
threading.Thread.__init__(self)
Reported by Pylint.
Line: 46
Column: 1
sess.checkpoint()
sess.close()
class flush_tier_thread(threading.Thread):
def __init__(self, conn, done):
self.conn = conn
self.done = done
threading.Thread.__init__(self)
Reported by Pylint.