tomopy/tomopy

View on GitHub

Showing 159 of 306 total issues

File alignment.py has 784 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 stripe.py has 753 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

      File corr.py has 572 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 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 443 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 6 hrs to fix

            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 recon has a Cognitive Complexity of 33 (exceeds 5 allowed). Consider refactoring.
            Open

            def recon(
                    tomo, theta, center=None, sinogram_order=False, algorithm=None,
                    init_recon=None, ncore=None, nchunk=None, **kwargs):
                """
                Reconstruct object from projection data.
            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 project.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/sim/project.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

                  File rec.py has 308 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

                    File algorithm.py has 307 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 3 hrs to fix

                      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

                        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

                        File phantom.py has 271 lines of code (exceeds 250 allowed). Consider refactoring.
                        Open

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

                          Function configure has 62 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 263 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

                              Function detector_drift_adjust_aps_1id has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
                              Open

                              def detector_drift_adjust_aps_1id(imgstacks,
                                                                slit_cnr_ref,
                                                                medfilt2_kernel_size=3,
                                                                medfilt_kernel_size=3,
                                                                ncore=None,
                              Severity: Minor
                              Found in source/tomopy/prep/alignment.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

                              Severity
                              Category
                              Status
                              Source
                              Language