tomopy/tomopy

View on GitHub

Showing 354 of 354 total issues

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

def _rs_fit(sinogram, order, win2d, matsign, pad):
Severity: Minor
Found in source/tomopy/prep/stripe.py - About 35 mins to fix

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                    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

                                  Similar blocks of code found in 2 locations. Consider refactoring.
                                  Open

                                      if min_stripe_length <= 0 or min_stripe_length >= dz:
                                          msg = ("The minimum length of a stripe cannot be zero "
                                                 "or exceed the size of the angular dimension")
                                          raise ValueError(msg)
                                  Severity: Minor
                                  Found in source/tomopy/prep/stripe.py and 1 other location - About 35 mins to fix
                                  source/tomopy/prep/stripe.py on lines 1163..1166

                                  Duplicated Code

                                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                  Tuning

                                  This issue has a mass of 33.

                                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                  Refactorings

                                  Further Reading

                                  Similar blocks of code found in 3 locations. Consider refactoring.
                                  Open

                                      recon_shape = (tomo1.shape[0], tomo1.shape[2], tomo1.shape[2])
                                  Severity: Minor
                                  Found in source/tomopy/recon/vector.py and 2 other locations - About 35 mins to fix
                                  source/tomopy/recon/vector.py on lines 79..79
                                  source/tomopy/recon/vector.py on lines 126..126

                                  Duplicated Code

                                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                  Tuning

                                  This issue has a mass of 33.

                                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                  Refactorings

                                  Further Reading

                                  Severity
                                  Category
                                  Status
                                  Source
                                  Language