nstarman/astronat

View on GitHub

Showing 70 of 70 total issues

Function __call__ has a Cognitive Complexity of 60 (exceeds 5 allowed). Consider refactoring.
Open

    def __call__(self, wrapped_function: T.Callable):
        """Make decorator.

        Parameters
        ----------
Severity: Minor
Found in astronat/units/decorators.py - About 1 day 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 crossmatch.py has 547 lines of code (exceeds 250 allowed). Consider refactoring.
Open

# -*- coding: utf-8 -*-

"""Catalog x-matching.

Built from the extensive x-matching program in Jo Bovy's ``gaia_tools``,
Severity: Major
Found in astronat/utils/data/crossmatch.py - About 1 day to fix

    File orbitskyoffset.py has 524 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    # -*- coding: utf-8 -*-
    
    """Orbit SkyOffset Frames.
    
    Like `~astropy.coordinates.Galactocentric` needs ``galcen_coord`` and other
    Severity: Major
    Found in astronat/dynamics/coordinates/builtin_frames/orbitskyoffset.py - About 1 day to fix

      Function xmatch_decorator has a Cognitive Complexity of 47 (exceeds 5 allowed). Consider refactoring.
      Open

      def xmatch_decorator(
          function: T.Callable = None,
          *,
          _doc_style: str = "numpy",
          _doc_fmt: T.Dict[str, T.Any] = {},
      Severity: Minor
      Found in astronat/utils/data/crossmatch.py - About 7 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 orbitoffset.py has 462 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      # -*- coding: utf-8 -*-
      
      """Orbit Offset Frames.
      
      Like `~astropy.coordinates.Galactocentric` needs ``galcen_coord`` and other
      Severity: Minor
      Found in astronat/dynamics/coordinates/builtin_frames/orbitoffset.py - About 7 hrs to fix

        File decorators.py has 422 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        # -*- coding: utf-8 -*-
        
        """Decorators for functions accepting Astropy Quantities."""
        
        __author__ = "Nathaniel Starkman"
        Severity: Minor
        Found in astronat/units/decorators.py - About 6 hrs to fix

          File core.py has 413 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          # -*- coding: utf-8 -*-
          
          """Table Core Functions.
          
          .. todo::
          Severity: Minor
          Found in astronat/utils/table/core.py - About 5 hrs to fix

            Function from_galpy_orbit has a Cognitive Complexity of 38 (exceeds 5 allowed). Consider refactoring.
            Open

                def from_galpy_orbit(
                    cls,
                    *args,
                    orbit,
                    orbit_bkw=None,
            Severity: Minor
            Found in astronat/dynamics/coordinates/builtin_frames/orbitskyoffset.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 from_galpy_orbit has a Cognitive Complexity of 38 (exceeds 5 allowed). Consider refactoring.
            Open

                def from_galpy_orbit(
                    cls,
                    *args,
                    orbit,
                    orbit_bkw=None,
            Severity: Minor
            Found in astronat/dynamics/coordinates/builtin_frames/orbitoffset.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

            File MegaCamGen1_from_PS1.py has 406 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            # -*- coding: utf-8 -*-
            
            """PanSTARRS 1 bands from Mega-Cam gen1 bands."""
            
            __author__ = "Nathaniel Starkman"
            Severity: Minor
            Found in astronat/phot/MegaCam_PanSTARRS/MCgen1_PS1/MegaCamGen1_from_PS1.py - About 5 hrs to fix

              File representations.py has 356 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              # -*- coding: utf-8 -*-
              
              """Attributes.
              
              :mod:`~astropy.coordinates.attributes`
              Severity: Minor
              Found in astronat/dynamics/coordinates/representations.py - About 4 hrs to fix

                File __init__.py has 322 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                # -*- coding: utf-8 -*-
                
                """MegaCam_Panstarrs Filter Transformations."""
                
                __author__ = "Nathaniel Starkman"
                Severity: Minor
                Found in astronat/phot/MegaCam_PanSTARRS/__init__.py - About 3 hrs to fix

                  File __init__.py has 311 lines of code (exceeds 250 allowed). Consider refactoring.
                  Open

                  # -*- coding: utf-8 -*-
                  # see LICENSE.rst
                  
                  # ----------------------------------------------------------------------------
                  #
                  Severity: Minor
                  Found in astronat/constants/data/__init__.py - About 3 hrs to fix

                    TablesList has 28 functions (exceeds 20 allowed). Consider refactoring.
                    Open

                    class TablesList(HomogeneousList):
                        """Grouped Tables.
                    
                        A subclass of list that contains only elements of a given type or
                        types.  If an item that is not of the specified type is added to
                    Severity: Minor
                    Found in astronat/utils/table/core.py - About 3 hrs to fix

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

                      def cast_columns(
                          table: TableType,
                          recast: T.Dict[str, T.Union[T.Any, T.Tuple[T.Any, bool]]],
                          warn_mismatch: bool = True,
                          elementwise: bool = False,
                      Severity: Minor
                      Found in astronat/utils/table/utils.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 MegaCamGen3_from_PS1.py has 299 lines of code (exceeds 250 allowed). Consider refactoring.
                      Open

                      # -*- coding: utf-8 -*-
                      
                      """PanSTARRS 1 bands from Mega-Cam gen1 bands."""
                      
                      __author__ = "Nathaniel Starkman"
                      Severity: Minor
                      Found in astronat/phot/MegaCam_PanSTARRS/MCgen3_PS1/MegaCamGen3_from_PS1.py - About 3 hrs to fix

                        Function write has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
                        Open

                            def write(
                                self,
                                drct: str,
                                format="asdf",
                                split=True,
                        Severity: Minor
                        Found in astronat/utils/table/core.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 PS1_from_MegaCamGen1.py has 275 lines of code (exceeds 250 allowed). Consider refactoring.
                        Open

                        # -*- coding: utf-8 -*-
                        
                        """Mega-Cam Generation-1 bands from PanSTARRS 1 bands."""
                        
                        __author__ = "Nathaniel Starkman"
                        Severity: Minor
                        Found in astronat/phot/MegaCam_PanSTARRS/MCgen1_PS1/PS1_from_MegaCamGen1.py - About 2 hrs to fix

                          File amuse.py has 256 lines of code (exceeds 250 allowed). Consider refactoring.
                          Open

                          # -*- coding: utf-8 -*-
                          
                          """Astropy units, extended for AMUSE compatibility.
                          
                          These units are also available in the :mod:`~utilipy.units` namespace.
                          Severity: Minor
                          Found in astronat/units/amuse.py - About 2 hrs to fix

                            Function __new__ has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
                            Open

                                def __new__(cls, *args, **kwargs):
                                    """OrbitOffsetFrame."""
                                    # We don't want to call this method if we've already set up
                                    # an orbitoffset frame for this class.
                                    if not (
                            Severity: Minor
                            Found in astronat/dynamics/coordinates/builtin_frames/orbitoffset.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