tomopy/tomopy

View on GitHub

Showing 162 of 321 total issues

Function astra has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

def astra(tomo, center, recon, theta, **kwargs):
    """
    Reconstruct object using the ASTRA toolbox

    Extra options
Severity: Minor
Found in source/tomopy/recon/wrappers.py - About 1 hr 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 run_pyctest has 31 lines of code (exceeds 25 allowed). Consider refactoring.
Open

def run_pyctest():
    '''
    Configure PyCTest and execute
    '''
    # run argparse, checkout source, copy over files
Severity: Minor
Found in pyctest_tomopy.py - About 1 hr to fix

    Function ufo_fbp has 29 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    def ufo_fbp(tomo, center, recon, theta, **kwargs):
        """
        Reconstruct object using UFO's FBP pipeline
        """
        import gi
    Severity: Minor
    Found in source/tomopy/recon/wrappers.py - About 1 hr to fix

      Function astra_rec has 9 arguments (exceeds 4 allowed). Consider refactoring.
      Open

      def astra_rec(tomo, center, recon, theta, vol_geom, niter, proj_type, gpu_index, opts):
      Severity: Major
      Found in source/tomopy/recon/wrappers.py - About 1 hr to fix

        Function recon has 9 arguments (exceeds 4 allowed). Consider refactoring.
        Open

        def recon(tomo,
        Severity: Major
        Found in source/tomopy/recon/algorithm.py - About 1 hr to fix

          Function lpmultigpu has 9 arguments (exceeds 4 allowed). Consider refactoring.
          Open

          def lpmultigpu(lp, lpmethod, recon, tomo, num_iter, reg_par, gpu_list, lock, ids):
          Severity: Major
          Found in source/tomopy/recon/wrappers.py - About 1 hr to fix

            Function find_center_vo has 9 arguments (exceeds 4 allowed). Consider refactoring.
            Open

            def find_center_vo(tomo, ind=None, smin=-50, smax=50, srad=6, step=0.25,
            Severity: Major
            Found in source/tomopy/recon/rotation.py - About 1 hr to fix

              Function vector2 has 9 arguments (exceeds 4 allowed). Consider refactoring.
              Open

              def vector2(tomo1, tomo2, theta1, theta2, center1=None, center2=None, num_iter=1, axis1=1, axis2=2):
              Severity: Major
              Found in source/tomopy/recon/vector.py - About 1 hr to fix

                Function reconstruct has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                def reconstruct(h5fname, sino, rot_center, args, blocked_views=None):
                
                    # not setting this will cause issues on supercomputers
                    # allow user to override though
                    os.environ.setdefault("OMP_NUM_THREADS", "1")
                Severity: Minor
                Found in benchmarking/rec.py - About 1 hr to fix

                  Function build_name_append has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                  Open

                  def build_name_append(item, separate=True, prefix="[", suffix="]", check=True, reset=False):
                      if reset:
                          pyctest.BUILD_NAME = ""
                      # if not list, check if is None
                      if item is None or not item:
                  Severity: Minor
                  Found in benchmarking/__init__.py - About 1 hr 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 align_seq has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                  Open

                  def align_seq(
                          prj, ang, fdir='.', iters=10, pad=(0, 0),
                          blur=True, center=None, algorithm='sirt',
                          upsample_factor=10, rin=0.5, rout=0.8,
                          save=False, debug=True):
                  Severity: Minor
                  Found in source/tomopy/prep/alignment.py - About 1 hr 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 output_images has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                  Open

                  def output_images(rec, fpath, format="jpeg", scale=1, ncol=1):
                      """Save an image stack as a series of concatenated images.
                  
                      Each set of ncol images are concatenated horizontally and saved together
                      into files named {fpath}_0_{ncol}.{img_format},
                  Severity: Minor
                  Found in source/tomopy/misc/benchmark.py - About 1 hr 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_center_cost has 8 arguments (exceeds 4 allowed). Consider refactoring.
                  Open

                  def _find_center_cost(
                  Severity: Major
                  Found in source/tomopy/recon/rotation.py - About 1 hr to fix

                    Function init_shared has 8 arguments (exceeds 4 allowed). Consider refactoring.
                    Open

                    def init_shared(
                    Severity: Major
                    Found in source/tomopy/util/mproc.py - About 1 hr to fix

                      Function c_sample has 8 arguments (exceeds 4 allowed). Consider refactoring.
                      Open

                      def c_sample(mode, arr, dx, dy, dz, level, axis, out):
                      Severity: Major
                      Found in source/tomopy/util/extern/misc.py - About 1 hr to fix

                        Function _dist_recon has 8 arguments (exceeds 4 allowed). Consider refactoring.
                        Open

                        def _dist_recon(tomo, center, recon, algorithm, args, kwargs, ncore, nchunk):
                        Severity: Major
                        Found in source/tomopy/recon/algorithm.py - About 1 hr to fix

                          Function find_center has 8 arguments (exceeds 4 allowed). Consider refactoring.
                          Open

                          def find_center(
                          Severity: Major
                          Found in source/tomopy/recon/rotation.py - About 1 hr to fix

                            Function distribute_jobs has 8 arguments (exceeds 4 allowed). Consider refactoring.
                            Open

                            def distribute_jobs(arr,
                            Severity: Major
                            Found in source/tomopy/util/mproc.py - About 1 hr to fix

                              Function retrieve_phase has 8 arguments (exceeds 4 allowed). Consider refactoring.
                              Open

                              def retrieve_phase(
                              Severity: Major
                              Found in source/tomopy/prep/phase.py - About 1 hr to fix

                                Function project has 8 arguments (exceeds 4 allowed). Consider refactoring.
                                Open

                                def project(
                                Severity: Major
                                Found in source/tomopy/sim/project.py - About 1 hr to fix
                                  Severity
                                  Category
                                  Status
                                  Source
                                  Language