fepegar/torchio

View on GitHub

Showing 106 of 106 total issues

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]:
Severity: Minor
Found in src/torchio/datasets/rsna_spine_fracture.py - About 45 mins to fix

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 create_dummy_dataset has 6 arguments (exceeds 4 allowed). Consider refactoring.
Open

def create_dummy_dataset(
Severity: Minor
Found in src/torchio/utils.py - About 45 mins to fix

    Function download_and_extract_archive has 6 arguments (exceeds 4 allowed). Consider refactoring.
    Open

    def download_and_extract_archive(
    Severity: Minor
    Found in src/torchio/download.py - About 45 mins to fix

      Function check_consistent_attribute has 5 arguments (exceeds 4 allowed). Consider refactoring.
      Open

          def check_consistent_attribute(
      Severity: Minor
      Found in src/torchio/data/subject.py - About 35 mins to fix

        Function __init__ has 5 arguments (exceeds 4 allowed). Consider refactoring.
        Open

            def __init__(
        Severity: Minor
        Found in src/torchio/transforms/augmentation/intensity/random_ghosting.py - About 35 mins to fix

          Function __init__ has 5 arguments (exceeds 4 allowed). Consider refactoring.
          Open

              def __init__(
          Severity: Minor
          Found in src/torchio/transforms/preprocessing/intensity/rescale.py - About 35 mins to fix

            Function _set_resampler_reference has 5 arguments (exceeds 4 allowed). Consider refactoring.
            Open

                def _set_resampler_reference(
            Severity: Minor
            Found in src/torchio/transforms/preprocessing/spatial/resample.py - About 35 mins to fix

              Function __init__ has 5 arguments (exceeds 4 allowed). Consider refactoring.
              Open

                  def __init__(
              Severity: Minor
              Found in src/torchio/transforms/preprocessing/spatial/crop_or_pad.py - About 35 mins to fix

                Function __init__ has 5 arguments (exceeds 4 allowed). Consider refactoring.
                Open

                    def __init__(
                Severity: Minor
                Found in src/torchio/transforms/augmentation/intensity/random_ghosting.py - About 35 mins to fix

                  Function _normalize has 5 arguments (exceeds 4 allowed). Consider refactoring.
                  Open

                  def _normalize(

                    Function _parse_range has 5 arguments (exceeds 4 allowed). Consider refactoring.
                    Open

                        def _parse_range(
                    Severity: Minor
                    Found in src/torchio/transforms/transform.py - About 35 mins to fix

                      Function extract_patch has 5 arguments (exceeds 4 allowed). Consider refactoring.
                      Open

                          def extract_patch(  # type: ignore[override]
                      Severity: Minor
                      Found in src/torchio/data/sampler/weighted.py - About 35 mins to fix

                        Function parse_params has 5 arguments (exceeds 4 allowed). Consider refactoring.
                        Open

                            def parse_params(self, params, around, name, make_ranges=True, **kwargs):
                        Severity: Minor
                        Found in src/torchio/transforms/transform.py - About 35 mins to fix

                          Function __init__ has 5 arguments (exceeds 4 allowed). Consider refactoring.
                          Open

                              def __init__(
                          Severity: Minor
                          Found in src/torchio/datasets/rsna_miccai.py - About 35 mins to fix

                            Function __init__ has 5 arguments (exceeds 4 allowed). Consider refactoring.
                            Open

                                def __init__(
                            Severity: Minor
                            Found in src/torchio/datasets/ixi.py - About 35 mins to fix

                              Function __init__ has 5 arguments (exceeds 4 allowed). Consider refactoring.
                              Open

                                  def __init__(
                              Severity: Minor
                              Found in src/torchio/datasets/ixi.py - About 35 mins to fix

                                Function add_artifact has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                Open

                                    def add_artifact(
                                Severity: Minor
                                Found in src/torchio/transforms/augmentation/intensity/random_ghosting.py - About 35 mins to fix

                                  Function add_artifact has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                  Open

                                      def add_artifact(
                                  Severity: Minor
                                  Found in src/torchio/transforms/augmentation/intensity/random_motion.py - About 35 mins to fix

                                    Function __init__ has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                    Open

                                        def __init__(

                                      Function _write_sitk has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                      Open

                                      def _write_sitk(
                                      Severity: Minor
                                      Found in src/torchio/data/io.py - About 35 mins to fix
                                        Severity
                                        Category
                                        Status
                                        Source
                                        Language