tomopy/tomopy

View on GitHub

Showing 176 of 354 total issues

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

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

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

    File corr.py has 910 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/misc/corr.py - About 2 days to fix

      File alignment.py has 791 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      #!/usr/bin/env python
      # -*- coding: utf-8 -*-
      
      # #########################################################################
      # Copyright (c) 2016-2019, UChicago Argonne, LLC. All rights reserved.    #
      Severity: Major
      Found in source/tomopy/prep/alignment.py - About 1 day to fix

        File rotation.py has 469 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/rotation.py - About 7 hrs to fix

          File recon.py has 462 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/util/extern/recon.py - About 7 hrs to fix

            File project.py has 434 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/sim/project.py - About 6 hrs to fix

              Function recon has a Cognitive Complexity of 37 (exceeds 5 allowed). Consider refactoring.
              Open

              def recon(tomo,
                        theta,
                        center=None,
                        sinogram_order=False,
                        algorithm=None,
              Severity: Minor
              Found in source/tomopy/recon/algorithm.py - About 5 hrs to fix

              Cognitive Complexity

              Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

              A method's cognitive complexity is based on a few simple rules:

              • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
              • Code is considered more complex for each "break in the linear flow of the code"
              • Code is considered more complex when "flow breaking structures are nested"

              Further reading

              Function inpainter_morph has a Cognitive Complexity of 36 (exceeds 5 allowed). Consider refactoring.
              Open

              def inpainter_morph(
                  arr,
                  mask,
                  size=5,
                  iterations=2,
              Severity: Minor
              Found in source/tomopy/misc/corr.py - About 5 hrs to fix

              Cognitive Complexity

              Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

              A method's cognitive complexity is based on a few simple rules:

              • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
              • Code is considered more complex for each "break in the linear flow of the code"
              • Code is considered more complex when "flow breaking structures are nested"

              Further reading

              Function distribute_jobs has a Cognitive Complexity of 34 (exceeds 5 allowed). Consider refactoring.
              Open

              def distribute_jobs(arr,
                                  func,
                                  axis,
                                  args=None,
                                  kwargs=None,
              Severity: Minor
              Found in source/tomopy/util/mproc.py - About 5 hrs to fix

              Cognitive Complexity

              Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

              A method's cognitive complexity is based on a few simple rules:

              • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
              • Code is considered more complex for each "break in the linear flow of the code"
              • Code is considered more complex when "flow breaking structures are nested"

              Further reading

              Function _dist_recon has a Cognitive Complexity of 33 (exceeds 5 allowed). Consider refactoring.
              Open

              def _dist_recon(tomo, center, recon, algorithm, args, kwargs, ncore, nchunk):
                  axis_size = recon.shape[0]
                  ncore, slcs = mproc.get_ncore_slices(axis_size, ncore, nchunk)
              
                  if len(slcs) < ncore:
              Severity: Minor
              Found in source/tomopy/recon/algorithm.py - About 4 hrs to fix

              Cognitive Complexity

              Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

              A method's cognitive complexity is based on a few simple rules:

              • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
              • Code is considered more complex for each "break in the linear flow of the code"
              • Code is considered more complex when "flow breaking structures are nested"

              Further reading

              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

                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

                    Function configure has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring.
                    Open

                    def configure():
                        # set site if set in environ
                        if os.environ.get("CTEST_SITE") is not None:
                            pyctest.CTEST_SITE = os.environ.get("CTEST_SITE")
                    
                    
                    Severity: Minor
                    Found in pyctest_tomopy.py - About 3 hrs to fix

                    Cognitive Complexity

                    Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                    A method's cognitive complexity is based on a few simple rules:

                    • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                    • Code is considered more complex for each "break in the linear flow of the code"
                    • Code is considered more complex when "flow breaking structures are nested"

                    Further reading

                    Function astra_rec has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
                    Open

                    def astra_rec(tomo, center, recon, theta, vol_geom, niter, proj_type, gpu_index, opts):
                        # Lazy import ASTRA
                        import astra as astra_mod
                        nslices, nang, ndet = tomo.shape
                        cfg = astra_mod.astra_dict(opts['method'])
                    Severity: Minor
                    Found in source/tomopy/recon/wrappers.py - About 3 hrs to fix

                    Cognitive Complexity

                    Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                    A method's cognitive complexity is based on a few simple rules:

                    • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                    • Code is considered more complex for each "break in the linear flow of the code"
                    • Code is considered more complex when "flow breaking structures are nested"

                    Further reading

                    File mproc.py has 292 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/util/mproc.py - About 3 hrs to fix

                      File rec.py has 292 lines of code (exceeds 250 allowed). Consider refactoring.
                      Open

                      #!/usr/bin/env python
                      # -*- coding: utf-8 -*-
                      
                      """
                      TomoPy script to reconstruct a TomoBank file
                      Severity: Minor
                      Found in benchmarking/rec.py - About 3 hrs to fix

                        Function pad has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
                        Open

                        def pad(arr, axis, npad=None, mode='constant', ncore=None, **kwargs):
                            """
                            Pad an array along specified axis.
                        
                            Parameters
                        Severity: Minor
                        Found in source/tomopy/misc/morph.py - About 2 hrs to fix

                        Cognitive Complexity

                        Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                        A method's cognitive complexity is based on a few simple rules:

                        • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                        • Code is considered more complex for each "break in the linear flow of the code"
                        • Code is considered more complex when "flow breaking structures are nested"

                        Further reading

                        Function configure has 61 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                        def configure():
                            # set site if set in environ
                            if os.environ.get("CTEST_SITE") is not None:
                                pyctest.CTEST_SITE = os.environ.get("CTEST_SITE")
                        
                        
                        Severity: Major
                        Found in pyctest_tomopy.py - About 2 hrs to fix

                          File pyctest_tomopy.py has 262 lines of code (exceeds 250 allowed). Consider refactoring.
                          Open

                          #!/usr/bin/env python
                          # -*- coding: utf-8 -*-
                          
                          """
                          PyCTest driver for TomoPy
                          Severity: Minor
                          Found in pyctest_tomopy.py - About 2 hrs to fix
                            Severity
                            Category
                            Status
                            Source
                            Language