feat(localization): add nerf_based_localizer
#5312
CodeScene PR Check
❌ Code Health Quality Gates: FAILED
Change in average Code Health of affected files: +0.56 (9.05 -> 9.61)
- Declining Code Health: 12 findings(s) 🚩
Details
🚩 Declining Code Health (highest to lowest):
- Large Method nerf_based_localizer.cpp: NerfBasedLocalizer::localize
- Complex Method walk.cpp: walk
- Complex Method train_manager.cpp: TrainManager::train
- Large Method renderer.cpp: Renderer::render
- Large Method infer.cpp: infer
- Excess Number of Function Arguments renderer.cpp: Renderer::render_image
- Complex Conditional nerf_based_localizer.cpp: NerfBasedLocalizer::callback_initial_pose
- Global Conditionals prepare_data.py
- Complex Method pose_initializer_core.cpp: PoseInitializer::PoseInitializer
- Complex Method pose_initializer_core.cpp: PoseInitializer::on_initialize
- Bumpy Road Ahead hash_3d_anchored.cpp: Hash3DAnchored::Hash3DAnchored
- Bumpy Road Ahead nerf_based_localizer.cpp: NerfBasedLocalizer::callback_initial_pose
Annotations
Check warning on line 84 in localization/nerf_based_localizer/src/nerf/hash_3d_anchored.cpp
codescene-delta-analysis / CodeScene Cloud Delta Analysis (main)
❌ New issue: Bumpy Road Ahead
Hash3DAnchored::Hash3DAnchored 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 140 in localization/nerf_based_localizer/src/nerf/renderer.cpp
codescene-delta-analysis / CodeScene Cloud Delta Analysis (main)
❌ New issue: Large Method
Renderer::render has 75 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 189 in localization/nerf_based_localizer/src/nerf/renderer.cpp
codescene-delta-analysis / CodeScene Cloud Delta Analysis (main)
❌ New issue: Excess Number of Function Arguments
Renderer::render_image has 5 arguments, threshold = 4. This function has too many arguments, indicating a lack of encapsulation. Avoid adding more arguments.
Check warning on line 124 in localization/nerf_based_localizer/src/nerf_based_localizer.cpp
codescene-delta-analysis / CodeScene Cloud Delta Analysis (main)
❌ New issue: Complex Conditional
NerfBasedLocalizer::callback_initial_pose 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 363 in localization/nerf_based_localizer/src/nerf_based_localizer.cpp
codescene-delta-analysis / CodeScene Cloud Delta Analysis (main)
❌ New issue: Large Method
NerfBasedLocalizer::localize has 117 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 138 in localization/nerf_based_localizer/src/nerf_based_localizer.cpp
codescene-delta-analysis / CodeScene Cloud Delta Analysis (main)
❌ New issue: Bumpy Road Ahead
NerfBasedLocalizer::callback_initial_pose 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 localization/nerf_based_localizer/training_tool/script/prepare_data.py
codescene-delta-analysis / CodeScene Cloud Delta Analysis (main)
❌ New issue: Global Conditionals
There's global code outside of functions with a cyclomatic complexity of 18, threshold = 10. The code has become too complex as it contains many conditional statements (e.g. if, for, while) across its implementation, leading to lower code health. Avoid adding more.
Check warning on line 117 in localization/nerf_based_localizer/training_tool/src/infer.cpp
codescene-delta-analysis / CodeScene Cloud Delta Analysis (main)
❌ New issue: Large Method
infer has 70 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 177 in localization/nerf_based_localizer/training_tool/src/train_manager.cpp
codescene-delta-analysis / CodeScene Cloud Delta Analysis (main)
❌ New issue: Complex Method
TrainManager::train 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 145 in localization/nerf_based_localizer/training_tool/src/walk.cpp
codescene-delta-analysis / CodeScene Cloud Delta Analysis (main)
❌ New issue: Complex Method
walk 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.
codescene-delta-analysis / CodeScene Cloud Delta Analysis (main)
❌ Getting worse: Complex Method
PoseInitializer::PoseInitializer increases in cyclomatic complexity from 14 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.
codescene-delta-analysis / CodeScene Cloud Delta Analysis (main)
❌ Getting worse: Complex Method
PoseInitializer::on_initialize 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.