Showing 269 of 913 total issues
Function assign_cudas
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def assign_cudas(cudas: Union[int, Iterable[int]]) -> Iterable[int]:
"""
Takes the cudas argument to :code:`cluster_spec` and
converts it into a properly formatted iterable of CUDA
device ids
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function detect_params
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def detect_params(cls, path: str, executor):
pathlow = path.lower()
if pathlow.endswith(".dm3") or pathlow.endswith(".dm4"):
array_meta = executor.run_function(cls._read_metadata, path)
sig_dims = array_meta['sig_dims']
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function exclude_pixels
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def exclude_pixels(sig_dims, num_excluded):
'''
Generate a list of excluded pixels that
can be reconstructed faithfully from their neighbors
in a linear gradient dataset
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function get
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def get(self, block: bool = True, timeout: Optional[float] = None):
"""
Receive a message. Memory of the payload will be cleaned up after the
context manager scope, so don't keep references outside of it!
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function monitor_queue
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def monitor_queue(self):
"""
Monitor the queue for messages
If there are no subscribers this should drain
messages from the queue as fast as they are recieved
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function hologram_frame
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def hologram_frame(amp, phi,
counts=1000.,
sampling=5.,
visibility=1.,
f_angle=30.,
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function _read_dataset_hdr
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def _read_dataset_hdr(fname):
if not os.path.exists(fname):
raise DataSetException(
"Could not find .hdr file {}".format(
fname,
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function __init__
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def __init__(self, files=None, scan_size=None, same_offset=False, nav_shape=None,
sig_shape=None, sync_offset=0, io_backend=None):
super().__init__(io_backend=io_backend)
self._meta = None
self._same_offset = same_offset
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function _make_buffered_reader_and_decoder
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def _make_buffered_reader_and_decoder(decode):
"""
decode: from buffers, in bytes, possibly interpreted as native_dtype, to out_decoded.dtype
"""
@cached_njit(boundscheck=False, nogil=True)
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function __init__
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def __init__(
self,
path: str,
sig_dims: Optional[int] = 2,
nav_shape: Optional[tuple[int, int]] = None,
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function TupleInput
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
const TupleInput: React.FC<TupleInputProps> = ({
value, minLen, maxLen, fieldName, setFieldValue, setFieldTouched,
}) => {
const tupleInputValue = value.split(",");
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function _make_mmap_reader_and_decoder
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def _make_mmap_reader_and_decoder(decode):
"""
decode: from inp, in bytes, possibly interpreted as native_dtype, to out_decoded.dtype
"""
@cached_njit(boundscheck=False, cache=True, nogil=True)
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function get_task_data
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def get_task_data(self):
sig_shape = tuple(self.meta.dataset_shape.sig)
com_params = self.get_params()
if len(sig_shape) != 2:
raise ValueError('CoMUDF only works with 2D sig shape.')
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function getUrlAction
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
export const getUrlAction = (): URLAction => {
const hash = decodeURIComponent(window.location.hash.slice(1));
const params = parseHashParameters(hash);
const action = params.action;
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function fetchDirectoryListing
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
function* fetchDirectoryListing(path: string) {
try {
const result = (yield call(getDirectoryListing, path)) as DirectoryListingResponse;
if (result.status === "ok") {
yield put(browserActions.Actions.dirListing(result.path, result.dirs, result.files, result.drives, result.places));
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function _do_initialize
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def _do_initialize(self):
if self.ds_path is None:
try:
datasets = _get_datasets(self.path)
largest_ds = max(datasets, key=lambda x: prod(x.shape))
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function readinto
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def readinto(self, buf):
BLOCKSIZE = self.get_blocksize()
buf_orig = buf
buf = memoryview(buf)
to_read = len(buf)
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function detect_params
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def detect_params(cls, path: str, executor: "JobExecutor"):
try:
_, extension = os.path.splitext(path)
has_extension = extension.lstrip('.') in cls.get_supported_extensions()
under_size_lim = executor.run_function(cls._get_filesize, path) < 2**20 # 1 MB
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function decode_r12_swap_2x2
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def decode_r12_swap_2x2(inp, out, idx, native_dtype, rr, origin, shape, ds_shape):
"""
RAW 12bit format: the pixels need to be re-ordered in groups of 4. `inp`
should be an uint8 view on padded big endian 12bit data (">u2").
This is the quad variant.
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function decode_r1_swap
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def decode_r1_swap(inp, out, idx, native_dtype, rr, origin, shape, ds_shape):
"""
RAW 1bit format: each pixel is actually saved as a single bit. 64 bits
need to be unpacked together.
"""
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"