Skip to content

style(pre-commit): autofix

CodeScene Delta Analysis / CodeScene Cloud Delta Analysis (main) failed Aug 23, 2024 in 55s

CodeScene PR Check

Code Health Quality Gates: FAILED

Code Health of new files: 7.70

  • Declining Code Health: 21 findings(s) 🚩

View detailed results in CodeScene

Details

🚩 Declining Code Health (highest to lowest):

  • Code Duplication tensorrt_rtmdet.cpp
  • Overall Code Complexity tensorrt_rtmdet.cpp
  • Complex Conditional tensorrt_rtmdet_node.cpp: TrtRTMDetNode::onConnect
  • Complex Method tensorrt_rtmdet_node.cpp: TrtRTMDetNode::onImage
  • Large Method batched_nms_kernel.cpp: nmsInference
  • Large Method tensorrt_rtmdet.cpp: TrtRTMDet::feedforward
  • Complex Method tensorrt_rtmdet.cpp: TrtRTMDet::preprocessWithRoiGpu
  • Complex Method tensorrt_rtmdet.cpp: TrtRTMDet::multiScalePreprocessGpu
  • Complex Method tensorrt_rtmdet.cpp: TrtRTMDet::preprocessGpu
  • Complex Method tensorrt_rtmdet.cpp: TrtRTMDet::TrtRTMDet
  • Deep, Nested Complexity tensorrt_rtmdet.cpp: TrtRTMDet::preprocessGpu
  • Deep, Nested Complexity tensorrt_rtmdet.cpp: TrtRTMDet::preprocessWithRoiGpu
  • Excess Number of Function Arguments tensorrt_rtmdet.cpp: TrtRTMDet::doInferenceWithRoi
  • Bumpy Road Ahead tensorrt_rtmdet.cpp: loadImageList
  • Bumpy Road Ahead tensorrt_rtmdet.cpp: TrtRTMDet::preprocessGpu
  • Bumpy Road Ahead tensorrt_rtmdet.cpp: TrtRTMDet::preprocess
  • Bumpy Road Ahead tensorrt_rtmdet.cpp: TrtRTMDet::preprocessWithRoiGpu
  • Bumpy Road Ahead tensorrt_rtmdet.cpp: TrtRTMDet::preprocessWithRoi
  • Bumpy Road Ahead tensorrt_rtmdet.cpp: TrtRTMDet::feedforward
  • Bumpy Road Ahead tensorrt_rtmdet.cpp: TrtRTMDet::nmsSortedBboxes
  • Bumpy Road Ahead tensorrt_rtmdet_node.cpp: TrtRTMDetNode::readLabelFile

Annotations

Check warning on line 403 in perception/autoware_tensorrt_rtmdet/src/tensorrt_rtmdet.cpp

See this annotation in the file changed.

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

❌ New issue: Code Duplication

The module contains 4 functions with similar structure: TrtRTMDet::multiScalePreprocess,TrtRTMDet::multiScalePreprocessGpu,TrtRTMDet::preprocessWithRoi,TrtRTMDet::preprocessWithRoiGpu. Avoid duplicated, aka copy-pasted, code inside the module. More duplication lowers the code health.

Check warning on line 403 in perception/autoware_tensorrt_rtmdet/src/tensorrt_rtmdet.cpp

See this annotation in the file changed.

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

❌ New issue: Complex Method

TrtRTMDet::preprocessWithRoiGpu 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 516 in perception/autoware_tensorrt_rtmdet/src/tensorrt_rtmdet.cpp

See this annotation in the file changed.

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

❌ New issue: Complex Method

TrtRTMDet::multiScalePreprocessGpu 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 282 in perception/autoware_tensorrt_rtmdet/src/tensorrt_rtmdet.cpp

See this annotation in the file changed.

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

❌ New issue: Complex Method

TrtRTMDet::preprocessGpu 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 206 in perception/autoware_tensorrt_rtmdet/src/tensorrt_rtmdet.cpp

See this annotation in the file changed.

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

❌ New issue: Complex Method

TrtRTMDet::TrtRTMDet 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 668 in perception/autoware_tensorrt_rtmdet/src/tensorrt_rtmdet.cpp

See this annotation in the file changed.

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

❌ New issue: Large Method

TrtRTMDet::feedforward has 71 lines, 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 99 in perception/autoware_tensorrt_rtmdet/src/tensorrt_rtmdet.cpp

See this annotation in the file changed.

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

❌ New issue: Bumpy Road Ahead

loadImageList 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 282 in perception/autoware_tensorrt_rtmdet/src/tensorrt_rtmdet.cpp

See this annotation in the file changed.

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

❌ New issue: Bumpy Road Ahead

TrtRTMDet::preprocessGpu 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 319 in perception/autoware_tensorrt_rtmdet/src/tensorrt_rtmdet.cpp

See this annotation in the file changed.

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

❌ New issue: Bumpy Road Ahead

TrtRTMDet::preprocess 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 403 in perception/autoware_tensorrt_rtmdet/src/tensorrt_rtmdet.cpp

See this annotation in the file changed.

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

❌ New issue: Bumpy Road Ahead

TrtRTMDet::preprocessWithRoiGpu 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 451 in perception/autoware_tensorrt_rtmdet/src/tensorrt_rtmdet.cpp

See this annotation in the file changed.

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

❌ New issue: Bumpy Road Ahead

TrtRTMDet::preprocessWithRoi 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 668 in perception/autoware_tensorrt_rtmdet/src/tensorrt_rtmdet.cpp

See this annotation in the file changed.

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

❌ New issue: Bumpy Road Ahead

TrtRTMDet::feedforward 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 761 in perception/autoware_tensorrt_rtmdet/src/tensorrt_rtmdet.cpp

See this annotation in the file changed.

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

❌ New issue: Bumpy Road Ahead

TrtRTMDet::nmsSortedBboxes 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 1 in perception/autoware_tensorrt_rtmdet/src/tensorrt_rtmdet.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.83 across 24 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 warning on line 282 in perception/autoware_tensorrt_rtmdet/src/tensorrt_rtmdet.cpp

See this annotation in the file changed.

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

❌ New issue: Deep, Nested Complexity

TrtRTMDet::preprocessGpu has a nested complexity depth of 4, threshold = 4. This function contains deeply nested logic such as if statements and/or loops. The deeper the nesting, the lower the code health.

Check warning on line 403 in perception/autoware_tensorrt_rtmdet/src/tensorrt_rtmdet.cpp

See this annotation in the file changed.

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

❌ New issue: Deep, Nested Complexity

TrtRTMDet::preprocessWithRoiGpu has a nested complexity depth of 4, threshold = 4. This function contains deeply nested logic such as if statements and/or loops. The deeper the nesting, the lower the code health.

Check warning on line 565 in perception/autoware_tensorrt_rtmdet/src/tensorrt_rtmdet.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

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

Check warning on line 197 in perception/autoware_tensorrt_rtmdet/src/tensorrt_rtmdet_node.cpp

See this annotation in the file changed.

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

❌ New issue: Complex Method

TrtRTMDetNode::onImage has a cyclomatic complexity of 9, 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 103 in perception/autoware_tensorrt_rtmdet/src/tensorrt_rtmdet_node.cpp

See this annotation in the file changed.

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

❌ New issue: Complex Conditional

TrtRTMDetNode::onConnect has 1 complex conditionals with 4 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 252 in perception/autoware_tensorrt_rtmdet/src/tensorrt_rtmdet_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

TrtRTMDetNode::readLabelFile 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 133 in perception/autoware_tensorrt_rtmdet/src/trt_batched_nms/common_impl/nms/batched_nms_kernel.cpp

See this annotation in the file changed.

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

❌ New issue: Large Method

nmsInference has 74 lines, 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.