refactor(multi_object_tracker): internal message driven process #10203
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.40 | 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.40 | 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 → 10.00 | 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
- Complex Method association.cpp: DataAssociation::calcScoreMatrix
- Bumpy Road Ahead association.cpp: DataAssociation::calcScoreMatrix
- Deep, Nested Complexity association.cpp: DataAssociation::calcScoreMatrix
- Complex Method shapes.cpp: calcOffsetVectorFromShapeChange
- Primitive Obsession shapes.cpp
- Excess Number of Function Arguments shapes.cpp: getNearestCornerOrSurface
- Excess Number of Function Arguments shapes.cpp: calcAnchorPointOffset
- 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
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
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
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
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 217 in perception/autoware_multi_object_tracker/lib/object_model/shapes.cpp
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
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 216 in perception/autoware_multi_object_tracker/lib/object_model/shapes.cpp
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
Check notice on line 253 in perception/autoware_multi_object_tracker/lib/object_model/shapes.cpp
codescene-delta-analysis / CodeScene Cloud Delta Analysis (main)
✅ No longer an issue: Excess Number of Function Arguments
calcAnchorPointOffset is no longer above the threshold for number of arguments
Check warning on line 176 in perception/autoware_multi_object_tracker/lib/odometry.cpp
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.
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
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
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.
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
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
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
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
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.
codescene-delta-analysis / CodeScene Cloud Delta Analysis (main)
✅ Getting better: Large Method
VehicleTracker::VehicleTracker decreases from 92 to 72 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
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
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
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
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.
codescene-delta-analysis / CodeScene Cloud Delta Analysis (main)
❌ New issue: Complex Method
InputStream::onMessage has a cyclomatic complexity of 12, 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
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
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.