The following issues were found
src/third_party/wiredtiger/test/suite/hook_demo.py
16 issues
Line: 59
Column: 5
# Print to /dev/tty for debugging, since anything extraneous to stdout/stderr will
# cause a test error.
def tty(s):
WiredTigerTestCase.tty(s)
# These are the hook functions that are run when particular APIs are called.
# Called to manipulate args for wiredtiger_open
def wiredtiger_open_args(ignored_self, args):
Reported by Pylint.
Line: 53
Column: 1
# hooked method.
from __future__ import print_function
import os, sys, wthooks
from wttest import WiredTigerTestCase
# Print to /dev/tty for debugging, since anything extraneous to stdout/stderr will
# cause a test error.
def tty(s):
Reported by Pylint.
Line: 53
Column: 1
# hooked method.
from __future__ import print_function
import os, sys, wthooks
from wttest import WiredTigerTestCase
# Print to /dev/tty for debugging, since anything extraneous to stdout/stderr will
# cause a test error.
def tty(s):
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: 53
Column: 1
# hooked method.
from __future__ import print_function
import os, sys, wthooks
from wttest import WiredTigerTestCase
# Print to /dev/tty for debugging, since anything extraneous to stdout/stderr will
# cause a test error.
def tty(s):
Reported by Pylint.
Line: 58
Column: 1
# Print to /dev/tty for debugging, since anything extraneous to stdout/stderr will
# cause a test error.
def tty(s):
WiredTigerTestCase.tty(s)
# These are the hook functions that are run when particular APIs are called.
# Called to manipulate args for wiredtiger_open
Reported by Pylint.
Line: 58
Column: 1
# Print to /dev/tty for debugging, since anything extraneous to stdout/stderr will
# cause a test error.
def tty(s):
WiredTigerTestCase.tty(s)
# These are the hook functions that are run when particular APIs are called.
# Called to manipulate args for wiredtiger_open
Reported by Pylint.
Line: 64
Column: 1
# These are the hook functions that are run when particular APIs are called.
# Called to manipulate args for wiredtiger_open
def wiredtiger_open_args(ignored_self, args):
tty('>>> wiredtiger_open, adding cache_size')
args = list(args) # convert from a readonly tuple to a writeable list
args[-1] += ',,,cache_size=500M,,,' # modify the last arg
return args
Reported by Pylint.
Line: 71
Column: 1
return args
# Called to notify after successful wiredtiger_open
def wiredtiger_open_notify(ignored_self, ret, *args):
tty('>>> wiredtiger_open({}) returned {}'.format(args, ret))
# Called to notify after successful Session.open_cursor
def session_open_cursor_notify(self, ret, *args):
tty('>>> session.open_cursor({}) returned {}, session is {}'.format(args, ret, self))
Reported by Pylint.
Line: 75
Column: 1
tty('>>> wiredtiger_open({}) returned {}'.format(args, ret))
# Called to notify after successful Session.open_cursor
def session_open_cursor_notify(self, ret, *args):
tty('>>> session.open_cursor({}) returned {}, session is {}'.format(args, ret, self))
# Called to replace Session.create
# We do different things (described above) as indicated by our command line argument.
def session_create_replace(arg, orig_session_create, session_self, uri, config):
Reported by Pylint.
src/mongo/db/storage/ephemeral_for_test/ephemeral_for_test_sorted_impl.cpp
16 issues
Line: 102
Column: 14
CWE codes:
120
Suggestion:
Make sure destination can always hold the source data
public:
UniqueIndexData() : _size(0), _begin(nullptr), _end(nullptr), _keyFormat(KeyFormat::Long) {}
UniqueIndexData(const std::string& indexData, KeyFormat keyFormat) {
std::memcpy(&_size, indexData.data(), sizeof(uint64_t));
_begin = reinterpret_cast<const uint8_t*>(indexData.data() + sizeof(uint64_t));
_end = reinterpret_cast<const uint8_t*>(indexData.data() + indexData.size());
_keyFormat = keyFormat;
}
Reported by FlawFinder.
Line: 179
Column: 10
CWE codes:
120
Suggestion:
Make sure destination can always hold the source data
size_t IndexDataEntry::size() const {
// [RecordId size, RecordId, TypeBits size, TypeBits]
size_t ridSize;
std::memcpy(&ridSize, _buffer, sizeof(size_t));
int len = sizeof(size_t) + ridSize;
size_t typeBitsSize;
std::memcpy(&typeBitsSize, _buffer + len, sizeof(size_t));
Reported by FlawFinder.
Line: 183
Column: 10
CWE codes:
120
Suggestion:
Make sure destination can always hold the source data
int len = sizeof(size_t) + ridSize;
size_t typeBitsSize;
std::memcpy(&typeBitsSize, _buffer + len, sizeof(size_t));
len += sizeof(size_t) + typeBitsSize;
return len;
}
Reported by FlawFinder.
Line: 192
Column: 10
CWE codes:
120
Suggestion:
Make sure destination can always hold the source data
RecordId IndexDataEntry::loc() const {
// [RecordId size, RecordId, TypeBits size, TypeBits]
size_t ridSize;
std::memcpy(&ridSize, _buffer, sizeof(size_t));
const uint8_t* ridStart = _buffer + sizeof(size_t);
if (KeyFormat::Long == _keyFormat) {
int64_t repr;
std::memcpy(&repr, ridStart, ridSize);
return RecordId(repr);
Reported by FlawFinder.
Line: 196
Column: 14
CWE codes:
120
Suggestion:
Make sure destination can always hold the source data
const uint8_t* ridStart = _buffer + sizeof(size_t);
if (KeyFormat::Long == _keyFormat) {
int64_t repr;
std::memcpy(&repr, ridStart, ridSize);
return RecordId(repr);
} else {
return RecordId(reinterpret_cast<const char*>(ridStart), ridSize);
}
}
Reported by FlawFinder.
Line: 206
Column: 10
CWE codes:
120
Suggestion:
Make sure destination can always hold the source data
KeyString::TypeBits IndexDataEntry::typeBits() const {
// [RecordId size, RecordId, TypeBits size, TypeBits]
size_t ridSize;
std::memcpy(&ridSize, _buffer, sizeof(size_t));
int len = sizeof(size_t) + ridSize;
size_t typeBitsSize;
std::memcpy(&typeBitsSize, _buffer + len, sizeof(size_t));
Reported by FlawFinder.
Line: 210
Column: 10
CWE codes:
120
Suggestion:
Make sure destination can always hold the source data
int len = sizeof(size_t) + ridSize;
size_t typeBitsSize;
std::memcpy(&typeBitsSize, _buffer + len, sizeof(size_t));
len += sizeof(size_t);
BufReader reader(_buffer + len, typeBitsSize);
return KeyString::TypeBits::fromBuffer(KeyString::Version::kLatestVersion, &reader);
Reported by FlawFinder.
Line: 263
Column: 10
CWE codes:
120
Suggestion:
Make sure destination can always hold the source data
// Write number of entries
uint64_t num = size() + 1;
std::memcpy(pos, &num, sizeof(num));
pos += sizeof(num);
// Write old entries smaller than the new one
if (auto bytes = itBuffer - _begin) {
std::memcpy(pos, _begin, bytes);
Reported by FlawFinder.
Line: 268
Column: 14
CWE codes:
120
Suggestion:
Make sure destination can always hold the source data
// Write old entries smaller than the new one
if (auto bytes = itBuffer - _begin) {
std::memcpy(pos, _begin, bytes);
pos += bytes;
}
// Write new entry
std::memcpy(pos, entry.data(), entry.size());
Reported by FlawFinder.
Line: 273
Column: 10
CWE codes:
120
Suggestion:
Make sure destination can always hold the source data
}
// Write new entry
std::memcpy(pos, entry.data(), entry.size());
pos += entry.size();
// Write old entries larger than the new one
if (auto bytes = _end - itBuffer) {
std::memcpy(pos, itBuffer, bytes);
Reported by FlawFinder.
src/third_party/gperftools/dist/src/heap-profiler.cc
16 issues
Line: 279
Column: 7
CWE codes:
134
Suggestion:
Use a constant for the format specification
if (FLAGS_heap_profile_allocation_interval > 0 &&
total.alloc_size >=
last_dump_alloc + FLAGS_heap_profile_allocation_interval) {
snprintf(buf, sizeof(buf), ("%" PRId64 " MB allocated cumulatively, "
"%" PRId64 " MB currently in use"),
total.alloc_size >> 20, inuse_bytes >> 20);
need_to_dump = true;
} else if (FLAGS_heap_profile_deallocation_interval > 0 &&
total.free_size >=
Reported by FlawFinder.
Line: 286
Column: 7
CWE codes:
134
Suggestion:
Use a constant for the format specification
} else if (FLAGS_heap_profile_deallocation_interval > 0 &&
total.free_size >=
last_dump_free + FLAGS_heap_profile_deallocation_interval) {
snprintf(buf, sizeof(buf), ("%" PRId64 " MB freed cumulatively, "
"%" PRId64 " MB currently in use"),
total.free_size >> 20, inuse_bytes >> 20);
need_to_dump = true;
} else if (FLAGS_heap_profile_inuse_interval > 0 &&
inuse_bytes >
Reported by FlawFinder.
Line: 603
Column: 9
CWE codes:
134
Suggestion:
Use a constant for the format specification
const int64 inuse_bytes = total.alloc_size - total.free_size;
if ((inuse_bytes >> 20) > 0) {
snprintf(buf, sizeof(buf), ("Exiting, %" PRId64 " MB in use"),
inuse_bytes >> 20);
} else if ((inuse_bytes >> 10) > 0) {
snprintf(buf, sizeof(buf), ("Exiting, %" PRId64 " kB in use"),
inuse_bytes >> 10);
} else {
Reported by FlawFinder.
Line: 606
Column: 9
CWE codes:
134
Suggestion:
Use a constant for the format specification
snprintf(buf, sizeof(buf), ("Exiting, %" PRId64 " MB in use"),
inuse_bytes >> 20);
} else if ((inuse_bytes >> 10) > 0) {
snprintf(buf, sizeof(buf), ("Exiting, %" PRId64 " kB in use"),
inuse_bytes >> 10);
} else {
snprintf(buf, sizeof(buf), ("Exiting, %" PRId64 " bytes in use"),
inuse_bytes);
}
Reported by FlawFinder.
Line: 609
Column: 9
CWE codes:
134
Suggestion:
Use a constant for the format specification
snprintf(buf, sizeof(buf), ("Exiting, %" PRId64 " kB in use"),
inuse_bytes >> 10);
} else {
snprintf(buf, sizeof(buf), ("Exiting, %" PRId64 " bytes in use"),
inuse_bytes);
}
} else {
snprintf(buf, sizeof(buf), ("Exiting"));
}
Reported by FlawFinder.
Line: 613
Column: 7
CWE codes:
134
Suggestion:
Use a constant for the format specification
inuse_bytes);
}
} else {
snprintf(buf, sizeof(buf), ("Exiting"));
}
HeapProfilerDump(buf);
}
};
Reported by FlawFinder.
Line: 576
Column: 29
CWE codes:
807
20
Suggestion:
Check environment variables carefully before using them
}
#endif
char *signal_number_str = getenv("HEAPPROFILESIGNAL");
if (signal_number_str != NULL) {
long int signal_number = strtol(signal_number_str, NULL, 10);
intptr_t old_signal_handler = reinterpret_cast<intptr_t>(signal(signal_number, HeapProfilerDumpSignal));
if (old_signal_handler == reinterpret_cast<intptr_t>(SIG_ERR)) {
RAW_LOG(FATAL, "Failed to set signal. Perhaps signal number %s is invalid\n", signal_number_str);
Reported by FlawFinder.
Line: 232
Column: 3
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
dumping = true;
// Make file name
char file_name[1000];
dump_count++;
snprintf(file_name, sizeof(file_name), "%s.%04d%s",
filename_prefix, dump_count, HeapProfileTable::kFileExt);
// Dump the profile
Reported by FlawFinder.
Line: 274
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
const HeapProfileTable::Stats& total = heap_profile->total();
const int64 inuse_bytes = total.alloc_size - total.free_size;
bool need_to_dump = false;
char buf[128];
if (FLAGS_heap_profile_allocation_interval > 0 &&
total.alloc_size >=
last_dump_alloc + FLAGS_heap_profile_allocation_interval) {
snprintf(buf, sizeof(buf), ("%" PRId64 " MB allocated cumulatively, "
Reported by FlawFinder.
Line: 485
Column: 3
CWE codes:
120
Suggestion:
Make sure destination can always hold the source data
RAW_DCHECK(filename_prefix == NULL, "");
const int prefix_length = strlen(prefix);
filename_prefix = reinterpret_cast<char*>(ProfilerMalloc(prefix_length + 1));
memcpy(filename_prefix, prefix, prefix_length);
filename_prefix[prefix_length] = '\0';
}
extern "C" int IsHeapProfilerRunning() {
SpinLockHolder l(&heap_lock);
Reported by FlawFinder.
src/third_party/boost/boost/asio/read.hpp
16 issues
Line: 78
Column: 13
CWE codes:
120
20
* boost::asio::transfer_all()); @endcode
*/
template <typename SyncReadStream, typename MutableBufferSequence>
std::size_t read(SyncReadStream& s, const MutableBufferSequence& buffers,
typename constraint<
is_mutable_buffer_sequence<MutableBufferSequence>::value
>::type = 0);
/// Attempt to read a certain amount of data from a stream before returning.
Reported by FlawFinder.
Line: 120
Column: 13
CWE codes:
120
20
* boost::asio::transfer_all(), ec); @endcode
*/
template <typename SyncReadStream, typename MutableBufferSequence>
std::size_t read(SyncReadStream& s, const MutableBufferSequence& buffers,
boost::system::error_code& ec,
typename constraint<
is_mutable_buffer_sequence<MutableBufferSequence>::value
>::type = 0);
Reported by FlawFinder.
Line: 174
Column: 13
CWE codes:
120
20
*/
template <typename SyncReadStream, typename MutableBufferSequence,
typename CompletionCondition>
std::size_t read(SyncReadStream& s, const MutableBufferSequence& buffers,
CompletionCondition completion_condition,
typename constraint<
is_mutable_buffer_sequence<MutableBufferSequence>::value
>::type = 0);
Reported by FlawFinder.
Line: 221
Column: 13
CWE codes:
120
20
*/
template <typename SyncReadStream, typename MutableBufferSequence,
typename CompletionCondition>
std::size_t read(SyncReadStream& s, const MutableBufferSequence& buffers,
CompletionCondition completion_condition, boost::system::error_code& ec,
typename constraint<
is_mutable_buffer_sequence<MutableBufferSequence>::value
>::type = 0);
Reported by FlawFinder.
Line: 257
Column: 13
CWE codes:
120
20
* boost::asio::transfer_all()); @endcode
*/
template <typename SyncReadStream, typename DynamicBuffer_v1>
std::size_t read(SyncReadStream& s,
BOOST_ASIO_MOVE_ARG(DynamicBuffer_v1) buffers,
typename constraint<
is_dynamic_buffer_v1<typename decay<DynamicBuffer_v1>::type>::value
>::type = 0,
typename constraint<
Reported by FlawFinder.
Line: 293
Column: 13
CWE codes:
120
20
* boost::asio::transfer_all(), ec); @endcode
*/
template <typename SyncReadStream, typename DynamicBuffer_v1>
std::size_t read(SyncReadStream& s,
BOOST_ASIO_MOVE_ARG(DynamicBuffer_v1) buffers,
boost::system::error_code& ec,
typename constraint<
is_dynamic_buffer_v1<typename decay<DynamicBuffer_v1>::type>::value
>::type = 0,
Reported by FlawFinder.
Line: 341
Column: 13
CWE codes:
120
20
*/
template <typename SyncReadStream, typename DynamicBuffer_v1,
typename CompletionCondition>
std::size_t read(SyncReadStream& s,
BOOST_ASIO_MOVE_ARG(DynamicBuffer_v1) buffers,
CompletionCondition completion_condition,
typename constraint<
is_dynamic_buffer_v1<typename decay<DynamicBuffer_v1>::type>::value
>::type = 0,
Reported by FlawFinder.
Line: 390
Column: 13
CWE codes:
120
20
*/
template <typename SyncReadStream, typename DynamicBuffer_v1,
typename CompletionCondition>
std::size_t read(SyncReadStream& s,
BOOST_ASIO_MOVE_ARG(DynamicBuffer_v1) buffers,
CompletionCondition completion_condition, boost::system::error_code& ec,
typename constraint<
is_dynamic_buffer_v1<typename decay<DynamicBuffer_v1>::type>::value
>::type = 0,
Reported by FlawFinder.
Line: 430
Column: 13
CWE codes:
120
20
* boost::asio::transfer_all()); @endcode
*/
template <typename SyncReadStream, typename Allocator>
std::size_t read(SyncReadStream& s, basic_streambuf<Allocator>& b);
/// Attempt to read a certain amount of data from a stream before returning.
/**
* This function is used to read a certain number of bytes of data from a
* stream. The call will block until one of the following conditions is true:
Reported by FlawFinder.
Line: 459
Column: 13
CWE codes:
120
20
* boost::asio::transfer_all(), ec); @endcode
*/
template <typename SyncReadStream, typename Allocator>
std::size_t read(SyncReadStream& s, basic_streambuf<Allocator>& b,
boost::system::error_code& ec);
/// Attempt to read a certain amount of data from a stream before returning.
/**
* This function is used to read a certain number of bytes of data from a
Reported by FlawFinder.
src/third_party/wiredtiger/test/suite/test_compat04.py
16 issues
Line: 33
Column: 1
# Check compatibility API
import fnmatch, os
import wiredtiger, wttest
from suite_subprocess import suite_subprocess
from wtdataset import SimpleDataSet, simple_key
from wtscenario import make_scenarios
class test_compat04(wttest.WiredTigerTestCase, suite_subprocess):
Reported by Pylint.
Line: 84
Column: 5
# This test creates scenarios that lead to errors. This is different
# than compat02 because it is testing errors (or success) using the
# compatibility settings on the initial database creation.
def conn_config(self):
config_str = 'create,config_base=%s,' % self.basecfg
log_str = 'log=(archive=false,enabled,file_max=%s),' % self.logmax
compat_str = ''
if (self.create_rel != 'none'):
compat_str += 'compatibility=(release="%s"),' % self.create_rel
Reported by Pylint.
Line: 32
Column: 1
# test_compat04.py
# Check compatibility API
import fnmatch, os
import wiredtiger, wttest
from suite_subprocess import suite_subprocess
from wtdataset import SimpleDataSet, simple_key
from wtscenario import make_scenarios
Reported by Pylint.
Line: 32
Column: 1
# test_compat04.py
# Check compatibility API
import fnmatch, os
import wiredtiger, wttest
from suite_subprocess import suite_subprocess
from wtdataset import SimpleDataSet, simple_key
from wtscenario import make_scenarios
Reported by Pylint.
Line: 33
Column: 1
# Check compatibility API
import fnmatch, os
import wiredtiger, wttest
from suite_subprocess import suite_subprocess
from wtdataset import SimpleDataSet, simple_key
from wtscenario import make_scenarios
class test_compat04(wttest.WiredTigerTestCase, suite_subprocess):
Reported by Pylint.
Line: 35
Column: 1
import fnmatch, os
import wiredtiger, wttest
from suite_subprocess import suite_subprocess
from wtdataset import SimpleDataSet, simple_key
from wtscenario import make_scenarios
class test_compat04(wttest.WiredTigerTestCase, suite_subprocess):
# Add enough entries and use a small log size to generate more than
# one log file.
Reported by Pylint.
Line: 35
Column: 1
import fnmatch, os
import wiredtiger, wttest
from suite_subprocess import suite_subprocess
from wtdataset import SimpleDataSet, simple_key
from wtscenario import make_scenarios
class test_compat04(wttest.WiredTigerTestCase, suite_subprocess):
# Add enough entries and use a small log size to generate more than
# one log file.
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: 32
Column: 1
# test_compat04.py
# Check compatibility API
import fnmatch, os
import wiredtiger, wttest
from suite_subprocess import suite_subprocess
from wtdataset import SimpleDataSet, simple_key
from wtscenario import make_scenarios
Reported by Pylint.
Line: 33
Column: 1
# Check compatibility API
import fnmatch, os
import wiredtiger, wttest
from suite_subprocess import suite_subprocess
from wtdataset import SimpleDataSet, simple_key
from wtscenario import make_scenarios
class test_compat04(wttest.WiredTigerTestCase, suite_subprocess):
Reported by Pylint.
src/third_party/wiredtiger/test/suite/test_bug024.py
15 issues
Line: 34
Column: 1
# [END_TAGS]
from helper import copy_wiredtiger_home
import wiredtiger, wttest
from wtdataset import SimpleDataSet
import os, shutil
# test_bug024.py
# WT-6526: test that we can successfully open a readonly connection after it was stopped while
Reported by Pylint.
Line: 33
Column: 1
# connection_api:turtle_file
# [END_TAGS]
from helper import copy_wiredtiger_home
import wiredtiger, wttest
from wtdataset import SimpleDataSet
import os, shutil
# test_bug024.py
Reported by Pylint.
Line: 34
Column: 1
# [END_TAGS]
from helper import copy_wiredtiger_home
import wiredtiger, wttest
from wtdataset import SimpleDataSet
import os, shutil
# test_bug024.py
# WT-6526: test that we can successfully open a readonly connection after it was stopped while
Reported by Pylint.
Line: 36
Column: 1
from helper import copy_wiredtiger_home
import wiredtiger, wttest
from wtdataset import SimpleDataSet
import os, shutil
# test_bug024.py
# WT-6526: test that we can successfully open a readonly connection after it was stopped while
# the temporary turtle file existed. We simulate that by copying the turtle file to its temporary name
# and then opening the connection readonly.
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: 34
Column: 1
# [END_TAGS]
from helper import copy_wiredtiger_home
import wiredtiger, wttest
from wtdataset import SimpleDataSet
import os, shutil
# test_bug024.py
# WT-6526: test that we can successfully open a readonly connection after it was stopped while
Reported by Pylint.
Line: 34
Column: 1
# [END_TAGS]
from helper import copy_wiredtiger_home
import wiredtiger, wttest
from wtdataset import SimpleDataSet
import os, shutil
# test_bug024.py
# WT-6526: test that we can successfully open a readonly connection after it was stopped while
Reported by Pylint.
Line: 36
Column: 1
from helper import copy_wiredtiger_home
import wiredtiger, wttest
from wtdataset import SimpleDataSet
import os, shutil
# test_bug024.py
# WT-6526: test that we can successfully open a readonly connection after it was stopped while
# the temporary turtle file existed. We simulate that by copying the turtle file to its temporary name
# and then opening the connection readonly.
Reported by Pylint.
Line: 36
Column: 1
from helper import copy_wiredtiger_home
import wiredtiger, wttest
from wtdataset import SimpleDataSet
import os, shutil
# test_bug024.py
# WT-6526: test that we can successfully open a readonly connection after it was stopped while
# the temporary turtle file existed. We simulate that by copying the turtle file to its temporary name
# and then opening the connection readonly.
Reported by Pylint.
Line: 36
Column: 1
from helper import copy_wiredtiger_home
import wiredtiger, wttest
from wtdataset import SimpleDataSet
import os, shutil
# test_bug024.py
# WT-6526: test that we can successfully open a readonly connection after it was stopped while
# the temporary turtle file existed. We simulate that by copying the turtle file to its temporary name
# and then opening the connection readonly.
Reported by Pylint.
src/third_party/wiredtiger/dist/api_err.py
15 issues
Line: 4
Column: 1
# Output C #defines for errors into wiredtiger.in and the associated error
# message code in strerror.c.
import re, textwrap
from dist import compare_srcfile, format_srcfile
class Error:
def __init__(self, name, value, desc, long_desc=None, **flags):
self.name = name
Reported by Pylint.
Line: 1
Column: 1
# Output C #defines for errors into wiredtiger.in and the associated error
# message code in strerror.c.
import re, textwrap
from dist import compare_srcfile, format_srcfile
class Error:
def __init__(self, name, value, desc, long_desc=None, **flags):
self.name = name
Reported by Pylint.
Line: 4
Column: 1
# Output C #defines for errors into wiredtiger.in and the associated error
# message code in strerror.c.
import re, textwrap
from dist import compare_srcfile, format_srcfile
class Error:
def __init__(self, name, value, desc, long_desc=None, **flags):
self.name = name
Reported by Pylint.
Line: 7
Column: 1
import re, textwrap
from dist import compare_srcfile, format_srcfile
class Error:
def __init__(self, name, value, desc, long_desc=None, **flags):
self.name = name
self.value = value
self.desc = desc
self.long_desc = long_desc
Reported by Pylint.
Line: 7
Column: 1
import re, textwrap
from dist import compare_srcfile, format_srcfile
class Error:
def __init__(self, name, value, desc, long_desc=None, **flags):
self.name = name
self.value = value
self.desc = desc
self.long_desc = long_desc
Reported by Pylint.
Line: 78
Column: 1
]
# Update the #defines in the wiredtiger.in file.
tmp_file = '__tmp'
tfile = open(tmp_file, 'w')
skip = 0
for line in open('../src/include/wiredtiger.in', 'r'):
if not skip:
tfile.write(line)
Reported by Pylint.
Line: 80
Column: 1
# Update the #defines in the wiredtiger.in file.
tmp_file = '__tmp'
tfile = open(tmp_file, 'w')
skip = 0
for line in open('../src/include/wiredtiger.in', 'r'):
if not skip:
tfile.write(line)
if line.count('Error return section: END'):
tfile.write(line)
Reported by Pylint.
Line: 86
Column: 9
tfile.write(line)
if line.count('Error return section: END'):
tfile.write(line)
skip = 0
elif line.count('Error return section: BEGIN'):
tfile.write(' */\n')
skip = 1
for err in errors:
if 'undoc' in err.flags:
Reported by Pylint.
Line: 89
Column: 9
skip = 0
elif line.count('Error return section: BEGIN'):
tfile.write(' */\n')
skip = 1
for err in errors:
if 'undoc' in err.flags:
tfile.write('/*! @cond internal */\n')
tfile.write('/*!%s.%s */\n' %
(('\n * ' if err.long_desc else ' ') +
Reported by Pylint.
Line: 107
Column: 1
compare_srcfile(tmp_file, '../src/include/wiredtiger.in')
# Output the wiredtiger_strerror and wiredtiger_sterror_r code.
tmp_file = '__tmp'
tfile = open(tmp_file, 'w')
tfile.write('''/* DO NOT EDIT: automatically built by dist/api_err.py. */
#include "wt_internal.h"
Reported by Pylint.
src/third_party/scons-3.1.2/scons-local-3.1.2/SCons/Tool/DCommon.py
15 issues
Line: 3
Column: 1
from __future__ import print_function
"""SCons.Tool.DCommon
Common code for the various D tools.
Coded by Russel Winder (russel@winder.org.uk)
2012-09-06
"""
Reported by Pylint.
Line: 39
Column: 9
import os.path
def isD(env, source):
if not source:
return 0
for s in source:
if s.sources:
ext = os.path.splitext(str(s.sources[0]))[1]
Reported by Pylint.
Line: 1
Column: 1
from __future__ import print_function
"""SCons.Tool.DCommon
Common code for the various D tools.
Coded by Russel Winder (russel@winder.org.uk)
2012-09-06
"""
Reported by Pylint.
Line: 1
Column: 1
from __future__ import print_function
"""SCons.Tool.DCommon
Common code for the various D tools.
Coded by Russel Winder (russel@winder.org.uk)
2012-09-06
"""
Reported by Pylint.
Line: 34
Column: 1
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#
__revision__ = "src/engine/SCons/Tool/DCommon.py bee7caf9defd6e108fc2998a2520ddb36a967691 2019-12-17 02:07:09 bdeegan"
import os.path
def isD(env, source):
Reported by Pylint.
Line: 36
Column: 1
__revision__ = "src/engine/SCons/Tool/DCommon.py bee7caf9defd6e108fc2998a2520ddb36a967691 2019-12-17 02:07:09 bdeegan"
import os.path
def isD(env, source):
if not source:
return 0
Reported by Pylint.
Line: 39
Column: 1
import os.path
def isD(env, source):
if not source:
return 0
for s in source:
if s.sources:
ext = os.path.splitext(str(s.sources[0]))[1]
Reported by Pylint.
Line: 39
Column: 1
import os.path
def isD(env, source):
if not source:
return 0
for s in source:
if s.sources:
ext = os.path.splitext(str(s.sources[0]))[1]
Reported by Pylint.
Line: 42
Column: 9
def isD(env, source):
if not source:
return 0
for s in source:
if s.sources:
ext = os.path.splitext(str(s.sources[0]))[1]
if ext == '.d':
return 1
return 0
Reported by Pylint.
Line: 50
Column: 1
return 0
def addDPATHToEnv(env, executable):
dPath = env.WhereIs(executable)
if dPath:
phobosDir = dPath[:dPath.rindex(executable)] + '/../src/phobos'
if os.path.isdir(phobosDir):
env.Append(DPATH=[phobosDir])
Reported by Pylint.
src/third_party/abseil-cpp-master/abseil-cpp/conanfile.py
15 issues
Line: 8
Column: 1
# internally, so we won't know if it stops working. We may ask community
# members to help us debug any problems that arise.
from conans import ConanFile, CMake, tools
from conans.errors import ConanInvalidConfiguration
from conans.model.version import Version
class AbseilConan(ConanFile):
Reported by Pylint.
Line: 9
Column: 1
# members to help us debug any problems that arise.
from conans import ConanFile, CMake, tools
from conans.errors import ConanInvalidConfiguration
from conans.model.version import Version
class AbseilConan(ConanFile):
name = "abseil"
Reported by Pylint.
Line: 10
Column: 1
from conans import ConanFile, CMake, tools
from conans.errors import ConanInvalidConfiguration
from conans.model.version import Version
class AbseilConan(ConanFile):
name = "abseil"
url = "https://github.com/abseil/abseil-cpp"
Reported by Pylint.
Line: 27
Column: 12
settings = "os", "arch", "compiler", "build_type"
def configure(self):
if self.settings.os == "Windows" and \
self.settings.compiler == "Visual Studio" and \
Version(self.settings.compiler.version.value) < "14":
raise ConanInvalidConfiguration("Abseil does not support MSVC < 14")
def build(self):
Reported by Pylint.
Line: 28
Column: 12
def configure(self):
if self.settings.os == "Windows" and \
self.settings.compiler == "Visual Studio" and \
Version(self.settings.compiler.version.value) < "14":
raise ConanInvalidConfiguration("Abseil does not support MSVC < 14")
def build(self):
tools.replace_in_file("CMakeLists.txt", "project(absl CXX)", "project(absl CXX)\ninclude(conanbuildinfo.cmake)\nconan_basic_setup()")
Reported by Pylint.
Line: 29
Column: 20
def configure(self):
if self.settings.os == "Windows" and \
self.settings.compiler == "Visual Studio" and \
Version(self.settings.compiler.version.value) < "14":
raise ConanInvalidConfiguration("Abseil does not support MSVC < 14")
def build(self):
tools.replace_in_file("CMakeLists.txt", "project(absl CXX)", "project(absl CXX)\ninclude(conanbuildinfo.cmake)\nconan_basic_setup()")
cmake = CMake(self)
Reported by Pylint.
Line: 47
Column: 12
self.copy("*.lib", dst="lib", src=".", keep_path=False)
def package_info(self):
if self.settings.os == "Linux":
self.cpp_info.libs = ["-Wl,--start-group"]
self.cpp_info.libs.extend(tools.collect_libs(self))
if self.settings.os == "Linux":
self.cpp_info.libs.extend(["-Wl,--end-group", "pthread"])
Reported by Pylint.
Line: 50
Column: 12
if self.settings.os == "Linux":
self.cpp_info.libs = ["-Wl,--start-group"]
self.cpp_info.libs.extend(tools.collect_libs(self))
if self.settings.os == "Linux":
self.cpp_info.libs.extend(["-Wl,--end-group", "pthread"])
Reported by Pylint.
Line: 1
Column: 1
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Note: Conan is supported on a best-effort basis. Abseil doesn't use Conan
# internally, so we won't know if it stops working. We may ask community
# members to help us debug any problems that arise.
from conans import ConanFile, CMake, tools
from conans.errors import ConanInvalidConfiguration
Reported by Pylint.
Line: 13
Column: 1
from conans.model.version import Version
class AbseilConan(ConanFile):
name = "abseil"
url = "https://github.com/abseil/abseil-cpp"
homepage = url
author = "Abseil <abseil-io@googlegroups.com>"
description = "Abseil Common Libraries (C++) from Google"
Reported by Pylint.
src/third_party/wiredtiger/test/3rdparty/python-subunit-0.0.16/python/subunit/filters.py
15 issues
Line: 20
Column: 1
from optparse import OptionParser
import sys
from extras import safe_hasattr
from testtools import CopyStreamResult, StreamResult, StreamResultRouter
from subunit import (
DiscardStream, ProtocolTestCase, ByteStreamToStreamResult,
StreamResultToBytes,
Reported by Pylint.
Line: 21
Column: 1
import sys
from extras import safe_hasattr
from testtools import CopyStreamResult, StreamResult, StreamResultRouter
from subunit import (
DiscardStream, ProtocolTestCase, ByteStreamToStreamResult,
StreamResultToBytes,
)
Reported by Pylint.
Line: 146
Column: 21
if output_path is None:
output_to = sys.stdout
else:
output_to = file(output_path, 'wb')
try:
result = result_factory(output_to)
run_tests_from_stream(
input_stream, result, passthrough_stream, forward_stream,
Reported by Pylint.
Line: 17
Column: 1
#
from optparse import OptionParser
import sys
from extras import safe_hasattr
from testtools import CopyStreamResult, StreamResult, StreamResultRouter
Reported by Pylint.
Line: 1
Column: 1
# subunit: extensions to python unittest to get test results from subprocesses.
# Copyright (C) 2009 Robert Collins <robertc@robertcollins.net>
#
# Licensed under either the Apache License, Version 2.0 or the BSD 3-clause
# license at the users choice. A copy of both licenses are available in the
# project source as Apache-2.0 and BSD. You may not use this file except in
# compliance with one of these two licences.
#
# Unless required by applicable law or agreed to in writing, software
Reported by Pylint.
Line: 8
Column: 2
# license at the users choice. A copy of both licenses are available in the
# project source as Apache-2.0 and BSD. You may not use this file except in
# compliance with one of these two licences.
#
# Unless required by applicable law or agreed to in writing, software
# distributed under these licenses is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# license you chose for the specific language governing permissions and
# limitations under that license.
Reported by Pylint.
Line: 30
Column: 1
from subunit.test_results import CatFiles
def make_options(description):
parser = OptionParser(description=description)
parser.add_option(
"--no-passthrough", action="store_true",
help="Hide all non subunit input.", default=False,
dest="no_passthrough")
Reported by Pylint.
Line: 46
Column: 1
return parser
def run_tests_from_stream(input_stream, result, passthrough_stream=None,
forward_stream=None, protocol_version=1, passthrough_subunit=True):
"""Run tests from a subunit input stream through 'result'.
Non-test events - top level file attachments - are expected to be
dropped by v2 StreamResults at the present time (as all the analysis code
Reported by Pylint.
Line: 72
Column: 8
(when forwarding as subunit non-subunit input is always turned into
subunit)
"""
if 1==protocol_version:
test = ProtocolTestCase(
input_stream, passthrough=passthrough_stream,
forward=forward_stream)
elif 2==protocol_version:
# In all cases we encapsulate unknown inputs.
Reported by Pylint.
Line: 76
Column: 10
test = ProtocolTestCase(
input_stream, passthrough=passthrough_stream,
forward=forward_stream)
elif 2==protocol_version:
# In all cases we encapsulate unknown inputs.
if forward_stream is not None:
# Send events to forward_stream as subunit.
forward_result = StreamResultToBytes(forward_stream)
# If we're passing non-subunit through, copy:
Reported by Pylint.