Showing 269 of 913 total issues
Function __init__
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
def __init__(self, path, dtype, scan_size=None, detector_size=None, enable_direct=False,
detector_size_raw=None, crop_detector_to=None, tileshape=None,
nav_shape=None, sig_shape=None, sync_offset=0, io_backend=None):
if enable_direct and io_backend is not None:
raise ValueError("can't specify io_backend and enable_direct at the same time")
- 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 19 (exceeds 5 allowed). Consider refactoring. Open
def get_tiles(
self, decoder, tiling_scheme, fileset, read_ranges, roi, native_dtype, read_dtype,
sync_offset, corrections, array_backend: ArrayBackend,
):
if roi is 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
File tiling_scheme.py
has 424 lines of code (exceeds 400 allowed). Consider refactoring. Open
import math
import logging
import warnings
from typing import TYPE_CHECKING, Optional, Union
from collections.abc import Sequence
File gridmatching.py
has 421 lines of code (exceeds 400 allowed). Consider refactoring. Open
import warnings
import numpy as np
from libertem.utils import calc_coords, within_frame
Messages
has 23 functions (exceeds 20 allowed). Consider refactoring. Open
export const Messages = {
initialState: (
jobs: MsgPartJob[],
datasets: MsgPartInitialDataset[],
analyses: MsgPartAnalysis[],
Function get_tiles
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
def get_tiles(self, tiling_scheme: TilingScheme, dest_dtype="float32", roi=None,
array_backend: Optional[ArrayBackend] = None):
if array_backend is None:
array_backend = self.meta.array_backends[0]
assert array_backend in (NUMPY, CUDA)
- 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 process_tile
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
def process_tile(tile, n_0, sum_inout, varsum_inout):
'''
Compute sum and variance of :code:`tile` along navigation axis
and merge into aggregation buffers. Numerical "workhorse" for
:meth:`StdDevUDF.process_tile`.
- 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_partitions
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
def get_partitions(self):
# ds_shape = Shape(self.shape, sig_dims=self.sig_dims)
ds_shape: Shape = self.meta['ds_raw_shape']
ds_slice = Slice(origin=[0] * len(ds_shape), shape=ds_shape)
target_size = self.target_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 results_for_dataset_sync
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
def results_for_dataset_sync(
self,
dataset: DataSet,
executor: JobExecutor,
roi: Optional[np.ndarray] = 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
File dask.py
has 416 lines of code (exceeds 400 allowed). Consider refactoring. Open
import logging
import itertools
import numpy as np
import dask.array as da
FRMS6DataSet
has 22 functions (exceeds 20 allowed). Consider refactoring. Open
class FRMS6DataSet(DataSet):
r"""
Read PNDetector FRMS6 files. FRMS6 data sets consist of multiple .frms6 files and
a .hdr file. The first .frms6 file (matching \*_000.frms6) contains dark frames, which
are subtracted if `enable_offset_correction` is true.
Shape
has 22 functions (exceeds 20 allowed). Consider refactoring. Open
class Shape:
"""
Create a Shape that knows how many dimensions are part of navigation/signal.
It is assumed that the signal is in the last `sig_dims` dimensions.
Function ClusterDetails
has 57 lines of code (exceeds 25 allowed). Consider refactoring. Open
const ClusterDetails = (details: HostDetails[]) => {
const [clustOverview, setOverview] = useState({
host: 0,
cpu: 0,
cuda: 0,
Function get_scheme
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
def get_scheme(
self,
udfs: Sequence[UDFProtocol],
dataset,
read_dtype: "nt.DTypeLike",
- 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 stddev.py
has 410 lines of code (exceeds 400 allowed). Consider refactoring. Open
from collections import defaultdict
import functools
import numpy as np
import numba
Function analysisReducer
has 55 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const analysisReducer = (state = initialAnalysisState, action: AllActions): AnalysisReducerState => {
switch (action.type) {
case analysisActions.ActionTypes.CREATED: {
return insertById(state, action.payload.analysis.id, action.payload.analysis);
}
H5DataSet
has 21 functions (exceeds 20 allowed). Consider refactoring. Open
class H5DataSet(DataSet):
"""
Read data from a HDF5 data set.
Examples
Function environments
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
def environments(excluded_pixels, sigshape):
'''
Calculate a hypercube surface around a pixel, excluding frame boundaries
Returns
- 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 correct_dot_masks
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
def correct_dot_masks(masks, gain_map, excluded_pixels=None, allow_empty=False):
mask_shape = masks.shape
sig_shape = gain_map.shape
masks = masks.reshape((-1, prod(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 xml_defect_coord_extractor
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
def xml_defect_coord_extractor(bad_pixel_map, map_index, map_sizes):
"""
returns the chosen bad pixel map's defects
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"