tomopy/tomopy

View on GitHub
source/tomopy/prep/stripe.py

Summary

Maintainability
F
1 wk
Test Coverage

File stripe.py has 969 lines of code (exceeds 250 allowed). Consider refactoring.
Open

#!/usr/bin/env python
# -*- coding: utf-8 -*-

# #########################################################################
# Copyright (c) 2015-2019, UChicago Argonne, LLC. All rights reserved.    #
Severity: Major
Found in source/tomopy/prep/stripe.py - About 2 days to fix

    Function stripes_mask3d has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
    Open

    def stripes_mask3d(weights,
                       threshold=0.6,
                       min_stripe_length=20,
                       min_stripe_depth=10,
                       min_stripe_width=5,
    Severity: Minor
    Found in source/tomopy/prep/stripe.py - About 2 hrs 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 stripes_detect3d has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
    Open

    def stripes_detect3d(tomo, size=10, radius=3, ncore=None):
        """
        Detect stripes in a 3D array. Usually applied to normalized projection
        data. The algorithm is presented in the paper :cite:`Kazantsev:23`.
    
    
    Severity: Minor
    Found in source/tomopy/prep/stripe.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 remove_large_stripe has 7 arguments (exceeds 4 allowed). Consider refactoring.
    Open

    def remove_large_stripe(tomo,
    Severity: Major
    Found in source/tomopy/prep/stripe.py - About 50 mins to fix

      Function remove_stripe_based_interpolation has 7 arguments (exceeds 4 allowed). Consider refactoring.
      Open

      def remove_stripe_based_interpolation(tomo,
      Severity: Major
      Found in source/tomopy/prep/stripe.py - About 50 mins to fix

        Function remove_all_stripe has 7 arguments (exceeds 4 allowed). Consider refactoring.
        Open

        def remove_all_stripe(tomo,
        Severity: Major
        Found in source/tomopy/prep/stripe.py - About 50 mins to fix

          Function stripes_mask3d has 7 arguments (exceeds 4 allowed). Consider refactoring.
          Open

          def stripes_mask3d(weights,
          Severity: Major
          Found in source/tomopy/prep/stripe.py - About 50 mins to fix

            Function remove_stripe_fw has 7 arguments (exceeds 4 allowed). Consider refactoring.
            Open

            def remove_stripe_fw(tomo,
            Severity: Major
            Found in source/tomopy/prep/stripe.py - About 50 mins to fix

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

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

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

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

                        def remove_stripe_ti(tomo, nblock=0, alpha=1.5, ncore=None, nchunk=None):
                        Severity: Minor
                        Found in source/tomopy/prep/stripe.py - About 35 mins to fix

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

                          def _remove_stripe_based_interpolation(tomo, snr, size, drop_ratio, norm):
                          Severity: Minor
                          Found in source/tomopy/prep/stripe.py - About 35 mins to fix

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

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

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

                              def _remove_large_stripe(tomo, snr, size, drop_ratio, norm):
                              Severity: Minor
                              Found in source/tomopy/prep/stripe.py - About 35 mins to fix

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

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

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

                                  def _remove_all_stripe(tomo, snr, la_size, sm_size, dim):
                                  Severity: Minor
                                  Found in source/tomopy/prep/stripe.py - About 35 mins to fix

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

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

                                              if len(listxmiss) > 0:
                                                  matxmiss, maty = np.meshgrid(listxmiss, listy)
                                                  output = finter.ev(np.ndarray.flatten(maty),
                                                                     np.ndarray.flatten(matxmiss))
                                                  sinogram[:, listxmiss] = output.reshape(matxmiss.shape)
                                          Severity: Major
                                          Found in source/tomopy/prep/stripe.py and 1 other location - About 4 hrs to fix
                                          source/tomopy/prep/stripe.py on lines 829..833

                                          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 79.

                                          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

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

                                              if len(listxmiss) > 0:
                                                  matxmiss, maty = np.meshgrid(listxmiss, listy)
                                                  output = finter.ev(np.ndarray.flatten(maty),
                                                                     np.ndarray.flatten(matxmiss))
                                                  sinogram[:, listxmiss] = output.reshape(matxmiss.shape)
                                          Severity: Major
                                          Found in source/tomopy/prep/stripe.py and 1 other location - About 4 hrs to fix
                                          source/tomopy/prep/stripe.py on lines 973..977

                                          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 79.

                                          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 2 locations. Consider refactoring.
                                          Open

                                              if tomo.ndim == 3:
                                                  dz, dy, dx = tomo.shape
                                                  if (dz == 0) or (dy == 0) or (dx == 0):
                                                      msg = "The length of one of dimensions is equal to zero"
                                                      raise ValueError(msg)
                                          Severity: Major
                                          Found in source/tomopy/prep/stripe.py and 1 other location - About 4 hrs to fix
                                          source/tomopy/prep/stripe.py on lines 1144..1151

                                          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 76.

                                          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 2 locations. Consider refactoring.
                                          Open

                                              if weights.ndim == 3:
                                                  dz, dy, dx = weights.shape
                                                  if (dz == 0) or (dy == 0) or (dx == 0):
                                                      msg = "The length of one of dimensions is equal to zero"
                                                      raise ValueError(msg)
                                          Severity: Major
                                          Found in source/tomopy/prep/stripe.py and 1 other location - About 4 hrs to fix
                                          source/tomopy/prep/stripe.py on lines 1042..1049

                                          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 76.

                                          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

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

                                              if size is None:
                                                  if tomo.shape[2] > 2000:
                                                      size = 21
                                                  else:
                                                      size = max(5, int(0.01 * tomo.shape[2]))
                                          Severity: Major
                                          Found in source/tomopy/prep/stripe.py and 1 other location - About 3 hrs to fix
                                          source/tomopy/prep/stripe.py on lines 431..435

                                          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 62.

                                          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

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

                                              if size is None:
                                                  if tomo.shape[2] > 2000:
                                                      size = 21
                                                  else:
                                                      size = max(5, int(0.01 * tomo.shape[2]))
                                          Severity: Major
                                          Found in source/tomopy/prep/stripe.py and 1 other location - About 3 hrs to fix
                                          source/tomopy/prep/stripe.py on lines 514..518

                                          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 62.

                                          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 2 locations. Consider refactoring.
                                          Open

                                          def remove_large_stripe(tomo,
                                                                  snr=3,
                                                                  size=51,
                                                                  drop_ratio=0.1,
                                                                  norm=True,
                                          Severity: Major
                                          Found in source/tomopy/prep/stripe.py and 1 other location - About 2 hrs to fix
                                          source/tomopy/prep/stripe.py on lines 899..941

                                          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 57.

                                          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 2 locations. Consider refactoring.
                                          Open

                                          def remove_stripe_based_interpolation(tomo,
                                                                                snr=3,
                                                                                size=31,
                                                                                drop_ratio=0.1,
                                                                                norm=True,
                                          Severity: Major
                                          Found in source/tomopy/prep/stripe.py and 1 other location - About 2 hrs to fix
                                          source/tomopy/prep/stripe.py on lines 657..698

                                          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 57.

                                          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 2 locations. Consider refactoring.
                                          Open

                                              for m in range(tomo.shape[1]):
                                                  sino = tomo[:, m, :]
                                                  tomo[:, m, :] = _rs_large(sino, snr, size, matindex, drop_ratio, norm)
                                          Severity: Major
                                          Found in source/tomopy/prep/stripe.py and 1 other location - About 2 hrs to fix
                                          source/tomopy/prep/stripe.py on lines 519..521

                                          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 57.

                                          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 2 locations. Consider refactoring.
                                          Open

                                              for m in range(tomo.shape[1]):
                                                  sino = tomo[:, m, :]
                                                  tomo[:, m, :] = _rs_filter(sino, window, listsign, size, dim, pad)
                                          Severity: Major
                                          Found in source/tomopy/prep/stripe.py and 1 other location - About 2 hrs to fix
                                          source/tomopy/prep/stripe.py on lines 761..763

                                          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 57.

                                          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 2 locations. Consider refactoring.
                                          Open

                                              for m in range(tomo.shape[1]):
                                                  sino = tomo[:, m, :]
                                                  tomo[:, m, :] = _rs_dead(sino, snr, size, matindex, norm)
                                          Severity: Major
                                          Found in source/tomopy/prep/stripe.py and 1 other location - About 2 hrs to fix
                                          source/tomopy/prep/stripe.py on lines 652..654

                                          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 56.

                                          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 2 locations. Consider refactoring.
                                          Open

                                              for m in range(tomo.shape[1]):
                                                  sino = tomo[:, m, :]
                                                  tomo[:, m, :] = _rs_fit(sino, order, win2d, matsign, pad)
                                          Severity: Major
                                          Found in source/tomopy/prep/stripe.py and 1 other location - About 2 hrs to fix
                                          source/tomopy/prep/stripe.py on lines 842..844

                                          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 56.

                                          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 4 locations. Consider refactoring.
                                          Open

                                              matsortback = np.asarray([row[row[:, 0].argsort()] for row in matsort])
                                          Severity: Major
                                          Found in source/tomopy/prep/stripe.py and 3 other locations - About 1 hr to fix
                                          source/tomopy/prep/stripe.py on lines 419..419
                                          source/tomopy/prep/stripe.py on lines 750..750
                                          source/tomopy/prep/stripe.py on lines 752..752

                                          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 38.

                                          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 4 locations. Consider refactoring.
                                          Open

                                              matsort = np.asarray([row[row[:, 1].argsort()] for row in matcomb])
                                          Severity: Major
                                          Found in source/tomopy/prep/stripe.py and 3 other locations - About 1 hr to fix
                                          source/tomopy/prep/stripe.py on lines 424..424
                                          source/tomopy/prep/stripe.py on lines 750..750
                                          source/tomopy/prep/stripe.py on lines 752..752

                                          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 38.

                                          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 4 locations. Consider refactoring.
                                          Open

                                              matsort = np.asarray([row[row[:, 1].argsort()] for row in matcombine])
                                          Severity: Major
                                          Found in source/tomopy/prep/stripe.py and 3 other locations - About 1 hr to fix
                                          source/tomopy/prep/stripe.py on lines 419..419
                                          source/tomopy/prep/stripe.py on lines 424..424
                                          source/tomopy/prep/stripe.py on lines 752..752

                                          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 38.

                                          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

                                          def remove_stripe_based_filtering(tomo,
                                                                            sigma=3,
                                                                            size=None,
                                                                            dim=1,
                                                                            ncore=None,
                                          Severity: Major
                                          Found in source/tomopy/prep/stripe.py and 2 other locations - About 1 hr to fix
                                          source/tomopy/prep/alignment.py on lines 919..954
                                          source/tomopy/prep/stripe.py on lines 766..803

                                          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 38.

                                          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 4 locations. Consider refactoring.
                                          Open

                                              matsortback = np.asarray([row[row[:, 0].argsort()] for row in matsort])
                                          Severity: Major
                                          Found in source/tomopy/prep/stripe.py and 3 other locations - About 1 hr to fix
                                          source/tomopy/prep/stripe.py on lines 419..419
                                          source/tomopy/prep/stripe.py on lines 424..424
                                          source/tomopy/prep/stripe.py on lines 750..750

                                          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 38.

                                          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

                                          def remove_dead_stripe(tomo,
                                                                 snr=3,
                                                                 size=51,
                                                                 norm=True,
                                                                 ncore=None,
                                          Severity: Major
                                          Found in source/tomopy/prep/stripe.py and 2 other locations - About 1 hr to fix
                                          source/tomopy/prep/alignment.py on lines 919..954
                                          source/tomopy/prep/stripe.py on lines 441..479

                                          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 38.

                                          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

                                          def remove_stripe_based_fitting(tomo,
                                                                          order=3,
                                                                          sigma=(5, 20),
                                                                          ncore=None,
                                                                          nchunk=None):
                                          Severity: Major
                                          Found in source/tomopy/prep/stripe.py and 2 other locations - About 55 mins to fix
                                          source/tomopy/prep/stripe.py on lines 182..211
                                          source/tomopy/prep/stripe.py on lines 367..401

                                          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 37.

                                          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

                                          def remove_stripe_based_sorting(tomo,
                                                                          size=None,
                                                                          dim=1,
                                                                          ncore=None,
                                                                          nchunk=None):
                                          Severity: Major
                                          Found in source/tomopy/prep/stripe.py and 2 other locations - About 55 mins to fix
                                          source/tomopy/prep/stripe.py on lines 182..211
                                          source/tomopy/prep/stripe.py on lines 524..559

                                          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 37.

                                          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

                                          def remove_stripe_ti(tomo, nblock=0, alpha=1.5, ncore=None, nchunk=None):
                                              """
                                              Remove horizontal stripes from sinogram using Titarenko's
                                              approach :cite:`Miqueles:14`.
                                          
                                          
                                          Severity: Major
                                          Found in source/tomopy/prep/stripe.py and 2 other locations - About 55 mins to fix
                                          source/tomopy/prep/stripe.py on lines 367..401
                                          source/tomopy/prep/stripe.py on lines 524..559

                                          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 37.

                                          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 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 2 locations. Consider refactoring.
                                          Open

                                              if min_stripe_width <= 0 or min_stripe_width >= dx:
                                                  msg = ("The minimum width of a stripe cannot be zero "
                                                         "or exceed the size of the horizontal 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 1153..1156

                                          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 2 locations. Consider refactoring.
                                          Open

                                                      d = np.sqrt(p + alpha * np.abs(p.min()))
                                          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 227..227

                                          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 2 locations. Consider refactoring.
                                          Open

                                                      d = np.sqrt(p + alpha * np.fabs(p.min()))
                                          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 221..221

                                          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 2 locations. Consider refactoring.
                                          Open

                                                  sinosmooth[i] = np.real(
                                                      ifft(fft(sinolist * listsign) * window) * listsign)[pad:ncol - pad]
                                          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 624..624

                                          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 2 locations. Consider refactoring.
                                          Open

                                              matfilter = np.real(ifft2(fft2(matpad * matsign) * win2d) * matsign)
                                          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 501..502

                                          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

                                          There are no issues that match your filters.

                                          Category
                                          Status