Showing 108 of 108 total issues
Function plot_subject
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
def plot_subject(
subject: Subject,
cmap_dict=None,
show=True,
output_path=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 __call__
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
def __call__(self, data: InputType) -> InputType:
"""Transform data and return a result of the same type.
Args:
data: Instance of :class:`torchio.Subject`, 4D
- 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_volume
has 13 arguments (exceeds 4 allowed). Consider refactoring. Open
def plot_volume(
Function plot_volume
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
def plot_volume(
image: Image,
radiological=True,
channel=-1, # default to foreground for binary maps
axes=None,
Function get_output
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
def get_output(self, transformed):
if self.is_tensor or self.is_sitk:
image = transformed[self.default_image_name]
transformed = image.data
if self.is_array:
- 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_subject
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def get_subject(self):
if isinstance(self.data, nib.Nifti1Image):
tensor = self.data.get_fdata(dtype=np.float32)
if tensor.ndim == 3:
tensor = tensor[np.newaxis]
- 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 10 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(
Function create_dummy_dataset
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def create_dummy_dataset(
num_images: int,
size_range: Tuple[int, int],
directory: Optional[TypePath] = None,
suffix: str = '.nii.gz',
- 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 10 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(
Function __init__
has 10 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(
Function __init__
has 9 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(
Function main
has 9 arguments (exceeds 4 allowed). Consider refactoring. Open
def main(
Function __init__
has 9 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(
Function make_gif
has 9 arguments (exceeds 4 allowed). Consider refactoring. Open
def make_gif(
Function __init__
has 9 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(
Function to_gif
has 9 arguments (exceeds 4 allowed). Consider refactoring. Open
def to_gif(
Function get_images_dict
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def get_images_dict(
self,
intensity_only=True,
include: Optional[Sequence[str]] = None,
exclude: Optional[Sequence[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 check_consistent_attribute
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def check_consistent_attribute(
self,
attribute: str,
relative_tolerance: float = 1e-6,
absolute_tolerance: float = 1e-6,
- 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_list
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def _get_subjects_list(root, modalities):
# The number of files for each modality is not the same
# E.g. 581 for T1, 578 for T2
# Let's just use the first modality as reference for now
# I.e. only subjects with all modalities will be included
- 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_url
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def download_url(
url: str,
root: TypePath,
filename: Optional[TypePath] = None,
md5: 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"