Skip to content
CodeScene Delta Analysis / CodeScene Cloud Delta Analysis (main) failed Dec 14, 2023 in 54s

CodeScene PR Check

Code Health Quality Gates: FAILED

  • Declining Code Health: 11 findings(s) 🚩
  • Improving Code Health: 2 findings(s) ✅
  • Affected Hotspots: 0 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):

  • Large Method traffic_light_node_container.launch.py: generate_launch_description
  • Complex Method node.cpp: MapBasedDetector::routeCallback
  • Complex Method node.cpp: CrosswalkTrafficLightEstimatorNode::updateLastDetectedSignals
  • Complex Method node.cpp: MapBasedDetector::getVisibleTrafficLights
  • Complex Method node.cpp: CrosswalkTrafficLightEstimatorNode::updateState
  • Complex Conditional node.cpp: CrosswalkTrafficLightEstimatorNode::isFlashing
  • Complex Method nodelet.cpp: TrafficLightOcclusionPredictorNodelet::syncCallback
  • Excess Number of Function Arguments nodelet.cpp: TrafficLightOcclusionPredictorNodelet::syncCallback
  • Bumpy Road Ahead node.cpp: CrosswalkTrafficLightEstimatorNode::updateLastDetectedSignals
  • Bumpy Road Ahead node.cpp: CrosswalkTrafficLightEstimatorNode::updateState
  • Bumpy Road Ahead nodelet.cpp: TrafficLightOcclusionPredictorNodelet::syncCallback

✅ Improving Code Health:

  • Complex Method nodelet.cpp: TrafficLightFineDetectorNodelet::callback
  • Complex Conditional nodelet.cpp: TrafficLightOcclusionPredictorNodelet::syncCallback

Annotations

Check warning on line 151 in launch/tier4_perception_launch/launch/traffic_light_recognition/traffic_light_node_container.launch.py

See this annotation in the file changed.

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

❌ Getting worse: Large Method

generate_launch_description increases from 169 to 210 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 274 in perception/crosswalk_traffic_light_estimator/src/node.cpp

See this annotation in the file changed.

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

❌ New issue: Complex Method

CrosswalkTrafficLightEstimatorNode::updateLastDetectedSignals has a cyclomatic complexity of 14, 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 374 in perception/crosswalk_traffic_light_estimator/src/node.cpp

See this annotation in the file changed.

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

❌ New issue: Complex Method

CrosswalkTrafficLightEstimatorNode::updateState 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.

Check warning on line 327 in perception/crosswalk_traffic_light_estimator/src/node.cpp

See this annotation in the file changed.

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

❌ New issue: Complex Conditional

CrosswalkTrafficLightEstimatorNode::isFlashing has 1 complex conditionals with 2 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 warning on line 274 in perception/crosswalk_traffic_light_estimator/src/node.cpp

See this annotation in the file changed.

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

❌ New issue: Bumpy Road Ahead

CrosswalkTrafficLightEstimatorNode::updateLastDetectedSignals 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 warning on line 374 in perception/crosswalk_traffic_light_estimator/src/node.cpp

See this annotation in the file changed.

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

❌ New issue: Bumpy Road Ahead

CrosswalkTrafficLightEstimatorNode::updateState 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/crosswalk_traffic_light_estimator/src/node.cpp

See this annotation in the file changed.

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

ℹ Getting worse: Overall Code Complexity

The mean cyclomatic complexity increases from 6.38 to 7.87, 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 194 in perception/traffic_light_fine_detector/src/nodelet.cpp

See this annotation in the file changed.

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

✅ Getting better: Complex Method

TrafficLightFineDetectorNodelet::callback decreases in cyclomatic complexity from 13 to 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.

Check warning on line 483 in perception/traffic_light_map_based_detector/src/node.cpp

See this annotation in the file changed.

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

❌ Getting worse: Complex Method

MapBasedDetector::routeCallback increases in cyclomatic complexity from 9 to 15, 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 520 in perception/traffic_light_map_based_detector/src/node.cpp

See this annotation in the file changed.

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

❌ Getting worse: Complex Method

MapBasedDetector::getVisibleTrafficLights increases in cyclomatic complexity from 13 to 14, 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 483 in perception/traffic_light_map_based_detector/src/node.cpp

See this annotation in the file changed.

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

ℹ Getting worse: Bumpy Road Ahead

MapBasedDetector::routeCallback increases from 2 to 4 logical blocks with deeply nested code, threshold is one single 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/traffic_light_map_based_detector/src/node.cpp

See this annotation in the file changed.

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

ℹ Getting worse: Overall Code Complexity

The mean cyclomatic complexity increases from 4.06 to 4.50, 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 warning on line 170 in perception/traffic_light_occlusion_predictor/src/nodelet.cpp

See this annotation in the file changed.

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

❌ New issue: Complex Method

TrafficLightOcclusionPredictorNodelet::syncCallback has a cyclomatic complexity of 10, 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 128 in perception/traffic_light_occlusion_predictor/src/nodelet.cpp

See this annotation in the file changed.

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

✅ Getting better: Complex Conditional

TrafficLightOcclusionPredictorNodelet::syncCallback decreases from 1 complex conditionals with 3 branches to 1 complex conditionals with 2 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 warning on line 170 in perception/traffic_light_occlusion_predictor/src/nodelet.cpp

See this annotation in the file changed.

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

❌ New issue: Bumpy Road Ahead

TrafficLightOcclusionPredictorNodelet::syncCallback 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 warning on line 170 in perception/traffic_light_occlusion_predictor/src/nodelet.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

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