tomopy/tomopy

View on GitHub

Showing 176 of 354 total issues

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

def reconstruct(h5fname, sino, rot_center, args, blocked_views=None):
Severity: Minor
Found in benchmarking/rec.py - About 35 mins to fix

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

    def rec_partial(h5fname, rot_center, args, blocked_views, nchunks=1):
    Severity: Minor
    Found in benchmarking/rec.py - About 35 mins to fix

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

      def _get_otf(dx, dy, px, py, spotsize):
      Severity: Minor
      Found in source/tomopy/sim/project.py - About 35 mins to fix

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

            def _test_shape(self, a, expected_shape, axis=0, ncore=None, nchunk=None):
        Severity: Minor
        Found in test/test_tomopy/test_util/test_mproc.py - About 35 mins to fix

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

          def probe_gauss(nx, ny, fwhm=None, center=None, max_int=1):
          Severity: Minor
          Found in source/tomopy/sim/propagate.py - About 35 mins to fix

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

            def calc_intensity(probe, proj, shift_x=None, shift_y=None, mode='near'):
            Severity: Minor
            Found in source/tomopy/sim/propagate.py - About 35 mins to fix

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

              def rec_full(h5fname, rot_center, args, blocked_views, nchunks=16):
              Severity: Minor
              Found in benchmarking/rec.py - About 35 mins to fix

                Function run_pyctest has a Cognitive Complexity of 7 (exceeds 5 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 35 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 median_filter_nonfinite has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                Open

                def median_filter_nonfinite(arr, size=3, callback=None):
                    """
                    Remove nonfinite values from a 3D array using an in-place 2D median filter.
                
                    The 2D selective median filter is applied along the last two axes of
                Severity: Minor
                Found in source/tomopy/misc/corr.py - About 35 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_phantom_test has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                Open

                def create_phantom_test(args, bench_props, phantom):
                    """
                    Create test(s) for the specified algorithms
                    """
                    pyexe = pyctest.PYTHON_EXECUTABLE
                Severity: Minor
                Found in benchmarking/__init__.py - About 35 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 c_shared_lib has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                Open

                def c_shared_lib(lib_name, error=True):
                    """Get the path and import the C-shared library.
                
                    The ctypes.util.find_library function preprends "lib" to the name.
                    """
                Severity: Minor
                Found in source/tomopy/util/extern/__init__.py - About 25 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 lprec has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                Open

                def lprec(tomo, center, recon, theta, **kwargs):
                    """
                    Reconstruct object using the Log-polar based method
                    https://github.com/math-vrn/lprec
                
                
                Severity: Minor
                Found in source/tomopy/recon/wrappers.py - About 25 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_center has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                Open

                def find_center(
                        tomo, theta, ind=None, init=None,
                        tol=0.5, mask=True, ratio=1., sinogram_order=False):
                    """
                    Find rotation axis location.
                Severity: Minor
                Found in source/tomopy/recon/rotation.py - About 25 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 normalize has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                Open

                def normalize(
                    arr,
                    flat,
                    dark,
                    cutoff=None,
                Severity: Minor
                Found in source/tomopy/prep/normalize.py - About 25 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_globus_test has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                Open

                def create_globus_test(args, bench_props, algorithm, phantom):
                    """
                    Create a test from TomoBank (data provided by globus)
                    """
                    # skip when generating C coverage when globus enabled
                Severity: Minor
                Found in benchmarking/__init__.py - About 25 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 rec_partial has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                Open

                def rec_partial(h5fname, rot_center, args, blocked_views, nchunks=1):
                
                    data_size = get_dx_dims(h5fname, 'data')
                    print("data size: {}".format(data_size))
                
                
                Severity: Minor
                Found in benchmarking/rec.py - About 25 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

                Severity
                Category
                Status
                Source
                Language