Skip to content

feat(map_based_prediction): use different time horizon

CodeScene Delta Analysis / CodeScene Cloud Delta Analysis (main) failed May 29, 2024 in 39s

CodeScene PR Check

❌ Code Health Quality Gates: FAILED

  • Declining Code Health: 7 findings(s) 🚩

View detailed results in CodeScene

Details

🚩 Declining Code Health (highest to lowest):

  • Complex Method map_based_prediction_node.cpp: MapBasedPredictionNode::objectsCallback
  • Complex Method map_based_prediction_node.cpp: MapBasedPredictionNode::getPredictedObjectAsCrosswalkUser
  • Large Method map_based_prediction_node.cpp: MapBasedPredictionNode::MapBasedPredictionNode
  • Primitive Obsession path_generator.cpp
  • Excess Number of Function Arguments path_generator.cpp: PathGenerator::generatePathForOnLaneVehicle
  • Excess Number of Function Arguments path_generator.cpp: PathGenerator::generatePolynomialPath
  • Excess Number of Function Arguments path_generator.cpp: PathGenerator::generateFrenetPath

Annotations

Check notice on line 1 in perception/map_based_prediction/src/map_based_prediction_node.cpp

See this annotation in the file changed.

@codescene-delta-analysis codescene-delta-analysis / CodeScene Cloud Delta Analysis (main)

β„Ή Getting worse: Lines of Code in a Single File

The lines of code increases from 1878 to 1883, improve code health by reducing it to 1000. The number of Lines of Code in a single file. More Lines of Code lowers the code health.

Check warning on line 846 in perception/map_based_prediction/src/map_based_prediction_node.cpp

See this annotation in the file changed.

@codescene-delta-analysis codescene-delta-analysis / CodeScene Cloud Delta Analysis (main)

❌ Getting worse: Large Method

MapBasedPredictionNode::MapBasedPredictionNode increases from 95 to 97 lines of code, threshold = 70. Large functions with many lines of code are generally harder to understand and lower the code health. Avoid adding more lines to this function.

Check warning on line 1191 in perception/map_based_prediction/src/map_based_prediction_node.cpp

See this annotation in the file changed.

@codescene-delta-analysis codescene-delta-analysis / CodeScene Cloud Delta Analysis (main)

❌ Getting worse: Complex Method

MapBasedPredictionNode::objectsCallback already has high cyclomatic complexity, and now it increases in Lines of Code from 215 to 217. 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.

Check warning on line 1450 in perception/map_based_prediction/src/map_based_prediction_node.cpp

See this annotation in the file changed.

@codescene-delta-analysis codescene-delta-analysis / CodeScene Cloud Delta Analysis (main)

❌ Getting worse: Complex Method

MapBasedPredictionNode::getPredictedObjectAsCrosswalkUser already has high cyclomatic complexity, and now it increases in Lines of Code from 106 to 107. 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.

Check warning on line 1 in perception/map_based_prediction/src/path_generator.cpp

See this annotation in the file changed.

@codescene-delta-analysis codescene-delta-analysis / CodeScene Cloud Delta Analysis (main)

❌ New issue: Primitive Obsession

In this module, 54.2% of all function arguments are primitive types, threshold = 30.0%. The functions in this file have too many primitive types (e.g. int, double, float) in their function argument lists. Using many primitive types lead to the code smell Primitive Obsession. Avoid adding more primitive arguments.

Check warning on line 160 in perception/map_based_prediction/src/path_generator.cpp

See this annotation in the file changed.

@codescene-delta-analysis codescene-delta-analysis / CodeScene Cloud Delta Analysis (main)

❌ New issue: Excess Number of Function Arguments

PathGenerator::generatePathForOnLaneVehicle has 5 arguments, threshold = 4. This function has too many arguments, indicating a lack of encapsulation. Avoid adding more arguments.

Check warning on line 209 in perception/map_based_prediction/src/path_generator.cpp

See this annotation in the file changed.

@codescene-delta-analysis codescene-delta-analysis / CodeScene Cloud Delta Analysis (main)

❌ New issue: Excess Number of Function Arguments

PathGenerator::generatePolynomialPath has 5 arguments, threshold = 4. This function has too many arguments, indicating a lack of encapsulation. Avoid adding more arguments.

Check warning on line 220 in perception/map_based_prediction/src/path_generator.cpp

See this annotation in the file changed.

@codescene-delta-analysis codescene-delta-analysis / CodeScene Cloud Delta Analysis (main)

❌ New issue: Excess Number of Function Arguments

PathGenerator::generateFrenetPath has 5 arguments, threshold = 4. This function has too many arguments, indicating a lack of encapsulation. Avoid adding more arguments.