cmeeren/aacgmv2

View on GitHub

Showing 12 of 23 total issues

File wrapper.py has 395 lines of code (exceeds 250 allowed). Consider refactoring.
Open

# -*- coding: utf-8 -*-
"""Pythonic wrappers for AACGM-V2 C functions.

Functions
--------------
Severity: Minor
Found in aacgmv2/wrapper.py - About 5 hrs to fix

    Function convert_latlon_arr has a Cognitive Complexity of 35 (exceeds 5 allowed). Consider refactoring.
    Open

    def convert_latlon_arr(in_lat, in_lon, height, dtime, code="G2A"):
        """Converts between geomagnetic coordinates and AACGM coordinates.
    
        Parameters
        ------------
    Severity: Minor
    Found in aacgmv2/wrapper.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 set_coeff_path has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
    Open

    def set_coeff_path(igrf_file=False, coeff_prefix=False):
        """Sets the IGRF_COEFF and AACGMV_V2_DAT_PREFIX environment variables.
    
        Parameters
        -----------
    Severity: Minor
    Found in aacgmv2/wrapper.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 33 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    def main():
        """Entry point for the script"""
    
        desc = 'Converts between geographical coordinates, AACGM-v2, and MLT'
        parser = argparse.ArgumentParser(description=desc)
    Severity: Minor
    Found in aacgmv2/__main__.py - About 1 hr to fix

      Function convert has 9 arguments (exceeds 4 allowed). Consider refactoring.
      Open

      def convert(lat, lon, alt, date=None, a2g=False, trace=False, allowtrace=False,
      Severity: Major
      Found in aacgmv2/deprecated.py - About 1 hr to fix

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

        def convert_mlt(arr, dtime, m2a=False):
            """Converts between magnetic local time (MLT) and AACGM-v2 longitude
        
            Parameters
            ------------
        Severity: Minor
        Found in aacgmv2/wrapper.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 convert_latlon has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
        Open

        def convert_latlon(in_lat, in_lon, height, dtime, code="G2A"):
            """Converts between geomagnetic coordinates and AACGM coordinates
        
            Parameters
            ------------
        Severity: Minor
        Found in aacgmv2/wrapper.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 convert_latlon has 5 arguments (exceeds 4 allowed). Consider refactoring.
        Open

        def convert_latlon(in_lat, in_lon, height, dtime, code="G2A"):
        Severity: Minor
        Found in aacgmv2/wrapper.py - About 35 mins to fix

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

          def get_aacgm_coord(glat, glon, height, dtime, method="TRACE"):
          Severity: Minor
          Found in aacgmv2/wrapper.py - About 35 mins to fix

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

            def get_aacgm_coord_arr(glat, glon, height, dtime, method="TRACE"):
            Severity: Minor
            Found in aacgmv2/wrapper.py - About 35 mins to fix

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

              def convert_latlon_arr(in_lat, in_lon, height, dtime, code="G2A"):
              Severity: Minor
              Found in aacgmv2/wrapper.py - About 35 mins to fix

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

                def convert_bool_to_bit(a2g=False, trace=False, allowtrace=False,
                Severity: Minor
                Found in aacgmv2/wrapper.py - About 35 mins to fix
                  Severity
                  Category
                  Status
                  Source
                  Language