poliastro/poliastro

View on GitHub

Showing 63 of 63 total issues

File orbit.py has 890 lines of code (exceeds 250 allowed). Consider refactoring.
Open

from warnings import warn

import numpy as np
from astropy import time, units as u
from astropy.coordinates import (
Severity: Major
Found in src/poliastro/twobody/orbit.py - About 2 days to fix

    File test_orbit.py has 678 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    import pickle
    
    import matplotlib
    import numpy as np
    import pytest
    Severity: Major
    Found in src/poliastro/tests/tests_twobody/test_orbit.py - About 1 day to fix

      File dastcom5.py has 515 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      """NEOs orbit from DASTCOM5 database.
      
      """
      import os
      import re
      Severity: Major
      Found in src/poliastro/neos/dastcom5.py - About 1 day to fix

        Orbit has 53 functions (exceeds 20 allowed). Consider refactoring.
        Open

        class Orbit(object):
            """Position and velocity of a body with respect to an attractor
            at a given time (epoch).
        
            Regardless of how the Orbit is created, the implicit
        Severity: Major
        Found in src/poliastro/twobody/orbit.py - About 7 hrs to fix

          File integrators.py has 469 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          from copy import copy
          
          import numpy as np
          from scipy.integrate import DenseOutput, OdeSolver
          from scipy.integrate._ivp.common import (
          Severity: Minor
          Found in src/poliastro/integrators.py - About 7 hrs to fix

            File test_perturbations.py has 444 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            import functools
            
            import numpy as np
            import pytest
            from astropy import units as u
            Severity: Minor
            Found in src/poliastro/tests/tests_twobody/test_perturbations.py - About 6 hrs to fix

              File angles.py has 370 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              import numpy as np
              
              from ._jit import jit
              
              
              
              Severity: Minor
              Found in src/poliastro/core/angles.py - About 4 hrs to fix

                File elements.py has 357 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                """This module contains a set of functions that can be used
                    to convert between different elements that define the orbit
                    of a body.
                    """
                
                
                Severity: Minor
                Found in src/poliastro/core/elements.py - About 4 hrs to fix

                  File iod.py has 325 lines of code (exceeds 250 allowed). Consider refactoring.
                  Open

                  import numpy as np
                  from numpy import pi
                  
                  from poliastro.core.hyper import hyp2f1b
                  from poliastro.core.stumpff import c2, c3
                  Severity: Minor
                  Found in src/poliastro/core/iod.py - About 3 hrs to fix

                    File bodies.py has 316 lines of code (exceeds 250 allowed). Consider refactoring.
                    Open

                    """Bodies of the Solar System.
                    
                    Contains some predefined bodies of the Solar System:
                    
                    * Sun (☉)
                    Severity: Minor
                    Found in src/poliastro/bodies.py - About 3 hrs to fix

                      File constants.py has 310 lines of code (exceeds 250 allowed). Consider refactoring.
                      Open

                      """Astronomical and physics constants.
                      
                      This module complements constants defined in `astropy.constants`,
                      with gravitational paremeters and radii.
                      
                      
                      Severity: Minor
                      Found in src/poliastro/constants.py - About 3 hrs to fix

                        File extract_czml.py has 302 lines of code (exceeds 250 allowed). Consider refactoring.
                        Open

                        import copy
                        import json
                        from typing import Any, Dict, List
                        
                        import numpy as np
                        Severity: Minor
                        Found in src/poliastro/czml/extract_czml.py - About 3 hrs to fix

                          Cyclomatic complexity is too high in function porkchop. (13)
                          Open

                          def porkchop(
                              departure_body,
                              target_body,
                              launch_span,
                              arrival_span,
                          Severity: Minor
                          Found in src/poliastro/plotting/porkchop.py by radon

                          Cyclomatic Complexity

                          Cyclomatic Complexity corresponds to the number of decisions a block of code contains plus 1. This number (also called McCabe number) is equal to the number of linearly independent paths through the code. This number can be used as a guide when testing conditional logic in blocks.

                          Radon analyzes the AST tree of a Python program to compute Cyclomatic Complexity. Statements have the following effects on Cyclomatic Complexity:

                          Construct Effect on CC Reasoning
                          if +1 An if statement is a single decision.
                          elif +1 The elif statement adds another decision.
                          else +0 The else statement does not cause a new decision. The decision is at the if.
                          for +1 There is a decision at the start of the loop.
                          while +1 There is a decision at the while statement.
                          except +1 Each except branch adds a new conditional path of execution.
                          finally +0 The finally block is unconditionally executed.
                          with +1 The with statement roughly corresponds to a try/except block (see PEP 343 for details).
                          assert +1 The assert statement internally roughly equals a conditional statement.
                          Comprehension +1 A list/set/dict comprehension of generator expression is equivalent to a for loop.
                          Boolean Operator +1 Every boolean operator (and, or) adds a decision point.

                          Source: http://radon.readthedocs.org/en/latest/intro.html

                          Cyclomatic complexity is too high in method frozen. (12)
                          Open

                              @classmethod
                              @u.quantity_input(
                                  alt=u.m, inc=u.rad, argp=u.rad, raan=u.rad, arglat=u.rad, ecc=u.one
                              )
                              def frozen(
                          Severity: Minor
                          Found in src/poliastro/twobody/orbit.py by radon

                          Cyclomatic Complexity

                          Cyclomatic Complexity corresponds to the number of decisions a block of code contains plus 1. This number (also called McCabe number) is equal to the number of linearly independent paths through the code. This number can be used as a guide when testing conditional logic in blocks.

                          Radon analyzes the AST tree of a Python program to compute Cyclomatic Complexity. Statements have the following effects on Cyclomatic Complexity:

                          Construct Effect on CC Reasoning
                          if +1 An if statement is a single decision.
                          elif +1 The elif statement adds another decision.
                          else +0 The else statement does not cause a new decision. The decision is at the if.
                          for +1 There is a decision at the start of the loop.
                          while +1 There is a decision at the while statement.
                          except +1 Each except branch adds a new conditional path of execution.
                          finally +0 The finally block is unconditionally executed.
                          with +1 The with statement roughly corresponds to a try/except block (see PEP 343 for details).
                          assert +1 The assert statement internally roughly equals a conditional statement.
                          Comprehension +1 A list/set/dict comprehension of generator expression is equivalent to a for loop.
                          Boolean Operator +1 Every boolean operator (and, or) adds a decision point.

                          Source: http://radon.readthedocs.org/en/latest/intro.html

                          File angles.py has 268 lines of code (exceeds 250 allowed). Consider refactoring.
                          Open

                          """Angles and anomalies.
                          
                          """
                          from astropy import units as u
                          
                          
                          Severity: Minor
                          Found in src/poliastro/twobody/angles.py - About 2 hrs to fix

                            Cyclomatic complexity is too high in function rv2coe. (8)
                            Open

                            @jit
                            def rv2coe(k, r, v, tol=1e-8):
                                r"""Converts from vectors to classical orbital elements.
                            
                                1. First the angular momentum is computed:
                            Severity: Minor
                            Found in src/poliastro/core/elements.py by radon

                            Cyclomatic Complexity

                            Cyclomatic Complexity corresponds to the number of decisions a block of code contains plus 1. This number (also called McCabe number) is equal to the number of linearly independent paths through the code. This number can be used as a guide when testing conditional logic in blocks.

                            Radon analyzes the AST tree of a Python program to compute Cyclomatic Complexity. Statements have the following effects on Cyclomatic Complexity:

                            Construct Effect on CC Reasoning
                            if +1 An if statement is a single decision.
                            elif +1 The elif statement adds another decision.
                            else +0 The else statement does not cause a new decision. The decision is at the if.
                            for +1 There is a decision at the start of the loop.
                            while +1 There is a decision at the while statement.
                            except +1 Each except branch adds a new conditional path of execution.
                            finally +0 The finally block is unconditionally executed.
                            with +1 The with statement roughly corresponds to a try/except block (see PEP 343 for details).
                            assert +1 The assert statement internally roughly equals a conditional statement.
                            Comprehension +1 A list/set/dict comprehension of generator expression is equivalent to a for loop.
                            Boolean Operator +1 Every boolean operator (and, or) adds a decision point.

                            Source: http://radon.readthedocs.org/en/latest/intro.html

                            Cyclomatic complexity is too high in function _find_xy. (8)
                            Open

                            @jit
                            def _find_xy(ll, T, M, numiter, rtol):
                                """Computes all x, y for given number of revolutions.
                            
                                """
                            Severity: Minor
                            Found in src/poliastro/core/iod.py by radon

                            Cyclomatic Complexity

                            Cyclomatic Complexity corresponds to the number of decisions a block of code contains plus 1. This number (also called McCabe number) is equal to the number of linearly independent paths through the code. This number can be used as a guide when testing conditional logic in blocks.

                            Radon analyzes the AST tree of a Python program to compute Cyclomatic Complexity. Statements have the following effects on Cyclomatic Complexity:

                            Construct Effect on CC Reasoning
                            if +1 An if statement is a single decision.
                            elif +1 The elif statement adds another decision.
                            else +0 The else statement does not cause a new decision. The decision is at the if.
                            for +1 There is a decision at the start of the loop.
                            while +1 There is a decision at the while statement.
                            except +1 Each except branch adds a new conditional path of execution.
                            finally +0 The finally block is unconditionally executed.
                            with +1 The with statement roughly corresponds to a try/except block (see PEP 343 for details).
                            assert +1 The assert statement internally roughly equals a conditional statement.
                            Comprehension +1 A list/set/dict comprehension of generator expression is equivalent to a for loop.
                            Boolean Operator +1 Every boolean operator (and, or) adds a decision point.

                            Source: http://radon.readthedocs.org/en/latest/intro.html

                            Cyclomatic complexity is too high in method _step_impl. (8)
                            Open

                                def _step_impl(self):
                                    t = self.t
                                    y = self.y
                                    f = self.f
                                    K = self.K
                            Severity: Minor
                            Found in src/poliastro/integrators.py by radon

                            Cyclomatic Complexity

                            Cyclomatic Complexity corresponds to the number of decisions a block of code contains plus 1. This number (also called McCabe number) is equal to the number of linearly independent paths through the code. This number can be used as a guide when testing conditional logic in blocks.

                            Radon analyzes the AST tree of a Python program to compute Cyclomatic Complexity. Statements have the following effects on Cyclomatic Complexity:

                            Construct Effect on CC Reasoning
                            if +1 An if statement is a single decision.
                            elif +1 The elif statement adds another decision.
                            else +0 The else statement does not cause a new decision. The decision is at the if.
                            for +1 There is a decision at the start of the loop.
                            while +1 There is a decision at the while statement.
                            except +1 Each except branch adds a new conditional path of execution.
                            finally +0 The finally block is unconditionally executed.
                            with +1 The with statement roughly corresponds to a try/except block (see PEP 343 for details).
                            assert +1 The assert statement internally roughly equals a conditional statement.
                            Comprehension +1 A list/set/dict comprehension of generator expression is equivalent to a for loop.
                            Boolean Operator +1 Every boolean operator (and, or) adds a decision point.

                            Source: http://radon.readthedocs.org/en/latest/intro.html

                            Cyclomatic complexity is too high in function vallado. (8)
                            Open

                            @jit
                            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
                            Severity: Minor
                            Found in src/poliastro/core/iod.py by radon

                            Cyclomatic Complexity

                            Cyclomatic Complexity corresponds to the number of decisions a block of code contains plus 1. This number (also called McCabe number) is equal to the number of linearly independent paths through the code. This number can be used as a guide when testing conditional logic in blocks.

                            Radon analyzes the AST tree of a Python program to compute Cyclomatic Complexity. Statements have the following effects on Cyclomatic Complexity:

                            Construct Effect on CC Reasoning
                            if +1 An if statement is a single decision.
                            elif +1 The elif statement adds another decision.
                            else +0 The else statement does not cause a new decision. The decision is at the if.
                            for +1 There is a decision at the start of the loop.
                            while +1 There is a decision at the while statement.
                            except +1 Each except branch adds a new conditional path of execution.
                            finally +0 The finally block is unconditionally executed.
                            with +1 The with statement roughly corresponds to a try/except block (see PEP 343 for details).
                            assert +1 The assert statement internally roughly equals a conditional statement.
                            Comprehension +1 A list/set/dict comprehension of generator expression is equivalent to a for loop.
                            Boolean Operator +1 Every boolean operator (and, or) adds a decision point.

                            Source: http://radon.readthedocs.org/en/latest/intro.html

                            Cyclomatic complexity is too high in function test_J3_propagation_Earth. (8)
                            Open

                            @pytest.mark.slow
                            @pytest.mark.parametrize(
                                "test_params",
                                [
                                    {

                            Cyclomatic Complexity

                            Cyclomatic Complexity corresponds to the number of decisions a block of code contains plus 1. This number (also called McCabe number) is equal to the number of linearly independent paths through the code. This number can be used as a guide when testing conditional logic in blocks.

                            Radon analyzes the AST tree of a Python program to compute Cyclomatic Complexity. Statements have the following effects on Cyclomatic Complexity:

                            Construct Effect on CC Reasoning
                            if +1 An if statement is a single decision.
                            elif +1 The elif statement adds another decision.
                            else +0 The else statement does not cause a new decision. The decision is at the if.
                            for +1 There is a decision at the start of the loop.
                            while +1 There is a decision at the while statement.
                            except +1 Each except branch adds a new conditional path of execution.
                            finally +0 The finally block is unconditionally executed.
                            with +1 The with statement roughly corresponds to a try/except block (see PEP 343 for details).
                            assert +1 The assert statement internally roughly equals a conditional statement.
                            Comprehension +1 A list/set/dict comprehension of generator expression is equivalent to a for loop.
                            Boolean Operator +1 Every boolean operator (and, or) adds a decision point.

                            Source: http://radon.readthedocs.org/en/latest/intro.html

                            Severity
                            Category
                            Status
                            Source
                            Language