Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(multi_object_tracker): internal message driven process #10203

Draft
wants to merge 5 commits into
base: main
Choose a base branch
from

style(pre-commit): autofix

199b7a9
Select commit
Loading
Failed to load commit list.
Draft

refactor(multi_object_tracker): internal message driven process #10203

style(pre-commit): autofix
199b7a9
Select commit
Loading
Failed to load commit list.
CodeScene Delta Analysis / CodeScene Cloud Delta Analysis (main) failed Mar 4, 2025 in 56s

CodeScene PR Check

Quality Gate Failed

Code Health Improved (7 files improve in Code Health)

Gates Failed
Enforce critical code health rules (2 files with Bumpy Road Ahead)
Enforce advisory code health rules (4 files with Overall Code Complexity, Complex Conditional, Complex Method)

Gates Passed
2 Quality Gates Passed

See analysis details in CodeScene

Reason for failure
Enforce critical code health rules Violations Code Health Impact
input_manager.cpp 1 critical rule 8.82 → 8.42 Suppress
odometry.cpp 1 critical rule 10.00 → 9.84 Suppress
Enforce advisory code health rules Violations Code Health Impact
input_manager.cpp 1 advisory rule 8.82 → 8.42 Suppress
vehicle_tracker.cpp 1 advisory rule 9.49 → 9.16 Suppress
association.cpp 1 advisory rule 8.07 → 8.76 Suppress
pedestrian_tracker.cpp 1 advisory rule 8.54 → 9.24 Suppress
View Improvements
File Code Health Impact Categories Improved
association.cpp 8.07 → 8.76 Complex Method, Bumpy Road Ahead, Deep, Nested Complexity
shapes.cpp 9.10 → 9.69 Complex Method, Primitive Obsession, Excess Number of Function Arguments
bicycle_tracker.cpp 8.85 → 9.24 Large Method
pedestrian_tracker.cpp 8.54 → 9.24 Complex Method, Large Method, Bumpy Road Ahead, Overall Code Complexity
unknown_tracker.cpp 9.58 → 10.00 Large Method
vehicle_tracker.cpp 9.49 → 9.16 Large Method
debug_object.cpp 7.39 → 7.82 Complex Method, Overall Code Complexity, Deep, Nested Complexity
multi_object_tracker_node.cpp 9.39 → 9.39 Large Method
processor.cpp no change Overall Code Complexity

Quality Gate Profile: Clean Code Collective
Want more control? Customize Code Health rules or catch issues early with our IDE extension and CLI tool.

Details

🚩 Declining Code Health (highest to lowest):

  • Complex Conditional pedestrian_tracker.cpp: PedestrianTracker::measureWithShape
  • Overall Code Complexity association.cpp
  • Complex Conditional vehicle_tracker.cpp: VehicleTracker::measureWithShape
  • Complex Method input_manager.cpp: InputStream::onMessage
  • Bumpy Road Ahead odometry.cpp: Odometry::transformObjects
  • Bumpy Road Ahead input_manager.cpp: InputStream::onMessage

✅ Improving Code Health:

  • Complex Method debug_object.cpp: TrackerObjectDebugger::draw
  • Overall Code Complexity debug_object.cpp
  • Overall Code Complexity processor.cpp
  • Large Method multi_object_tracker_node.cpp: MultiObjectTracker::MultiObjectTracker 🔥
  • Large Method vehicle_tracker.cpp: VehicleTracker::VehicleTracker
  • Excess Number of Function Arguments shapes.cpp: calcAnchorPointOffset
  • Complex Method association.cpp: DataAssociation::calcScoreMatrix
  • Excess Number of Function Arguments shapes.cpp: getNearestCornerOrSurface
  • Bumpy Road Ahead association.cpp: DataAssociation::calcScoreMatrix
  • Deep, Nested Complexity association.cpp: DataAssociation::calcScoreMatrix
  • Complex Method shapes.cpp: calcOffsetVectorFromShapeChange
  • Primitive Obsession shapes.cpp
  • Large Method bicycle_tracker.cpp: BicycleTracker::BicycleTracker
  • Complex Method pedestrian_tracker.cpp: PedestrianTracker::measureWithShape
  • Large Method pedestrian_tracker.cpp: PedestrianTracker::PedestrianTracker
  • Bumpy Road Ahead pedestrian_tracker.cpp: PedestrianTracker::measureWithShape
  • Overall Code Complexity pedestrian_tracker.cpp
  • Large Method unknown_tracker.cpp: UnknownTracker::UnknownTracker
  • Deep, Nested Complexity debug_object.cpp: TrackerObjectDebugger::draw

Annotations

Check notice on line 182 in perception/autoware_multi_object_tracker/lib/association/association.cpp

See this annotation in the file changed.

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

✅ No longer an issue: Complex Method

DataAssociation::calcScoreMatrix is no longer above the threshold for cyclomatic complexity. 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 182 in perception/autoware_multi_object_tracker/lib/association/association.cpp

See this annotation in the file changed.

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

✅ No longer an issue: Bumpy Road Ahead

DataAssociation::calcScoreMatrix is no longer above the threshold for logical blocks with deeply nested code. 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.

Check warning on line 1 in perception/autoware_multi_object_tracker/lib/association/association.cpp

See this annotation in the file changed.

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

❌ New issue: Overall Code Complexity

This module has a mean cyclomatic complexity of 4.57 across 7 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.

Check notice on line 182 in perception/autoware_multi_object_tracker/lib/association/association.cpp

See this annotation in the file changed.

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

✅ No longer an issue: Deep, Nested Complexity

DataAssociation::calcScoreMatrix is no longer above the threshold for nested complexity depth

Check notice on line 220 in perception/autoware_multi_object_tracker/lib/object_model/shapes.cpp

See this annotation in the file changed.

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

✅ No longer an issue: Complex Method

calcOffsetVectorFromShapeChange is no longer above the threshold for cyclomatic complexity

Check notice on line 1 in perception/autoware_multi_object_tracker/lib/object_model/shapes.cpp

See this annotation in the file changed.

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

✅ No longer an issue: Primitive Obsession

The ratio of primivite types in function arguments is no longer above the threshold

Check notice on line 255 in perception/autoware_multi_object_tracker/lib/object_model/shapes.cpp

See this annotation in the file changed.

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

✅ Getting better: Excess Number of Function Arguments

calcAnchorPointOffset decreases from 7 to 5 arguments, threshold = 4. This function has too many arguments, indicating a lack of encapsulation. Avoid adding more arguments.

Check notice on line 218 in perception/autoware_multi_object_tracker/lib/object_model/shapes.cpp

See this annotation in the file changed.

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

✅ No longer an issue: Excess Number of Function Arguments

getNearestCornerOrSurface is no longer above the threshold for number of arguments. This function has too many arguments, indicating a lack of encapsulation. Avoid adding more arguments.

Check warning on line 176 in perception/autoware_multi_object_tracker/lib/odometry.cpp

See this annotation in the file changed.

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

❌ New issue: Bumpy Road Ahead

Odometry::transformObjects 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.

Check notice on line 117 in perception/autoware_multi_object_tracker/lib/tracker/model/bicycle_tracker.cpp

See this annotation in the file changed.

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

✅ No longer an issue: Large Method

BicycleTracker::BicycleTracker is no longer above the threshold for lines of code

Check notice on line 172 in perception/autoware_multi_object_tracker/lib/tracker/model/pedestrian_tracker.cpp

See this annotation in the file changed.

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

✅ No longer an issue: Complex Method

PedestrianTracker::measureWithShape is no longer above the threshold for cyclomatic complexity

Check warning on line 153 in perception/autoware_multi_object_tracker/lib/tracker/model/pedestrian_tracker.cpp

See this annotation in the file changed.

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

❌ New issue: Complex Conditional

PedestrianTracker::measureWithShape has 1 complex conditionals with 5 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.

Check notice on line 106 in perception/autoware_multi_object_tracker/lib/tracker/model/pedestrian_tracker.cpp

See this annotation in the file changed.

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

✅ No longer an issue: Large Method

PedestrianTracker::PedestrianTracker is no longer above the threshold for lines of code

Check notice on line 172 in perception/autoware_multi_object_tracker/lib/tracker/model/pedestrian_tracker.cpp

See this annotation in the file changed.

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

✅ No longer an issue: Bumpy Road Ahead

PedestrianTracker::measureWithShape is no longer above the threshold for logical blocks with deeply nested code

Check notice on line 1 in perception/autoware_multi_object_tracker/lib/tracker/model/pedestrian_tracker.cpp

See this annotation in the file changed.

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

✅ No longer an issue: Overall Code Complexity

The mean cyclomatic complexity in this module is no longer above the threshold

Check notice on line 69 in perception/autoware_multi_object_tracker/lib/tracker/model/unknown_tracker.cpp

See this annotation in the file changed.

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

✅ No longer an issue: Large Method

UnknownTracker::UnknownTracker is no longer above the threshold for lines of code

Check warning on line 208 in perception/autoware_multi_object_tracker/lib/tracker/model/vehicle_tracker.cpp

See this annotation in the file changed.

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

❌ New issue: Complex Conditional

VehicleTracker::measureWithShape has 1 complex conditionals with 3 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.

Check notice on line 127 in perception/autoware_multi_object_tracker/lib/tracker/model/vehicle_tracker.cpp

See this annotation in the file changed.

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

✅ Getting better: Large Method

VehicleTracker::VehicleTracker decreases from 92 to 71 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 notice on line 366 in perception/autoware_multi_object_tracker/src/debugger/debug_object.cpp

See this annotation in the file changed.

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

✅ Getting better: Complex Method

TrackerObjectDebugger::draw decreases in cyclomatic complexity from 19 to 17, 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.

Check notice on line 1 in perception/autoware_multi_object_tracker/src/debugger/debug_object.cpp

See this annotation in the file changed.

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

✅ Getting better: Overall Code Complexity

The mean cyclomatic complexity decreases from 4.44 to 4.22, threshold = 4. This file has many conditional statements (e.g. if, for, while) across its implementation, leading to lower code health. Avoid adding more conditionals.

Check notice on line 366 in perception/autoware_multi_object_tracker/src/debugger/debug_object.cpp

See this annotation in the file changed.

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

✅ No longer an issue: Deep, Nested Complexity

TrackerObjectDebugger::draw is no longer above the threshold for nested complexity depth

Check notice on line 192 in perception/autoware_multi_object_tracker/src/multi_object_tracker_node.cpp

See this annotation in the file changed.

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

✅ Getting better: Large Method

MultiObjectTracker::MultiObjectTracker decreases from 111 to 110 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 119 in perception/autoware_multi_object_tracker/src/processor/input_manager.cpp

See this annotation in the file changed.

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

❌ New issue: Complex Method

InputStream::onMessage 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.

Check warning on line 119 in perception/autoware_multi_object_tracker/src/processor/input_manager.cpp

See this annotation in the file changed.

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

❌ New issue: Bumpy Road Ahead

InputStream::onMessage 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.

Check notice on line 1 in perception/autoware_multi_object_tracker/src/processor/processor.cpp

See this annotation in the file changed.

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

✅ Getting better: Overall Code Complexity

The mean cyclomatic complexity decreases from 5.00 to 4.67, threshold = 4. This file has many conditional statements (e.g. if, for, while) across its implementation, leading to lower code health. Avoid adding more conditionals.