Skip to content

feat(map_based_prediction): use different time horizon

CodeScene Delta Analysis / CodeScene Cloud Delta Analysis (main) failed May 30, 2024 in 1m 11s

CodeScene PR Check

❌ Code Health Quality Gates: FAILED

  • Declining Code Health: 3 findings(s) 🚩
  • Improving Code Health: 1 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

βœ… Improving Code Health:

  • Code Duplication test_path_generator.cpp: TEST:PathGenerator:test_generatePathForOnLaneVehicle

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 notice on line 1 in perception/map_based_prediction/test/map_based_prediction/test_path_generator.cpp

See this annotation in the file changed.

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

βœ… Getting better: Code Duplication

reduced similar code in: TEST:PathGenerator:test_generatePathForOnLaneVehicle. Avoid duplicated, aka copy-pasted, code inside the module. More duplication lowers the code health.