poliastro/poliastro

View on GitHub

Showing 116 of 116 total issues

Function danby has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
Open

def danby(k, r0, v0, tof, numiter=20, rtol=1e-8):
    """ Kepler solver for both elliptic and parabolic orbits based on Danby's
    algorithm.

    Parameters
Severity: Minor
Found in src/poliastro/core/propagation/__init__.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

Consider simplifying this complex logical expression.
Open

                if (a is None) and (ecc is None) and (inc is None):
                    # We check sufficient number of parameters
                    raise ValueError(
                        "At least two parameters of the set {a, ecc, inc} are required."
                    )
Severity: Critical
Found in src/poliastro/twobody/orbit.py - About 1 hr to fix

    Function add_orbit has 18 arguments (exceeds 9 allowed). Consider refactoring.
    Open

        def add_orbit(
    Severity: Major
    Found in src/poliastro/czml/extract_czml.py - About 1 hr to fix

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

      def delta_t_from_nu(nu, ecc, k=1.0, q=1.0, delta=1e-2):
          """Time elapsed since periapsis for given true anomaly.
      
          Parameters
          ----------
      Severity: Minor
      Found in src/poliastro/core/propagation/farnocchia.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 mikkola has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
      Open

      def mikkola(k, r0, v0, tof, rtol=None):
          """ Raw algorithm for Mikkola's Kepler solver.
      
          Parameters
          ----------
      Severity: Minor
      Found in src/poliastro/core/propagation/__init__.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 frozen has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
      Open

          def frozen(
              cls,
              attractor,
              alt,
              inc=None,
      Severity: Minor
      Found in src/poliastro/twobody/orbit.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 add_trajectory has 17 arguments (exceeds 9 allowed). Consider refactoring.
      Open

          def add_trajectory(
      Severity: Major
      Found in src/poliastro/czml/extract_czml.py - About 1 hr to fix

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

        def vallado(k, r0, r, tof, short, numiter, rtol):
            r"""Solves the Lambert's problem.
        
            The algorithm returns the initial velocity vector and the final one, these are
            computed by the following expresions:
        Severity: Minor
        Found in src/poliastro/core/iod.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 nu_from_delta_t has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
        Open

        def nu_from_delta_t(delta_t, ecc, k=1.0, q=1.0, delta=1e-2):
            """True anomaly for given elapsed time since periapsis.
        
            Parameters
            ----------
        Severity: Minor
        Found in src/poliastro/core/propagation/farnocchia.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 rv2coe has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
        Open

        def rv2coe(k, r, v, tol=1e-8):
            r"""Converts from vectors to classical orbital elements.
        
            Parameters
            ----------
        Severity: Minor
        Found in src/poliastro/core/elements.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 test_exception_max_and_min_ground_range_with_specific_azimuth has 13 arguments (exceeds 9 allowed). Consider refactoring.
        Open

        def test_exception_max_and_min_ground_range_with_specific_azimuth(
        Severity: Major
        Found in tests/tests_earth/test_sensors.py - About 1 hr to fix

          Function test_max_and_min_ground_range_with_specific_azimuth has 13 arguments (exceeds 9 allowed). Consider refactoring.
          Open

          def test_max_and_min_ground_range_with_specific_azimuth(
          Severity: Major
          Found in tests/tests_earth/test_sensors.py - About 1 hr to fix

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

                def add_ground_station(
                    self,
                    pos,
                    id_description=None,
                    label_fill_color=None,
            Severity: Minor
            Found in src/poliastro/czml/extract_czml.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 change_attractor has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
            Open

                def change_attractor(self, new_attractor, force=False):
                    """Changes orbit attractor.
            
                    Only changes from attractor to parent or the other way around are allowed.
            
            
            Severity: Minor
            Found in src/poliastro/twobody/orbit.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 vallado has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
            Open

            def vallado(k, r0, v0, tof, numiter):
                r"""Solves Kepler's Equation by applying a Newton-Raphson method.
            
                If the position of a body along its orbit wants to be computed
                for an specific time, it can be solved by terms of the Kepler's Equation:
            Severity: Minor
            Found in src/poliastro/core/propagation/__init__.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 __new__ has 11 arguments (exceeds 9 allowed). Consider refactoring.
            Open

                def __new__(
            Severity: Major
            Found in src/poliastro/bodies.py - About 45 mins to fix

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

                  def from_classical(
                      cls,
                      attractor,
                      a,
                      ecc,
              Severity: Minor
              Found in src/poliastro/twobody/orbit.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 frozen has 10 arguments (exceeds 9 allowed). Consider refactoring.
              Open

                  def frozen(
              Severity: Major
              Found in src/poliastro/twobody/orbit.py - About 35 mins to fix

                Function heliosynchronous has 10 arguments (exceeds 9 allowed). Consider refactoring.
                Open

                    def heliosynchronous(
                Severity: Major
                Found in src/poliastro/twobody/orbit.py - About 35 mins to fix

                  Function synchronous has 10 arguments (exceeds 9 allowed). Consider refactoring.
                  Open

                      def synchronous(
                  Severity: Major
                  Found in src/poliastro/twobody/orbit.py - About 35 mins to fix
                    Severity
                    Category
                    Status
                    Source
                    Language