tomopy/tomopy

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

Summary

Maintainability
F
1 wk
Test Coverage

File stripe.py has 754 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 1 day to fix

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

    def remove_all_stripe(tomo, snr=3, la_size=61, sm_size=21, dim=1,
    Severity: Major
    Found in source/tomopy/prep/stripe.py - About 50 mins to fix

      Function remove_large_stripe has 7 arguments (exceeds 4 allowed). 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 - 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, snr=3, size=31, drop_ratio=0.1,
        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(
          Severity: Major
          Found in source/tomopy/prep/stripe.py - About 50 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(
              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_dead_stripe has 6 arguments (exceeds 4 allowed). Consider refactoring.
                  Open

                  def remove_dead_stripe(tomo, snr=3, size=51, norm=True,
                  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_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 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 _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 _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_stripe_based_sorting has 5 arguments (exceeds 4 allowed). Consider refactoring.
                            Open

                            def remove_stripe_based_sorting(tomo, size=None, dim=1, ncore=None, nchunk=None):
                            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_fitting has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                Open

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

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

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

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

                                        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 498..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 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 418..422

                                        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

                                            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 503..506

                                        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_large_stripe(tomo, snr=3, size=51, drop_ratio=0.1, norm=True,
                                                                ncore=None, nchunk=None):
                                            """
                                            Remove large stripe artifacts from sinogram using Nghia Vo's
                                            approach :cite:`Vo:18` (algorithm 5).
                                        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 865..903

                                        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 740..742

                                        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, ncore=None, nchunk=None):
                                            """
                                            Remove most types of stripe artifacts from sinograms based on
                                            interpolation. Derived from algorithm 4, 5, and 6 in :cite:`Vo:18`.
                                        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 640..677

                                        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_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 812..814

                                        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_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 635..637

                                        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

                                            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 404..405
                                        source/tomopy/prep/stripe.py on lines 410..411
                                        source/tomopy/prep/stripe.py on lines 730..731

                                        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 404..405
                                        source/tomopy/prep/stripe.py on lines 410..411
                                        source/tomopy/prep/stripe.py on lines 727..728

                                        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, nchunk=None):
                                            """
                                            Remove stripe artifacts from sinogram using Nghia Vo's
                                            approach :cite:`Vo:18` (algorithm 2).
                                        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 912..947
                                        source/tomopy/prep/stripe.py on lines 745..779

                                        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, nchunk=None):
                                            """
                                            Remove unresponsive and fluctuating stripe artifacts from sinogram using
                                            Nghia Vo's approach :cite:`Vo:18` (algorithm 6).
                                        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 912..947
                                        source/tomopy/prep/stripe.py on lines 428..463

                                        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 410..411
                                        source/tomopy/prep/stripe.py on lines 727..728
                                        source/tomopy/prep/stripe.py on lines 730..731

                                        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 404..405
                                        source/tomopy/prep/stripe.py on lines 727..728
                                        source/tomopy/prep/stripe.py on lines 730..731

                                        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):
                                            """
                                            Remove stripe artifacts from sinogram using Nghia Vo's
                                            approach :cite:`Vo:18` (algorithm 1).
                                        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 176..206
                                        source/tomopy/prep/stripe.py on lines 355..386

                                        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):
                                            """
                                            Remove full and partial stripe artifacts from sinogram using Nghia Vo's
                                            approach :cite:`Vo:18` (algorithm 3).
                                            Suitable for removing partial stripes.
                                        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 176..206
                                        source/tomopy/prep/stripe.py on lines 509..542

                                        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 355..386
                                        source/tomopy/prep/stripe.py on lines 509..542

                                        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

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

                                            if len(listxmiss) > 0:
                                                sinogram[:, listxmiss] = finter(listxmiss, listy)
                                        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 932..933

                                        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

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

                                            if len(listxmiss) > 0:
                                                sinogram[:, listxmiss] = finter(listxmiss, listy)
                                        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 802..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 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 216..216

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

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

                                        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 485..486

                                        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