Skip to content

refactor(traffic_light_roi_visualizer): adjust shape dimensions and f…

CodeScene Delta Analysis / CodeScene Cloud Delta Analysis (main) failed May 27, 2024 in 48s

CodeScene PR Check

❌ Code Health Quality Gates: FAILED

  • Declining Code Health: 4 findings(s) 🚩

View detailed results in CodeScene

Details

🚩 Declining Code Health (highest to lowest):

  • Complex Conditional shape_draw.cpp: drawShape
  • Complex Method shape_draw.cpp: drawShape
  • Excess Number of Function Arguments shape_draw.cpp: drawShape
  • Excess Number of Function Arguments shape_draw.cpp: drawTrafficLightShape

Annotations

Check warning on line 86 in perception/traffic_light_visualization/src/traffic_light_roi_visualizer/shape_draw.cpp

See this annotation in the file changed.

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

❌ New issue: Complex Method

drawShape 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 53 in perception/traffic_light_visualization/src/traffic_light_roi_visualizer/shape_draw.cpp

See this annotation in the file changed.

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

❌ New issue: Complex Conditional

drawShape 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 warning on line 86 in perception/traffic_light_visualization/src/traffic_light_roi_visualizer/shape_draw.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

drawShape has 6 arguments, threshold = 4. This function has too many arguments, indicating a lack of encapsulation. Avoid adding more arguments.

Check warning on line 158 in perception/traffic_light_visualization/src/traffic_light_roi_visualizer/shape_draw.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

drawTrafficLightShape has 6 arguments, threshold = 4. This function has too many arguments, indicating a lack of encapsulation. Avoid adding more arguments.