poliastro/poliastro

View on GitHub

Showing 108 of 108 total issues

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

    def heliosynchronous(
        cls,
        attractor,
        a=None,
        ecc=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

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 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 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 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 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 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 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 __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 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 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 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 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

                Function cowell has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                Open

                def cowell(k, r, v, tofs, rtol=1e-11, *, events=None, ad=None, **ad_kwargs):
                    """Propagates orbit using Cowell's formulation.
                
                    Parameters
                    ----------
                Severity: Minor
                Found in src/poliastro/twobody/propagation.py - About 35 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 add_trajectory has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                Open

                    def add_trajectory(
                        self,
                        positions,
                        epochs,
                        groundtrack_show=False,
                Severity: Minor
                Found in src/poliastro/czml/extract_czml.py - About 35 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