abeelen/hpproj

View on GitHub

Showing 17 of 33 total issues

Function cut_phot has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
Open

    def cut_phot(self, coord=None, maps_selection=None, apertures=None):
        """Efficiently cut the healpix maps and return cutted fits file with proper header and corresponding photometry

        Parameters
        ----------
Severity: Minor
Found in hpproj/cutsky.py - About 1 hr to fix

Cognitive Complexity

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

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

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

Further reading

Function __init__ has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

    def __init__(self, maps=None, npix=DEFAULT_NPIX, pixsize=DEFAULT_PIXSIZE, ctype=DEFAULT_CTYPE, low_mem=True):
        """Initialization of a CutSky class

        Parameters
        ----------
Severity: Minor
Found in hpproj/cutsky.py - About 1 hr to fix

Cognitive Complexity

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

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

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

Further reading

Function _cut_wcs has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    def _cut_wcs(self, wcs):
        """Efficiently cut the healpix maps and return cutted fits file with proper header

        Parameters
        ----------
Severity: Minor
Found in hpproj/cutsky.py - About 1 hr to fix

Cognitive Complexity

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

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

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

Further reading

Function hp_stack has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

def hp_stack(hp_hdu, coords, pixsize=0.01, shape_out=DEFAULT_SHAPE_OUT, order=0, projection=('GALACTIC', 'TAN'), keep=False):
    """Perform stacking on an healpix map

    Parameters
    ----------
Severity: Minor
Found in hpproj/hp_helper.py - About 1 hr to fix

Cognitive Complexity

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

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

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

Further reading

Function main has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

def main(argv=None):
    """The main routine."""

    args = ini_main(argv)

Severity: Minor
Found in hpproj/cutsky.py - About 55 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 hp_stack has 7 arguments (exceeds 4 allowed). Consider refactoring.
Open

def hp_stack(hp_hdu, coords, pixsize=0.01, shape_out=DEFAULT_SHAPE_OUT, order=0, projection=('GALACTIC', 'TAN'), keep=False):
Severity: Major
Found in hpproj/hp_helper.py - About 50 mins to fix

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

    def view(hp_hdu, coord=None, npix=360, proj_sys='GALACTIC', proj_type='TAN', aspect=1.):
    Severity: Minor
    Found in hpproj/visu.py - About 45 mins to fix

      Function parse_config_map_opt has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
      Open

      def parse_config_map_opt(config, section):
          """Parse map option in a configuration file."""
      
          opt = {'legend': section}
      
      
      Severity: Minor
      Found in hpproj/parse.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 build_hpmap has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
      Open

      def build_hpmap(filenames, low_mem=True):
          """From a filename list, build a tuple usable with gen_hmap()
      
          Parameters
          ----------
      Severity: Minor
      Found in hpproj/hp_helper.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 cutsky has 6 arguments (exceeds 4 allowed). Consider refactoring.
      Open

      def cutsky(lonlat=None, maps=None, patch=None, coordframe=DEFAULT_COORDFRAME, ctype=DEFAULT_CTYPE, apertures=None):
      Severity: Minor
      Found in hpproj/cutsky.py - About 45 mins to fix

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

        def hp_project(hp_hdu, coord, pixsize=0.01, shape_out=DEFAULT_SHAPE_OUT, order=0, projection=('GALACTIC', 'TAN')):
        Severity: Minor
        Found in hpproj/hp_helper.py - About 45 mins to fix

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

          def build_wcs_cube(coord, index, pixsize=0.01, shape_out=DEFAULT_SHAPE_OUT, proj_sys='EQUATORIAL', proj_type='TAN'):
          Severity: Minor
          Found in hpproj/wcs_helper.py - About 45 mins to fix

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

            def build_wcs_2pts(coords, pixsize=None, shape_out=DEFAULT_SHAPE_OUT, proj_sys='EQUATORIAL', proj_type='TAN', relative_pos=(2. / 5, 3. / 5)):
            Severity: Minor
            Found in hpproj/wcs_helper.py - About 45 mins to fix

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

              def hp_to_profile(hp_hdu, wcs, coord, shape_out=DEFAULT_SHAPE_OUT[0], std=False):
              Severity: Minor
              Found in hpproj/hp_helper.py - About 35 mins to fix

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

                def build_wcs(coord, pixsize=0.01, shape_out=DEFAULT_SHAPE_OUT, proj_sys='EQUATORIAL', proj_type='TAN'):
                Severity: Minor
                Found in hpproj/wcs_helper.py - About 35 mins to fix

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

                      def __init__(self, maps=None, npix=DEFAULT_NPIX, pixsize=DEFAULT_PIXSIZE, ctype=DEFAULT_CTYPE, low_mem=True):
                  Severity: Minor
                  Found in hpproj/cutsky.py - About 35 mins to fix

                    Function combine_args_config has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                    Open

                    def combine_args_config(args, config):
                        """
                        Combine the different sources of arguments (command line,
                        configfile or default arguments
                    
                    
                    Severity: Minor
                    Found in hpproj/parse.py - About 25 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

                    Severity
                    Category
                    Status
                    Source
                    Language