Showing 269 of 913 total issues
Function main
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def main(kind, scheduler, local_directory, n_cpus, cudas,
has_cupy, name, log_level, preload: tuple[str, ...]):
from libertem.common.threading import set_num_threads_env
with set_num_threads_env(1):
from libertem.utils.devices import detect
- 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 calc_coords
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def calc_coords(self, indices=None, drop_zero=False, frame_shape=None, r=0):
'''
Shorthand to calculate peak coordinates.
Parameters
- 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 _start_pool
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def _start_pool(self) -> WorkerPool:
with tracer.start_as_current_span("PipelinedExecutor.start_pool") as span:
pool = WorkerPool(
worker_fn=functools.partial(
pipelined_worker,
- 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 flatten_filter
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def flatten_filter(excluded_pixels, repairs, repair_counts, sig_shape):
'''
Flatten excluded pixels and repair environments and filter for collisions
Ravel indices to flattened signal dimension and
- 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_dependencies
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def _get_dependencies(self, cvar):
deps = [cvar]
if hasattr(cvar, 'py_func'):
# TODO: does the cache key need to depend on any other
# attributes of the Dispatcher?
- 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_tiles_with_roi
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def read_tiles_with_roi(
triple: CSRTriple,
partition_slice: Slice,
sync_offset: int,
tiling_scheme: TilingScheme,
- 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 async_to_sync_generator
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def async_to_sync_generator(agen, pool=None):
span = trace.get_current_span()
span_context = span.get_span_context()
q = queue.Queue()
t = AsyncGenToQueueThread(agen, q, span_context)
- 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 _order_results
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def _order_results(results_in: ResultWithID) -> ResultT:
"""
Order the `results_in` generator by the result id, yielding ordered results.
Requires indexes to be without gaps.
"""
- 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_udfs
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def _init_udfs(
self,
execution_plan: ExecutionPlan,
partition: Partition,
roi: Optional[np.ndarray],
- 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_subslices
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def _get_subslices(self, tiling_scheme):
"""
Generate partition subslices for the given tiling scheme for the different cases.
"""
if tiling_scheme.intent == "partition":
- 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_datasets
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def _get_datasets(path):
datasets: list[HDF5ArrayDescriptor] = []
try:
timeout = int(os.environ.get('LIBERTEM_IO_HDF5_TIMEOUT_DEBUG', 3))
- 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 GPUSelector
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
export const GPUSelector: React.FC<GPUSelectorProps> = ({
config, name, value, setFieldValue,
}) => {
const hasCupy = config.devices.has_cupy;
const cudaIds = config.devices.cudas;
- 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 adjustShapeWithBounds
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
export const adjustShapeWithBounds = (shape: string, shapeType: "nav"|"sig"): string => {
const { minLength, maxLength } = getMinAndMaxShapeLength(shapeType);
let adjustedShape = new Array<string>(minLength).fill("");
- 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_tiles
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def get_tiles(self, *args, **kwargs):
if args and isinstance(args[0], TilingScheme):
tiling_scheme = args[0]
args = args[1:]
intent = tiling_scheme.intent
- 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 9 (exceeds 5 allowed). Consider refactoring. Open
def __init__(self, masks: MaskContainer, meta: UDFMeta, use_torch: bool):
self.masks = masks
self.meta = meta
try:
- 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 run
has 11 arguments (exceeds 8 allowed). Consider refactoring. Open
def run(
Function _buffered_tilereader
has 11 arguments (exceeds 8 allowed). Consider refactoring. Open
def _buffered_tilereader(outer_idx, buffers, sig_dims, tile_read_ranges,
Function cbed_frame
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def cbed_frame(
fy=128, fx=128, zero=None, a=None, b=None, indices=None,
radius=4, all_equal=False, margin=None):
if zero is None:
zero = (fy//2, fx//2)
- 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 _mib_r24_px_to_bytes
has 10 arguments (exceeds 8 allowed). Consider refactoring. Open
def _mib_r24_px_to_bytes(
Function _get_np_dtype
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def _get_np_dtype(dtype: str, bit_depth: int) -> "nt.DTypeLike":
dtype = dtype.lower()
num_bits = int(dtype[1:])
if dtype[0] == "u":
num_bytes = num_bits // 8
- 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"