feat(smart_mpc_trajectory_follower): add smart_mpc_trajectory_follower #6805
CodeScene PR Check
❌ Code Health Quality Gates: FAILED
- Declining Code Health: 131 findings(s) 🚩
Details
🚩 Declining Code Health (highest to lowest):
- Complex Method python_simulator.py: slalom_drive
- Complex Method pympc_trajectory_follower.py: PyMPCTrajectoryFollower.control
- Complex Method drive_controller.py: init
- Large Method control.launch.py: launch_setup
- Low Cohesion drive_functions.py
- Low Cohesion train_drive_NN_model.py
- Brain Method train_drive_NN_model.py: polynomial_regression
- Brain Method train_drive_NN_model.py: train_model
- Complex Conditional python_simulator.py: slalom_drive
- Complex Method run_sim.py: run_simulator
- Bumpy Road Ahead pympc_trajectory_follower.py: PyMPCTrajectoryFollower.control
- Large Method pympc_trajectory_follower.py: PyMPCTrajectoryFollower.init
- Deep, Nested Complexity drive_controller.py: update_input_queue
- Complex Method add_training_data_from_csv.py: add_data_from_csv.add_data_from_csv
- Code Duplication drive_iLQR.py
- Complex Method drive_controller.py: update_input_queue
- Complex Method drive_controller.py: get_optimal_control
- Complex Method drive_iLQR.py: compute_optimal_control
- Large Method drive_iLQR.py: compute_iLQR_coef
- Complex Method python_simulator.py: create_straight_line_test_csv
- Complex Method drive_functions.py: calc_cost
- Complex Method drive_functions.py: transform_Q_R
- Lines of Code in a Single File python_simulator.py
- Overall Code Complexity python_simulator.py
- Deep, Nested Complexity python_simulator.py: accel_map_f
- Deep, Nested Complexity run_sim.py: run_simulator
- Lines of Code in a Single File drive_controller.py
- Overall Code Complexity drive_controller.py
- Lines of Code in a Single File drive_functions.py
- Overall Code Complexity drive_functions.py
- Code Duplication drive_functions.py
- Deep, Nested Complexity drive_functions.py: calc_limits
- Lines of Code in a Single File pympc_trajectory_follower.py
- Overall Code Complexity pympc_trajectory_follower.py
- Deep, Nested Complexity pympc_trajectory_follower.py: PyMPCTrajectoryFollower.control
- Overall Code Complexity add_training_data_from_csv.py
- Code Duplication train_drive_NN_model.py
- Complex Method train_drive_NN_model.py: polynomial_regression
- Bumpy Road Ahead drive_controller.py: update_input_queue
- Deep, Nested Complexity drive_controller.py: get_optimal_control
- Bumpy Road Ahead python_simulator.py: slalom_drive
- Large Method proxima_calc.cpp: error_prediction_with_diff
- Complex Method train_drive_NN_model.py: train_model
- Complex Method drive_functions.py: calc_cost_only_for_states
- Large Method drive_functions.py: calc_limits
- Missing Arguments Abstractions python_simulator.py
- Missing Arguments Abstractions drive_NN.py
- Missing Arguments Abstractions drive_controller.py
- Missing Arguments Abstractions drive_functions.py
- Missing Arguments Abstractions drive_iLQR.py
- Complex Method drive_mppi.py: drive_mppi.proceed_mppi_step
- Primitive Obsession proxima_calc.cpp
- Excess Number of Function Arguments proxima_calc.cpp: set_params
- Complex Conditional pympc_trajectory_follower.py: PyMPCTrajectoryFollower.control
- Deep, Nested Complexity train_drive_NN_model.py: train_model
- Deep, Nested Complexity train_drive_NN_model.py: polynomial_regression
- Missing Arguments Abstractions train_drive_NN_model.py
- Bumpy Road Ahead python_simulator.py: get_current_additional_sine
- Excess Number of Function Arguments drive_controller.py: init
- Bumpy Road Ahead drive_controller.py: get_optimal_control
- Bumpy Road Ahead drive_controller.py: update_model
- Complex Conditional python_simulator.py: create_additional_sine_data
- Bumpy Road Ahead python_simulator.py: accel_map_f
- Bumpy Road Ahead drive_functions.py: calc_limits
- Bumpy Road Ahead drive_functions.py: transform_Q_R
- Bumpy Road Ahead drive_functions.py: calc_cost
- Bumpy Road Ahead run_sim.py: run_simulator
- Bumpy Road Ahead drive_mppi.py: drive_mppi.proceed_mppi_step
- Bumpy Road Ahead proxima_calc.cpp: get_polynomial_features
- Bumpy Road Ahead proxima_calc.cpp: get_polynomial_features_with_diff
- Bumpy Road Ahead add_training_data_from_csv.py: add_data_from_csv.add_data_from_csv
- Bumpy Road Ahead train_drive_NN_model.py: train_model
- Bumpy Road Ahead train_drive_NN_model.py: get_trained_model
- Bumpy Road Ahead train_drive_NN_model.py: update_trained_model
- Bumpy Road Ahead train_drive_NN_model.py: update_saved_trained_model
- Bumpy Road Ahead train_drive_NN_model.py: polynomial_regression
- Excess Number of Function Arguments drive_iLQR.py: compute_iLQR_coef
- Excess Number of Function Arguments drive_NN.py: DriveNeuralNetwork.init
- Excess Number of Function Arguments drive_NN.py: transform_model_to_c.init
- Bumpy Road Ahead drive_functions.py: calc_cost_only_for_states
- Excess Number of Function Arguments drive_GP.py: get_pred
- Excess Number of Function Arguments drive_GP.py: get_pred_deviations
- Excess Number of Function Arguments drive_GP.py: get_pred_deviation
- Excess Number of Function Arguments python_simulator.py: slalom_drive
- Excess Number of Function Arguments drive_controller.py: update_input_queue_and_get_optimal_control
- Excess Number of Function Arguments drive_mppi.py: drive_mppi.init
- Excess Number of Function Arguments drive_mppi.py: generate_input_perturbation
- Excess Number of Function Arguments drive_mppi.py: drive_mppi.calc_forward_trajectories_with_cost
- Excess Number of Function Arguments drive_mppi.py: drive_mppi.proceed_mppi_step
- Excess Number of Function Arguments drive_mppi.py: drive_mppi.compute_optimal_control
- Excess Number of Function Arguments drive_NN.py: loss_fn_plus_tanh
- Excess Number of Function Arguments train_drive_NN_model.py: get_trained_model
- Excess Number of Function Arguments train_drive_NN_model.py: update_saved_trained_model
- Excess Number of Function Arguments drive_iLQR.py: compute_optimal_control
- Excess Number of Function Arguments train_drive_NN_model.py: update_trained_model
- Excess Number of Function Arguments python_simulator.py: pure_pursuit
- Excess Number of Function Arguments train_drive_NN_model.py: polynomial_regression
- Excess Number of Function Arguments python_simulator.py: f_sim
- Excess Number of Function Arguments python_simulator.py: F_true_predict
- Excess Number of Function Arguments python_simulator.py: create_additional_sine_data
- Excess Number of Function Arguments python_simulator.py: get_current_additional_sine
- Excess Number of Function Arguments train_drive_NN_model.py: init
- Excess Number of Function Arguments train_drive_NN_model.py: train_model
- Excess Number of Function Arguments train_drive_NN_model.py: get_polynomial_regression_result
- Excess Number of Function Arguments drive_functions.py: calc_limits
- Excess Number of Function Arguments drive_functions.py: F_with_model_initial_diff
- Excess Number of Function Arguments drive_functions.py: F_with_model_diff
- Excess Number of Function Arguments drive_functions.py: F_with_model_for_candidates
- Excess Number of Function Arguments train_drive_NN_model.py: sim
- Excess Number of Function Arguments python_simulator.py: F_sim
- Excess Number of Function Arguments drive_functions.py: F_with_history_and_diff
- Excess Number of Function Arguments drive_functions.py: F_with_history_for_candidates
- Excess Number of Function Arguments drive_iLQR.py: sparse_right_action_for_state_diff
- Excess Number of Function Arguments drive_iLQR.py: sparse_left_action_for_state_diff
- Excess Number of Function Arguments drive_iLQR.py: vector_sparse_left_action_for_state_diff
- Excess Number of Function Arguments drive_iLQR.py: calc_line_search_candidates
- Excess Number of Function Arguments python_simulator.py: create_straight_line_test_csv
- Excess Number of Function Arguments drive_functions.py: F_with_history
- Excess Number of Function Arguments drive_functions.py: u_cut_off
- Excess Number of Function Arguments drive_iLQR.py: init
- Excess Number of Function Arguments drive_iLQR.py: calc_forward_trajectories_with_cost
- Excess Number of Function Arguments train_drive_NN_model.py: predict_error
- Excess Number of Function Arguments drive_functions.py: sg_filter
- Excess Number of Function Arguments drive_functions.py: calc_cost
- Excess Number of Function Arguments drive_functions.py: f_init
- Excess Number of Function Arguments drive_functions.py: F_init
- Excess Number of Function Arguments drive_functions.py: F_multiple
- Excess Number of Function Arguments drive_functions.py: F_init_with_diff
- Excess Number of Function Arguments drive_functions.py: F_multiple_with_diff
- Excess Number of Function Arguments drive_functions.py: f_init_for_candidates
- Excess Number of Function Arguments drive_functions.py: F_multiple_for_candidates
Annotations
codescene-delta-analysis / CodeScene Cloud Delta Analysis (main)
❌ New issue: Lines of Code in a Single File
This module has 1184 lines of code, improve code health by reducing it to 600. The number of Lines of Code in a single file. More Lines of Code lowers the code health.
codescene-delta-analysis / CodeScene Cloud Delta Analysis (main)
❌ New issue: Complex Method
slalom_drive has a cyclomatic complexity of 56, threshold = 9. This function has many conditional statements (e.g. if, for, while), leading to lower code health. Avoid adding more conditionals and code to it without refactoring.
codescene-delta-analysis / CodeScene Cloud Delta Analysis (main)
❌ New issue: Complex Method
create_straight_line_test_csv has a cyclomatic complexity of 11, threshold = 9. This function has many conditional statements (e.g. if, for, while), leading to lower code health. Avoid adding more conditionals and code to it without refactoring.
codescene-delta-analysis / CodeScene Cloud Delta Analysis (main)
❌ New issue: Complex Conditional
create_additional_sine_data has 1 complex conditionals with 2 branches, threshold = 2. A complex conditional is an expression inside a branch (e.g. if, for, while) which consists of multiple, logical operators such as AND/OR. The more logical operators in an expression, the more severe the code smell.
codescene-delta-analysis / CodeScene Cloud Delta Analysis (main)
❌ New issue: Complex Conditional
slalom_drive has 2 complex conditionals with 7 branches, threshold = 2. A complex conditional is an expression inside a branch (e.g. if, for, while) which consists of multiple, logical operators such as AND/OR. The more logical operators in an expression, the more severe the code smell.
codescene-delta-analysis / CodeScene Cloud Delta Analysis (main)
❌ New issue: Bumpy Road Ahead
slalom_drive has 6 blocks with nested conditional logic. Any nesting of 2 or deeper is considered. Threshold is one single, nested block per function. The Bumpy Road code smell is a function that contains multiple chunks of nested conditional logic. The deeper the nesting and the more bumps, the lower the code health.
codescene-delta-analysis / CodeScene Cloud Delta Analysis (main)
❌ New issue: Bumpy Road Ahead
get_current_additional_sine has 3 blocks with nested conditional logic. Any nesting of 2 or deeper is considered. Threshold is one single, nested block per function. The Bumpy Road code smell is a function that contains multiple chunks of nested conditional logic. The deeper the nesting and the more bumps, the lower the code health.
codescene-delta-analysis / CodeScene Cloud Delta Analysis (main)
❌ New issue: Bumpy Road Ahead
accel_map_f has 2 blocks with nested conditional logic. Any nesting of 2 or deeper is considered. Threshold is one single, nested block per function. The Bumpy Road code smell is a function that contains multiple chunks of nested conditional logic. The deeper the nesting and the more bumps, the lower the code health.
codescene-delta-analysis / CodeScene Cloud Delta Analysis (main)
❌ New issue: Overall Code Complexity
This module has a mean cyclomatic complexity of 6.26 across 19 functions. The mean complexity threshold is 4. This file has many conditional statements (e.g. if, for, while) across its implementation, leading to lower code health. Avoid adding more conditionals.
codescene-delta-analysis / CodeScene Cloud Delta Analysis (main)
❌ New issue: Deep, Nested Complexity
accel_map_f has a nested complexity depth of 4, threshold = 4. This function contains deeply nested logic such as if statements and/or loops. The deeper the nesting, the lower the code health.
codescene-delta-analysis / CodeScene Cloud Delta Analysis (main)
❌ New issue: Missing Arguments Abstractions
The average number of function arguments in this module is 5.47 across 19 functions. The average arguments threshold is 4.00. The functions in this file have too many arguments, indicating a lack of encapsulation or too many responsibilities in the same functions. Avoid adding more.
codescene-delta-analysis / CodeScene Cloud Delta Analysis (main)
❌ New issue: Excess Number of Function Arguments
f_sim has 9 arguments, threshold = 4. This function has too many arguments, indicating a lack of encapsulation. Avoid adding more arguments.
codescene-delta-analysis / CodeScene Cloud Delta Analysis (main)
❌ New issue: Excess Number of Function Arguments
F_sim has 6 arguments, threshold = 4. This function has too many arguments, indicating a lack of encapsulation. Avoid adding more arguments.
codescene-delta-analysis / CodeScene Cloud Delta Analysis (main)
❌ New issue: Excess Number of Function Arguments
F_true_predict has 9 arguments, threshold = 4. This function has too many arguments, indicating a lack of encapsulation. Avoid adding more arguments.
codescene-delta-analysis / CodeScene Cloud Delta Analysis (main)
❌ New issue: Excess Number of Function Arguments
create_additional_sine_data has 9 arguments, threshold = 4. This function has too many arguments, indicating a lack of encapsulation. Avoid adding more arguments.
codescene-delta-analysis / CodeScene Cloud Delta Analysis (main)
❌ New issue: Excess Number of Function Arguments
get_current_additional_sine has 7 arguments, threshold = 4. This function has too many arguments, indicating a lack of encapsulation. Avoid adding more arguments.
codescene-delta-analysis / CodeScene Cloud Delta Analysis (main)
❌ New issue: Excess Number of Function Arguments
pure_pursuit has 10 arguments, threshold = 4. This function has too many arguments, indicating a lack of encapsulation. Avoid adding more arguments.
codescene-delta-analysis / CodeScene Cloud Delta Analysis (main)
❌ New issue: Excess Number of Function Arguments
slalom_drive has 22 arguments, threshold = 4. This function has too many arguments, indicating a lack of encapsulation. Avoid adding more arguments.
codescene-delta-analysis / CodeScene Cloud Delta Analysis (main)
❌ New issue: Excess Number of Function Arguments
create_straight_line_test_csv has 5 arguments, threshold = 4. This function has too many arguments, indicating a lack of encapsulation. Avoid adding more arguments.
codescene-delta-analysis / CodeScene Cloud Delta Analysis (main)
❌ New issue: Complex Method
run_simulator has a cyclomatic complexity of 24, threshold = 9. This function has many conditional statements (e.g. if, for, while), leading to lower code health. Avoid adding more conditionals and code to it without refactoring.
codescene-delta-analysis / CodeScene Cloud Delta Analysis (main)
❌ New issue: Bumpy Road Ahead
run_simulator has 2 blocks with nested conditional logic. Any nesting of 2 or deeper is considered. Threshold is one single, nested block per function. The Bumpy Road code smell is a function that contains multiple chunks of nested conditional logic. The deeper the nesting and the more bumps, the lower the code health.
codescene-delta-analysis / CodeScene Cloud Delta Analysis (main)
❌ New issue: Deep, Nested Complexity
run_simulator has a nested complexity depth of 4, threshold = 4. This function contains deeply nested logic such as if statements and/or loops. The deeper the nesting, the lower the code health.
codescene-delta-analysis / CodeScene Cloud Delta Analysis (main)
❌ New issue: Excess Number of Function Arguments
get_pred has 6 arguments, threshold = 4. This function has too many arguments, indicating a lack of encapsulation. Avoid adding more arguments.
codescene-delta-analysis / CodeScene Cloud Delta Analysis (main)
❌ New issue: Excess Number of Function Arguments
get_pred_deviation has 5 arguments, threshold = 4. This function has too many arguments, indicating a lack of encapsulation. Avoid adding more arguments.
codescene-delta-analysis / CodeScene Cloud Delta Analysis (main)
❌ New issue: Excess Number of Function Arguments
get_pred_deviations has 6 arguments, threshold = 4. This function has too many arguments, indicating a lack of encapsulation. Avoid adding more arguments.