Showing 269 of 913 total issues
Function DatasetOpen
has 104 lines of code (exceeds 25 allowed). Consider refactoring. Open
const DatasetOpen = () => {
const dispatch = useDispatch();
const openState = useSelector((state: RootReducer) => state.openDataset);
const [didReset, setReset] = React.useState(false);
Function worker_loop
has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring. Open
def worker_loop(
queues: WorkerQueues,
work_mem: dict,
worker_idx: int,
env: Environment
- 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 prime_numba_cache
has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring. Open
def prime_numba_cache(ds):
dtypes = (np.float32, None)
for dtype in dtypes:
roi = np.zeros(ds.shape.nav, dtype=bool).reshape((-1,))
roi[max(-ds._meta.sync_offset, 0)] = 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
Message
has 31 functions (exceeds 20 allowed). Consider refactoring. Open
class Message:
"""
possible messages - the translation of our python datatypes to json types
"""
DataSet
has 31 functions (exceeds 20 allowed). Consider refactoring. Open
class DataSet:
# The default partition size in bytes
MAX_PARTITION_SIZE = 512*1024*1024
def __init__(self, io_backend: Optional["IOBackend"] = None):
Function _run_sync
has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring. Open
def _run_sync(
self,
dataset: DataSet,
udf: Union[UDF, Iterable[UDF]],
roi: RoiT,
- 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_with
has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring. Open
def make_with(
cls,
executor_spec: ExecutorSpecType = 'dask',
*,
cpus: Optional[Union[int, Iterable[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 make_get_read_ranges
has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring. Open
def make_get_read_ranges(
px_to_bytes=_default_px_to_bytes,
read_ranges_tile_block=_default_read_ranges_tile_block,
):
"""
- 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
File cached.py
has 459 lines of code (exceeds 400 allowed). Consider refactoring. Open
import os
import json
import hashlib
import sqlite3
import time
Function block_get_min_fill_factor
has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring. Open
def block_get_min_fill_factor(rrs):
"""
Try to find out how sparse the given read ranges are, per file.
Returns the smallest fill factor and maximum required buffer size.
- 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 jobReducer
has 79 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const jobReducer = (state = initialJobState, action: AllActions): JobReducerState => {
switch (action.type) {
case jobActions.ActionTypes.CREATE: {
const createResult = insertById(
state,
File tvips.py
has 448 lines of code (exceeds 400 allowed). Consider refactoring. Open
from io import SEEK_SET
import math
import os
import re
from typing import IO, TYPE_CHECKING, NamedTuple, Optional
Function _apply_part_result
has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring. Open
def _apply_part_result(self, udfs: Iterable[UDF], damage, part_results, task):
for part_results_udf, udf in zip(part_results, udfs):
# Allow user to define an alternative merge strategy
# using dask-compatible functions. In the Delayed case we
# won't be getting partial results with damage anyway.
- 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 getFormInitial
has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring. Open
const getFormInitial = (didReset: boolean, openState: OpenDatasetState) => {
const { formCachedParams, formDetectedParams } = openState;
if (didReset) {
if (formDetectedParams) {
return {
- 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
UDFData
has 26 functions (exceeds 20 allowed). Consider refactoring. Open
class UDFData:
'''
Container for result buffers, return value from running UDFs
'''
UDFBase
has 26 functions (exceeds 20 allowed). Consider refactoring. Open
class UDFBase(UDFProtocol):
'''
Base class for UDFs with helper functions.
'''
def __init__(self, *args, **kwargs) -> None:
Function actionsFromChannel
has 74 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function* actionsFromChannel(socketChannel: SocketChannel) {
try {
while (true) {
const msg = (yield take(socketChannel)) as channelMessages.Messages;
const timestamp = Date.now();
Function __init__
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
def __init__(self, tileshape=None, num_partitions=None, data=None, sig_dims=None,
check_cast=True, tiledelay=None, datashape=None, base_shape=None,
force_need_decode=False, io_backend=None,
nav_shape=None, sig_shape=None, sync_offset=0, array_backends=None):
super().__init__(io_backend=io_backend)
- 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_2x2
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
def decode_r1_swap_2x2(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. 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
K2ISDataSet
has 24 functions (exceeds 20 allowed). Consider refactoring. Open
class K2ISDataSet(DataSet):
"""
Read raw K2IS data sets. They consist of 8 .bin files and one .gtg file.
Currently, data acquired using the STEMx unit is supported, metadata
about the nav_shape is read from the .gtg file.