tomopy/tomopy

View on GitHub

Showing 176 of 354 total issues

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

def _rs_large(sinogram, snr, size, matindex, drop_ratio=0.1, norm=True):
Severity: Minor
Found in source/tomopy/prep/stripe.py - About 45 mins to fix

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

    def remove_outlier(arr, dif, size=3, axis=0, ncore=None, out=None):
    Severity: Minor
    Found in source/tomopy/misc/corr.py - About 45 mins to fix

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

      def pad(arr, axis, npad=None, mode='constant', ncore=None, **kwargs):
      Severity: Minor
      Found in source/tomopy/misc/morph.py - About 45 mins to fix

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

        def _retrieve_phase(tomo, phase_filter, px, py, prj, pad):
        Severity: Minor
        Found in source/tomopy/prep/phase.py - About 45 mins to fix

          Avoid deeply nested control flow statements.
          Open

                              if not isinstance(kwargs[key], np.float32):
                                  kwargs[key] = np.array(value, dtype='float32')
          
                  # Set kwarg defaults.
                  for kw in allowed_kwargs[algorithm]:
          Severity: Major
          Found in source/tomopy/recon/algorithm.py - About 45 mins to fix

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

            def remove_stripe_based_filtering(tomo,
            Severity: Minor
            Found in source/tomopy/prep/stripe.py - About 45 mins to fix

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

              def _rs_filter(sinogram, window, listsign, size, dim, pad):
              Severity: Minor
              Found in source/tomopy/prep/stripe.py - About 45 mins to fix

                Function median_filter_cuda has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                Open

                def median_filter_cuda(arr, size=3, axis=0):
                    """
                    Apply median filter to 3D array along 0 axis with GPU support.
                    The winAllow is for A6000, Tian X support 3 to 8
                
                
                Severity: Minor
                Found in source/tomopy/misc/corr.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 _remove_stripe_fw has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                Open

                def _remove_stripe_fw(tomo, level, wname, sigma, pad):
                    dx, dy, dz = tomo.shape
                    nx = dx
                    if pad:
                        nx = dx + dx // 8
                Severity: Minor
                Found in source/tomopy/prep/stripe.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 find_ctest_token has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                Open

                def find_ctest_token():
                    """
                    Add authentification token if it exists
                    """
                    token_string = os.environ.get("CTEST_TOKEN")
                Severity: Minor
                Found in benchmarking/__init__.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 build_name_append has 6 arguments (exceeds 4 allowed). Consider refactoring.
                Open

                def build_name_append(item, separate=True, prefix="[", suffix="]", check=True, reset=False):
                Severity: Minor
                Found in benchmarking/__init__.py - About 45 mins to fix

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

                  def c_pml_hybrid(tomo, center, recon, theta, **kwargs):
                  Severity: Minor
                  Found in source/tomopy/util/extern/recon.py - About 35 mins to fix

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

                    def _calc_pad(tomo, pixel_size, dist, energy, pad):
                    Severity: Minor
                    Found in source/tomopy/prep/phase.py - About 35 mins to fix

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

                      def output_images(rec, fpath, format="jpeg", scale=1, ncol=1):
                      Severity: Minor
                      Found in source/tomopy/misc/benchmark.py - About 35 mins to fix

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

                        def ufo_dfi(tomo, center, recon, theta, **kwargs):
                        Severity: Minor
                        Found in source/tomopy/recon/wrappers.py - About 35 mins to fix

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

                              def ifft2(x, s=None, axes=(-2,-1), overwrite_input=False, extra_info=None):
                          Severity: Minor
                          Found in source/tomopy/util/misc.py - About 35 mins to fix

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

                            def trim_sinogram(data, center, x, y, diameter):
                            Severity: Minor
                            Found in source/tomopy/misc/morph.py - About 35 mins to fix

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

                              def ufo_fbp(tomo, center, recon, theta, **kwargs):
                              Severity: Minor
                              Found in source/tomopy/recon/wrappers.py - About 35 mins to fix

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

                                def _init_recon(shape, init_recon, val=1e-6, sharedmem=True, empty=False):
                                Severity: Minor
                                Found in source/tomopy/recon/algorithm.py - About 35 mins to fix

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

                                  def _remove_stripe_fw(tomo, level, wname, sigma, pad):
                                  Severity: Minor
                                  Found in source/tomopy/prep/stripe.py - About 35 mins to fix
                                    Severity
                                    Category
                                    Status
                                    Source
                                    Language