refactor(intersection): divide source files and modifyPathVelocity #6134
CodeScene PR Check
❌ Code Health Quality Gates: FAILED
- Declining Code Health: 56 findings(s) 🚩
- Improving Code Health: 54 findings(s) ✅
- Affected Hotspots: 2 files(s) 🔥
Recommended Review Level: Detailed -- Inspect the code that degrades in code health.
View detailed results in CodeScene
Details
🚩 Declining Code Health (highest to lowest):
- Complex Method scene_intersection_occlusion.cpp: IntersectionModule::detectOcclusion
- Complex Method scene_intersection_prepare_data.cpp: IntersectionModule::generateObjectiveLanelets
- Brain Method scene_intersection_collision.cpp: IntersectionModule::checkCollision
- Brain Method scene_intersection_occlusion.cpp: IntersectionModule::detectOcclusion
- Code Duplication scene_intersection.cpp 🔥
- Bumpy Road Ahead scene_intersection_occlusion.cpp: IntersectionModule::detectOcclusion
- Complex Method scene_intersection_collision.cpp: IntersectionModule::checkCollision
- Complex Conditional scene_intersection_collision.cpp: IntersectionModule::checkCollision
- Bumpy Road Ahead scene_intersection_prepare_data.cpp: IntersectionModule::generateObjectiveLanelets
- Complex Method scene_intersection_prepare_data.cpp: IntersectionModule::generateIntersectionStopLines
- Overall Code Complexity scene_intersection_collision.cpp
- Deep, Nested Complexity scene_intersection_occlusion.cpp: IntersectionModule::detectOcclusion
- Overall Code Complexity scene_intersection_prepare_data.cpp
- Complex Conditional scene_intersection_stuck.cpp: IntersectionModule::isTargetStuckVehicleType
- Overall Code Complexity scene_intersection_stuck.cpp
- Deep, Nested Complexity scene_intersection_stuck.cpp: IntersectionModule::isStuckStatus
- Complex Conditional scene_intersection_collision.cpp: IntersectionModule::isTargetCollisionVehicleType
- Complex Method scene_intersection_collision.cpp: IntersectionModule::calcIntersectionPassingTime
- Complex Method scene_intersection_stuck.cpp: IntersectionModule::checkYieldStuckVehicleInIntersection
- Complex Method scene_intersection_stuck.cpp: IntersectionModule::checkStuckVehicleInIntersection
- Complex Method scene_intersection_prepare_data.cpp: IntersectionModule::prepareIntersectionData
- Complex Method scene_intersection_prepare_data.cpp: getFirstPointInsidePolygons
- Complex Method scene_intersection_stuck.cpp: IntersectionModule::isStuckStatus
- Complex Method scene_intersection_prepare_data.cpp: IntersectionModule::generatePathLanelets
- Complex Method intersection_lanelets.cpp: IntersectionLanelets::update
- Complex Conditional intersection_lanelets.cpp: IntersectionLanelets::update
- Excess Number of Function Arguments intersection_lanelets.cpp: IntersectionLanelets::update
- Deep, Nested Complexity scene_intersection_collision.cpp: IntersectionModule::checkCollision
- Deep, Nested Complexity scene_intersection_collision.cpp: IntersectionModule::cutPredictPathWithDuration
- Excess Number of Function Arguments scene_intersection_occlusion.cpp: IntersectionModule::detectOcclusion
- Complex Conditional scene_intersection_prepare_data.cpp: IntersectionModule::prepareIntersectionData
- Deep, Nested Complexity scene_intersection_prepare_data.cpp: getFirstPointInsidePolygons
- Deep, Nested Complexity scene_intersection_prepare_data.cpp: IntersectionModule::generateObjectiveLanelets
- Complex Method scene_intersection_occlusion.cpp: IntersectionModule::getOcclusionStatus
- Bumpy Road Ahead scene_intersection_prepare_data.cpp: IntersectionModule::generateIntersectionStopLines
- Complex Method scene_intersection_collision.cpp: IntersectionModule::checkAngleForTargetLanelets
- Complex Conditional scene_intersection_collision.cpp: IntersectionModule::checkAngleForTargetLanelets
- Complex Conditional scene_intersection_collision.cpp: IntersectionModule::calcIntersectionPassingTime
- Bumpy Road Ahead scene_intersection_collision.cpp: IntersectionModule::checkCollision
- Bumpy Road Ahead scene_intersection_stuck.cpp: IntersectionModule::checkYieldStuckVehicleInIntersection
- Bumpy Road Ahead scene_intersection_prepare_data.cpp: IntersectionModule::generateDetectionLaneDivisions
- Excess Number of Function Arguments scene_intersection_collision.cpp: IntersectionModule::checkCollision
- Bumpy Road Ahead scene_intersection_collision.cpp: IntersectionModule::checkAngleForTargetLanelets
- Bumpy Road Ahead scene_intersection_stuck.cpp: IntersectionModule::isStuckStatus
- Bumpy Road Ahead intersection_lanelets.cpp: IntersectionLanelets::update
- Bumpy Road Ahead scene_intersection_prepare_data.cpp: getFirstPointInsidePolygons
- Bumpy Road Ahead scene_intersection_prepare_data.cpp: IntersectionModule::getStopLineIndexFromMap
- Bumpy Road Ahead scene_intersection_prepare_data.cpp: IntersectionModule::generatePathLanelets
- Excess Number of Function Arguments scene_intersection_collision.cpp: IntersectionModule::calcIntersectionPassingTime
- Excess Number of Function Arguments scene_intersection_prepare_data.cpp: IntersectionModule::generatePathLanelets
- Bumpy Road Ahead scene_intersection_collision.cpp: IntersectionModule::isGreenPseudoCollisionStatus
- Bumpy Road Ahead scene_intersection_collision.cpp: IntersectionModule::calcIntersectionPassingTime
- Bumpy Road Ahead scene_intersection_stuck.cpp: getLineStringFromArcLength
- Bumpy Road Ahead scene_intersection_stuck.cpp: IntersectionModule::isYieldStuckStatus
- Excess Number of Function Arguments scene_intersection_prepare_data.cpp: IntersectionModule::generateIntersectionStopLines
- Excess Number of Function Arguments scene_intersection_prepare_data.cpp: generatePathLanelet
✅ Improving Code Health:
- Code Duplication scene_intersection.cpp 🔥
- Complex Method scene_intersection.cpp: IntersectionModule::modifyPathVelocityDetail 🔥
- Lines of Code in a Single File scene_intersection.cpp 🔥
- Overall Code Complexity scene_intersection.cpp 🔥
- Overall Code Complexity util.cpp 🔥
- Complex Conditional scene_intersection.cpp: isTargetStuckVehicleType 🔥
- Complex Conditional scene_intersection.cpp: isTargetCollisionVehicleType 🔥
- Complex Conditional scene_intersection.cpp: IntersectionModule::modifyPathVelocityDetail 🔥
- Complex Conditional scene_intersection.cpp: IntersectionModule::checkCollision 🔥
- Complex Conditional scene_intersection.cpp: IntersectionModule::checkAngleForTargetLanelets 🔥
- Complex Conditional scene_intersection.cpp: IntersectionModule::calcIntersectionPassingTime 🔥
- Complex Conditional scene_intersection.cpp: IntersectionLanelets::update 🔥
- Complex Method scene_intersection.cpp: IntersectionModule::getOcclusionStatus 🔥
- Complex Method scene_intersection.cpp: IntersectionModule::getObjectiveLanelets 🔥
- Complex Method scene_intersection.cpp: IntersectionModule::checkCollision 🔥
- Complex Method scene_intersection.cpp: IntersectionModule::generateIntersectionStopLines 🔥
- Complex Method scene_intersection.cpp: IntersectionModule::calcIntersectionPassingTime 🔥
- Complex Method scene_intersection.cpp: IntersectionModule::checkYieldStuckVehicleInIntersection 🔥
- Complex Method scene_intersection.cpp: IntersectionModule::checkStuckVehicleInIntersection 🔥
- Complex Method scene_intersection.cpp: IntersectionLanelets::update 🔥
- Complex Method scene_intersection.cpp: IntersectionModule::checkAngleForTargetLanelets 🔥
- Complex Method scene_intersection.cpp: getFirstPointInsidePolygons 🔥
- Complex Method scene_intersection.cpp: formatDecisionResult 🔥
- Complex Method scene_intersection.cpp: IntersectionModule::generatePathLanelets 🔥
- Excess Number of Function Arguments scene_intersection.cpp: reactRTCApproval 🔥
- Excess Number of Function Arguments scene_intersection.cpp: IntersectionModule::generateIntersectionStopLines 🔥
- Excess Number of Function Arguments scene_intersection.cpp: generatePathLanelet 🔥
- Excess Number of Function Arguments scene_intersection.cpp: IntersectionModule::generatePathLanelets 🔥
- Excess Number of Function Arguments scene_intersection.cpp: IntersectionModule::checkCollision 🔥
- Excess Number of Function Arguments scene_intersection.cpp: IntersectionModule::calcIntersectionPassingTime 🔥
- Excess Number of Function Arguments scene_intersection.cpp: IntersectionModule::getOcclusionStatus 🔥
- Excess Number of Function Arguments scene_intersection.cpp: IntersectionLanelets::update 🔥
- Bumpy Road Ahead scene_intersection.cpp: IntersectionModule::getObjectiveLanelets 🔥
- Bumpy Road Ahead scene_intersection.cpp: IntersectionModule::getOcclusionStatus 🔥
- Bumpy Road Ahead scene_intersection.cpp: IntersectionModule::modifyPathVelocityDetail 🔥
- Bumpy Road Ahead scene_intersection.cpp: IntersectionModule::generateIntersectionStopLines 🔥
- Bumpy Road Ahead scene_intersection.cpp: IntersectionModule::checkYieldStuckVehicleInIntersection 🔥
- Bumpy Road Ahead scene_intersection.cpp: IntersectionModule::checkCollision 🔥
- Bumpy Road Ahead scene_intersection.cpp: IntersectionLanelets::update 🔥
- Bumpy Road Ahead scene_intersection.cpp: IntersectionModule::checkAngleForTargetLanelets 🔥
- Bumpy Road Ahead scene_intersection.cpp: IntersectionModule::generateDetectionLaneDivisions 🔥
- Bumpy Road Ahead scene_intersection.cpp: IntersectionModule::getStopLineIndexFromMap 🔥
- Bumpy Road Ahead scene_intersection.cpp: getFirstPointInsidePolygons 🔥
- Bumpy Road Ahead scene_intersection.cpp: IntersectionModule::generatePathLanelets 🔥
- Bumpy Road Ahead scene_intersection.cpp: getLineStringFromArcLength 🔥
- Bumpy Road Ahead scene_intersection.cpp: IntersectionModule::calcIntersectionPassingTime 🔥
- Brain Method scene_intersection.cpp: IntersectionModule::getOcclusionStatus 🔥
- Brain Method scene_intersection.cpp: IntersectionModule::checkCollision 🔥
- Deep, Nested Complexity scene_intersection.cpp: IntersectionModule::modifyPathVelocityDetail 🔥
- Deep, Nested Complexity scene_intersection.cpp: IntersectionModule::getObjectiveLanelets 🔥
- Deep, Nested Complexity scene_intersection.cpp: getFirstPointInsidePolygons 🔥
- Deep, Nested Complexity scene_intersection.cpp: IntersectionModule::checkCollision 🔥
- Deep, Nested Complexity scene_intersection.cpp: IntersectionModule::cutPredictPathWithDuration 🔥
- Deep, Nested Complexity scene_intersection.cpp: IntersectionModule::getOcclusionStatus 🔥
Annotations
Check notice on line 1 in planning/behavior_velocity_intersection_module/src/scene_intersection.cpp
codescene-delta-analysis / CodeScene Cloud Delta Analysis (main)
✅ Getting better: Lines of Code in a Single File
The lines of code decreases from 2937 to 1136, 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.
codescene-delta-analysis / CodeScene Cloud Delta Analysis (main)
❌ Getting worse: Code Duplication
introduced similar code in: prepareRTCByDecisionResult,prepareRTCByDecisionResult,prepareRTCByDecisionResult,prepareRTCByDecisionResult and 3 more functions. Avoid duplicated, aka copy-pasted, code inside the module. More duplication lowers the code health.
Check notice on line 1 in planning/behavior_velocity_intersection_module/src/scene_intersection.cpp
codescene-delta-analysis / CodeScene Cloud Delta Analysis (main)
✅ Getting better: Code Duplication
reduced similar code in: isTargetCollisionVehicleType,isTargetStuckVehicleType. Avoid duplicated, aka copy-pasted, code inside the module. More duplication lowers the code health.
codescene-delta-analysis / CodeScene Cloud Delta Analysis (main)
✅ Getting better: Complex Method
IntersectionModule::modifyPathVelocityDetail decreases in cyclomatic complexity from 98 to 42, 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)
✅ No longer an issue: Complex Method
IntersectionModule::getOcclusionStatus 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.
codescene-delta-analysis / CodeScene Cloud Delta Analysis (main)
✅ No longer an issue: Complex Method
IntersectionModule::getObjectiveLanelets 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.
codescene-delta-analysis / CodeScene Cloud Delta Analysis (main)
✅ No longer an issue: Complex Method
IntersectionModule::checkCollision 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.
codescene-delta-analysis / CodeScene Cloud Delta Analysis (main)
✅ No longer an issue: Complex Method
IntersectionModule::generateIntersectionStopLines 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.
codescene-delta-analysis / CodeScene Cloud Delta Analysis (main)
✅ No longer an issue: Complex Method
IntersectionModule::calcIntersectionPassingTime 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.
codescene-delta-analysis / CodeScene Cloud Delta Analysis (main)
✅ No longer an issue: Complex Method
IntersectionModule::checkYieldStuckVehicleInIntersection 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.
codescene-delta-analysis / CodeScene Cloud Delta Analysis (main)
✅ No longer an issue: Complex Method
IntersectionModule::checkStuckVehicleInIntersection 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.
codescene-delta-analysis / CodeScene Cloud Delta Analysis (main)
✅ No longer an issue: Complex Method
IntersectionLanelets::update 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.
codescene-delta-analysis / CodeScene Cloud Delta Analysis (main)
✅ No longer an issue: Complex Method
IntersectionModule::checkAngleForTargetLanelets 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.
codescene-delta-analysis / CodeScene Cloud Delta Analysis (main)
✅ No longer an issue: Complex Method
getFirstPointInsidePolygons 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.
codescene-delta-analysis / CodeScene Cloud Delta Analysis (main)
✅ No longer an issue: Complex Method
formatDecisionResult 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.
codescene-delta-analysis / CodeScene Cloud Delta Analysis (main)
✅ No longer an issue: Complex Method
IntersectionModule::generatePathLanelets 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.
codescene-delta-analysis / CodeScene Cloud Delta Analysis (main)
ℹ New issue: Complex Method
IntersectionModule::isOverPassJudgeLinesStatus has a cyclomatic complexity of 18, 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 42 in planning/behavior_velocity_intersection_module/src/scene_intersection.cpp
codescene-delta-analysis / CodeScene Cloud Delta Analysis (main)
✅ No longer an issue: Complex Conditional
isTargetStuckVehicleType no longer has a complex conditional. 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 42 in planning/behavior_velocity_intersection_module/src/scene_intersection.cpp
codescene-delta-analysis / CodeScene Cloud Delta Analysis (main)
✅ No longer an issue: Complex Conditional
isTargetCollisionVehicleType no longer has a complex conditional. 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: Complex Conditional
IntersectionModule::modifyPathVelocityDetail no longer has a complex conditional. 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: Complex Conditional
IntersectionModule::checkCollision no longer has a complex conditional. 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: Complex Conditional
IntersectionModule::checkAngleForTargetLanelets no longer has a complex conditional. 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: Complex Conditional
IntersectionModule::calcIntersectionPassingTime no longer has a complex conditional. 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: Complex Conditional
IntersectionLanelets::update no longer has a complex conditional. 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
IntersectionModule::isOverPassJudgeLinesStatus has 3 complex conditionals with 8 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.