aburrell/aacgmv2

View on GitHub

Showing 12 of 25 total issues

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

# Copyright (C) 2019 NRL
# Author: Angeline Burrell
# Disclaimer: This code is under the MIT license, whose details can be found at
# the root in the LICENSE file
#
Severity: Minor
Found in aacgmv2/wrapper.py - About 7 hrs to fix

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

    def convert_latlon_arr(in_lat, in_lon, height, dtime, method_code="G2A"):
        """Convert between geomagnetic coordinates and AACGM coordinates.
    
        Parameters
        ----------
    Severity: Minor
    Found in aacgmv2/wrapper.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

    Function convert_mlt has a Cognitive Complexity of 14 (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 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 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):
        """Set 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 34 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 main has a Cognitive Complexity of 9 (exceeds 5 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 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 convert_latlon has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
      Open

      def convert_latlon(in_lat, in_lon, height, dtime, method_code="G2A"):
          """Convert 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_arr has 5 arguments (exceeds 4 allowed). Consider refactoring.
      Open

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

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

        def convert_latlon(in_lat, in_lon, height, dtime, method_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="ALLOWTRACE"):
          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="ALLOWTRACE"):
            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