Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(tensorrt yolox): inference and publish mask image from yolox model with semantic segmentation header #5553

fix: skip mask size as yolox output

a15ac04
Select commit
Loading
Failed to load commit list.
Merged

feat(tensorrt yolox): inference and publish mask image from yolox model with semantic segmentation header #5553

fix: skip mask size as yolox output
a15ac04
Select commit
Loading
Failed to load commit list.
CodeScene Delta Analysis / CodeScene Cloud Delta Analysis (main) failed Jun 24, 2024 in 1m 7s

CodeScene PR Check

Code Health Quality Gates: FAILED

  • Declining Code Health: 17 findings(s) 🚩
  • Improving Code Health: 1 findings(s) ✅

View detailed results in CodeScene

Details

🚩 Declining Code Health (highest to lowest):

  • Complex Method tensorrt_yolox.cpp: TrtYoloX::TrtYoloX
  • Large Method tensorrt_yolox_node.cpp: TrtYoloXNode::TrtYoloXNode
  • Lines of Code in a Single File tensorrt_yolox.cpp
  • Complex Conditional tensorrt_yolox_node.cpp: TrtYoloXNode::onConnect
  • Overall Code Complexity tensorrt_yolox_node.cpp
  • Complex Method tensorrt_yolox.cpp: TrtYoloX::preprocessGpu
  • Complex Method tensorrt_yolox.cpp: TrtYoloX::initPreprocessBuffer
  • Deep, Nested Complexity tensorrt_yolox.cpp: get_seg_colormap
  • Deep, Nested Complexity tensorrt_yolox.cpp: TrtYoloX::feedforwardAndDecode
  • Deep, Nested Complexity tensorrt_yolox.cpp: TrtYoloX::getMaskImage
  • Excess Number of Function Arguments tensorrt_yolox.cpp: TrtYoloX::getMaskImageGpu
  • Complex Method tensorrt_yolox.cpp: TrtYoloX::feedforwardAndDecode
  • Bumpy Road Ahead tensorrt_yolox.cpp: TrtYoloX::TrtYoloX
  • Bumpy Road Ahead tensorrt_yolox.cpp: TrtYoloX::initPreprocessBuffer
  • Bumpy Road Ahead tensorrt_yolox.cpp: TrtYoloX::preprocessGpu
  • Complex Method tensorrt_yolox_node.cpp: TrtYoloXNode::onImage
  • Bumpy Road Ahead tensorrt_yolox.cpp: get_seg_colormap

✅ Improving Code Health:

  • Code Duplication tensorrt_yolox.cpp

Annotations

Check warning on line 1 in perception/tensorrt_yolox/src/tensorrt_yolox.cpp

See this annotation in the file changed.

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

❌ New issue: Lines of Code in a Single File

This module has 1083 lines of code, 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.

Check notice on line 1 in perception/tensorrt_yolox/src/tensorrt_yolox.cpp

See this annotation in the file changed.

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

✅ Getting better: Code Duplication

reduced similar code in: TrtYoloX::feedforwardAndDecode,TrtYoloX::multiScaleFeedforwardAndDecode. Avoid duplicated, aka copy-pasted, code inside the module. More duplication lowers the code health.

Check warning on line 325 in perception/tensorrt_yolox/src/tensorrt_yolox.cpp

See this annotation in the file changed.

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

❌ Getting worse: Complex Method

TrtYoloX::TrtYoloX increases in cyclomatic complexity from 20 to 22, 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 490 in perception/tensorrt_yolox/src/tensorrt_yolox.cpp

See this annotation in the file changed.

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

❌ Getting worse: Complex Method

TrtYoloX::preprocessGpu increases in cyclomatic complexity from 11 to 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 warning on line 404 in perception/tensorrt_yolox/src/tensorrt_yolox.cpp

See this annotation in the file changed.

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

❌ Getting worse: Complex Method

TrtYoloX::initPreprocessBuffer increases in cyclomatic complexity from 12 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 warning on line 957 in perception/tensorrt_yolox/src/tensorrt_yolox.cpp

See this annotation in the file changed.

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

❌ New issue: Complex Method

TrtYoloX::feedforwardAndDecode 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 325 in perception/tensorrt_yolox/src/tensorrt_yolox.cpp

See this annotation in the file changed.

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

❌ Getting worse: Bumpy Road Ahead

TrtYoloX::TrtYoloX 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 warning on line 404 in perception/tensorrt_yolox/src/tensorrt_yolox.cpp

See this annotation in the file changed.

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

❌ Getting worse: Bumpy Road Ahead

TrtYoloX::initPreprocessBuffer increases from 3 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 warning on line 490 in perception/tensorrt_yolox/src/tensorrt_yolox.cpp

See this annotation in the file changed.

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

❌ Getting worse: Bumpy Road Ahead

TrtYoloX::preprocessGpu 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 warning on line 151 in perception/tensorrt_yolox/src/tensorrt_yolox.cpp

See this annotation in the file changed.

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

❌ New issue: Bumpy Road Ahead

get_seg_colormap 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/tensorrt_yolox/src/tensorrt_yolox.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 5.21 to 5.61, 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 151 in perception/tensorrt_yolox/src/tensorrt_yolox.cpp

See this annotation in the file changed.

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

❌ New issue: Deep, Nested Complexity

get_seg_colormap 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 957 in perception/tensorrt_yolox/src/tensorrt_yolox.cpp

See this annotation in the file changed.

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

❌ New issue: Deep, Nested Complexity

TrtYoloX::feedforwardAndDecode 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 1270 in perception/tensorrt_yolox/src/tensorrt_yolox.cpp

See this annotation in the file changed.

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

❌ New issue: Deep, Nested Complexity

TrtYoloX::getMaskImage 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 notice on line 1 in perception/tensorrt_yolox/src/tensorrt_yolox.cpp

See this annotation in the file changed.

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

ℹ Getting worse: Primitive Obsession

The ratio of primitive types in function arguments increases from 30.77% to 40.82%, threshold = 30.0%. The functions in this file have too many primitive types (e.g. int, double, float) in their function argument lists. Using many primitive types lead to the code smell Primitive Obsession. Avoid adding more primitive arguments.

Check warning on line 1244 in perception/tensorrt_yolox/src/tensorrt_yolox.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

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

Check warning on line 255 in perception/tensorrt_yolox/src/tensorrt_yolox_node.cpp

See this annotation in the file changed.

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

❌ New issue: Complex Method

TrtYoloXNode::onImage 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 warning on line 158 in perception/tensorrt_yolox/src/tensorrt_yolox_node.cpp

See this annotation in the file changed.

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

❌ Getting worse: Complex Conditional

TrtYoloXNode::onConnect increases from 1 complex conditionals with 2 branches to 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 143 in perception/tensorrt_yolox/src/tensorrt_yolox_node.cpp

See this annotation in the file changed.

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

❌ Getting worse: Large Method

TrtYoloXNode::TrtYoloXNode increases from 88 to 112 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 1 in perception/tensorrt_yolox/src/tensorrt_yolox_node.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 5.43 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.