Showing 108 of 108 total issues
Function __init__
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def __init__(
self,
path: Union[TypePath, Sequence[TypePath], None] = None,
type: Optional[str] = None, # noqa: A002
tensor: Optional[TypeData] = 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 train
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
def train(
Function __init__
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(
Function apply_transform
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def apply_transform(self, subject: Subject) -> Subject:
gamma = self.gamma
for name, image in self.get_images_dict(subject).items():
if self.arguments_are_dict():
assert isinstance(self.gamma, dict)
- 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 generate_bias_field
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def generate_bias_field(
data: TypeData,
order: int,
coefficients: TypeData,
) -> 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 apply_transform
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def apply_transform(self, subject: Subject) -> Subject:
images = subject.get_images(
intensity_only=False,
include=self.include,
exclude=self.exclude,
- 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 extract_archive
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def extract_archive(from_path, to_path=None, remove_finished=False):
if to_path is None:
to_path = os.path.dirname(from_path)
if _is_tar(from_path):
- 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 plot_subject
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
def plot_subject(
Function apply_transform_to_file
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def apply_transform_to_file(
Function __init__
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(
Function __init__
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def __init__(
self,
target_shape: Union[int, TypeTripletInt, None] = None,
padding_mode: Union[str, float] = 0,
mask_name: Optional[str] = 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 add_artifact
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def add_artifact(
self,
tensor: torch.Tensor,
num_ghosts: int,
axis: int,
- 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_params
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def get_params(
tensor: torch.Tensor,
patch_size: np.ndarray,
num_iterations: int,
) -> List[Tuple[TypeTripletInt, TypeTripletInt]]:
- 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_subjects
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def _get_subjects(
self,
add_segmentations: bool,
add_bounding_boxes: bool,
) -> List[Subject]:
- 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 download_and_extract_archive
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def download_and_extract_archive(
Function parse_params
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def parse_params(self, params, around, name, make_ranges=True, **kwargs):
params = to_tuple(params)
# d or (a, b)
if len(params) == 1 or (len(params) == 2 and make_ranges):
params *= 3 # (d, d, d) or (a, b, a, b, a, b)
- 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 _fill
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def _fill(self) -> None:
assert self.sampler is not None
if self._incomplete_subject is not None:
subject = self._incomplete_subject
- 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 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(
Function create_dummy_dataset
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def create_dummy_dataset(
Function __init__
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(