tomopy/tomopy

View on GitHub

Showing 354 of 354 total issues

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

    def test_osem(self):
        rng = default_rng(0)
        ind_block = np.arange(len(self.ang))
        rng.shuffle(ind_block)
        assert_allclose(
Severity: Major
Found in test/test_tomopy/test_recon/test_algorithm.py and 3 other locations - About 4 hrs to fix
test/test_tomopy/test_recon/test_algorithm.py on lines 88..101
test/test_tomopy/test_recon/test_algorithm.py on lines 216..229
test/test_tomopy/test_recon/test_algorithm.py on lines 234..247

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

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

    def test_ospml_hybrid(self):
        rng = default_rng(0)
        ind_block = np.arange(len(self.ang))
        rng.shuffle(ind_block)
        assert_allclose(
Severity: Major
Found in test/test_tomopy/test_recon/test_algorithm.py and 3 other locations - About 4 hrs to fix
test/test_tomopy/test_recon/test_algorithm.py on lines 88..101
test/test_tomopy/test_recon/test_algorithm.py on lines 198..211
test/test_tomopy/test_recon/test_algorithm.py on lines 234..247

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

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

    def test_ospml_quad(self):
        rng = default_rng(0)
        ind_block = np.arange(len(self.ang))
        rng.shuffle(ind_block)
        assert_allclose(
Severity: Major
Found in test/test_tomopy/test_recon/test_algorithm.py and 3 other locations - About 4 hrs to fix
test/test_tomopy/test_recon/test_algorithm.py on lines 88..101
test/test_tomopy/test_recon/test_algorithm.py on lines 198..211
test/test_tomopy/test_recon/test_algorithm.py on lines 216..229

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

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

File algorithm.py has 360 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: Minor
Found in source/tomopy/recon/algorithm.py - About 4 hrs 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

        LIB_TOMOPY_RECON.project(
            dtype.as_c_float_p(obj),
            dtype.as_c_int(oy),
            dtype.as_c_int(ox),
            dtype.as_c_int(oz),
    Severity: Major
    Found in source/tomopy/util/extern/recon.py and 1 other location - About 4 hrs to fix
    source/tomopy/util/extern/misc.py on lines 176..186

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

    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

        LIB_TOMOPY_MISC.Inpainter_morph_main(
            dtype.as_c_float_p(input),
            dtype.as_c_bool_p(mask),
            dtype.as_c_float_p(output),
            dtype.as_c_int(iterations),
    Severity: Major
    Found in source/tomopy/util/extern/misc.py and 1 other location - About 4 hrs to fix
    source/tomopy/util/extern/recon.py on lines 106..116

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

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

        def test_barbara(self):
            assert_equals(barbara().dtype, 'float32')
            assert_equals(barbara().shape, (1, 512, 512))
            assert_equals(barbara(size=(128, 256)).shape, (1, 128, 256))
            assert_equals(barbara(size=64).shape, (1, 64, 64))
    Severity: Major
    Found in test/test_tomopy/test_misc/test_phantom.py and 6 other locations - About 4 hrs to fix
    test/test_tomopy/test_misc/test_phantom.py on lines 63..67
    test/test_tomopy/test_misc/test_phantom.py on lines 75..79
    test/test_tomopy/test_misc/test_phantom.py on lines 81..85
    test/test_tomopy/test_misc/test_phantom.py on lines 87..91
    test/test_tomopy/test_misc/test_phantom.py on lines 93..97
    test/test_tomopy/test_misc/test_phantom.py on lines 99..103

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

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

        def test_cameraman(self):
            assert_equals(cameraman().dtype, 'float32')
            assert_equals(cameraman().shape, (1, 512, 512))
            assert_equals(cameraman(size=(128, 256)).shape, (1, 128, 256))
            assert_equals(cameraman(size=64).shape, (1, 64, 64))
    Severity: Major
    Found in test/test_tomopy/test_misc/test_phantom.py and 6 other locations - About 4 hrs to fix
    test/test_tomopy/test_misc/test_phantom.py on lines 63..67
    test/test_tomopy/test_misc/test_phantom.py on lines 69..73
    test/test_tomopy/test_misc/test_phantom.py on lines 81..85
    test/test_tomopy/test_misc/test_phantom.py on lines 87..91
    test/test_tomopy/test_misc/test_phantom.py on lines 93..97
    test/test_tomopy/test_misc/test_phantom.py on lines 99..103

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

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

        def test_checkerboard(self):
            assert_equals(checkerboard().dtype, 'float32')
            assert_equals(checkerboard().shape, (1, 512, 512))
            assert_equals(checkerboard(size=(128, 256)).shape, (1, 128, 256))
            assert_equals(checkerboard(size=64).shape, (1, 64, 64))
    Severity: Major
    Found in test/test_tomopy/test_misc/test_phantom.py and 6 other locations - About 4 hrs to fix
    test/test_tomopy/test_misc/test_phantom.py on lines 63..67
    test/test_tomopy/test_misc/test_phantom.py on lines 69..73
    test/test_tomopy/test_misc/test_phantom.py on lines 75..79
    test/test_tomopy/test_misc/test_phantom.py on lines 87..91
    test/test_tomopy/test_misc/test_phantom.py on lines 93..97
    test/test_tomopy/test_misc/test_phantom.py on lines 99..103

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

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

        def test_peppers(self):
            assert_equals(peppers().dtype, 'float32')
            assert_equals(peppers().shape, (1, 512, 512))
            assert_equals(peppers(size=(128, 256)).shape, (1, 128, 256))
            assert_equals(peppers(size=64).shape, (1, 64, 64))
    Severity: Major
    Found in test/test_tomopy/test_misc/test_phantom.py and 6 other locations - About 4 hrs to fix
    test/test_tomopy/test_misc/test_phantom.py on lines 63..67
    test/test_tomopy/test_misc/test_phantom.py on lines 69..73
    test/test_tomopy/test_misc/test_phantom.py on lines 75..79
    test/test_tomopy/test_misc/test_phantom.py on lines 81..85
    test/test_tomopy/test_misc/test_phantom.py on lines 87..91
    test/test_tomopy/test_misc/test_phantom.py on lines 99..103

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

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

        def test_baboon(self):
            assert_equals(baboon().dtype, 'float32')
            assert_equals(baboon().shape, (1, 512, 512))
            assert_equals(baboon(size=(128, 256)).shape, (1, 128, 256))
            assert_equals(baboon(size=64).shape, (1, 64, 64))
    Severity: Major
    Found in test/test_tomopy/test_misc/test_phantom.py and 6 other locations - About 4 hrs to fix
    test/test_tomopy/test_misc/test_phantom.py on lines 69..73
    test/test_tomopy/test_misc/test_phantom.py on lines 75..79
    test/test_tomopy/test_misc/test_phantom.py on lines 81..85
    test/test_tomopy/test_misc/test_phantom.py on lines 87..91
    test/test_tomopy/test_misc/test_phantom.py on lines 93..97
    test/test_tomopy/test_misc/test_phantom.py on lines 99..103

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

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

        def test_shepp2d(self):
            assert_equals(shepp2d().dtype, 'float32')
            assert_equals(shepp2d().shape, (1, 512, 512))
            assert_equals(shepp2d(size=(128, 256)).shape, (1, 128, 256))
            assert_equals(shepp2d(size=64).shape, (1, 64, 64))
    Severity: Major
    Found in test/test_tomopy/test_misc/test_phantom.py and 6 other locations - About 4 hrs to fix
    test/test_tomopy/test_misc/test_phantom.py on lines 63..67
    test/test_tomopy/test_misc/test_phantom.py on lines 69..73
    test/test_tomopy/test_misc/test_phantom.py on lines 75..79
    test/test_tomopy/test_misc/test_phantom.py on lines 81..85
    test/test_tomopy/test_misc/test_phantom.py on lines 87..91
    test/test_tomopy/test_misc/test_phantom.py on lines 93..97

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

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

        def test_lena(self):
            assert_equals(lena().dtype, 'float32')
            assert_equals(lena().shape, (1, 512, 512))
            assert_equals(lena(size=(128, 256)).shape, (1, 128, 256))
            assert_equals(lena(size=64).shape, (1, 64, 64))
    Severity: Major
    Found in test/test_tomopy/test_misc/test_phantom.py and 6 other locations - About 4 hrs to fix
    test/test_tomopy/test_misc/test_phantom.py on lines 63..67
    test/test_tomopy/test_misc/test_phantom.py on lines 69..73
    test/test_tomopy/test_misc/test_phantom.py on lines 75..79
    test/test_tomopy/test_misc/test_phantom.py on lines 81..85
    test/test_tomopy/test_misc/test_phantom.py on lines 93..97
    test/test_tomopy/test_misc/test_phantom.py on lines 99..103

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

    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

    File phantom.py has 337 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: Minor
    Found in source/tomopy/misc/phantom.py - About 4 hrs to fix

      File wrappers.py has 335 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: Minor
      Found in source/tomopy/recon/wrappers.py - About 4 hrs to fix

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

            @unittest.skipUnless("CUDA_VERSION" in os.environ, "CUDA_VERSION not set.")
            def test_mlem_gpu(self):
                result = recon(self.prj,
                               self.ang,
                               algorithm='mlem',
        Severity: Major
        Found in test/test_tomopy/test_recon/test_algorithm.py and 1 other location - About 3 hrs to fix
        test/test_tomopy/test_recon/test_algorithm.py on lines 282..292

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

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

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

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

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

        Refactorings

        Further Reading

        Severity
        Category
        Status
        Source
        Language