# poliastro/poliastro

### 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``````
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"

#### 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."
)``````
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(``
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
----------``````
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"

#### 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
----------``````
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"

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

``````    def frozen(
cls,
attractor,
alt,
inc=None,``````
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"

#### Function `add_trajectory` has 17 arguments (exceeds 9 allowed). Consider refactoring. Open

``    def add_trajectory(``
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:``````
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"

#### 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
----------``````
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"

#### 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
----------``````
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"

#### 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(``
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(``
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,``````
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"

#### 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.

``````
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"

#### 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:``````
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"

#### Function `__new__` has 11 arguments (exceeds 9 allowed). Consider refactoring. Open

``    def __new__(``
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,``````
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"

#### Function `frozen` has 10 arguments (exceeds 9 allowed). Consider refactoring. Open

``    def frozen(``
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(``
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(``
Found in src/poliastro/twobody/orbit.py - About 35 mins to fix