fepegar/torchio

View on GitHub

Showing 105 of 105 total issues

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

    def __init__(

    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]]:
    Severity: Minor
    Found in src/torchio/transforms/augmentation/intensity/random_swap.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 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 __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/preprocessing/intensity/rescale.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 _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__(

                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 _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 get_mask_from_masking_method has 5 arguments (exceeds 4 allowed). Consider refactoring.
                      Open

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

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

                        def _normalize(

                          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 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 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 _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

                                  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 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
                                        Severity
                                        Category
                                        Status
                                        Source
                                        Language