{"results":{"result":{"added-files":{"code-health":0.0,"old-code-health":0.0,"files":[]},"external-review-url":"https://github.com/autowarefoundation/autoware_universe/pull/12560","old-code-health":8.568748926809823,"modified-files":{"code-health":8.591171844228727,"old-code-health":8.568748926809823,"files":[{"file":"perception/autoware_multi_object_tracker/lib/association/bev_association.cpp","loc":236,"old-loc":245,"code-health":8.06892490681399,"old-code-health":8.06892490681399},{"file":"perception/autoware_multi_object_tracker/lib/association/scoring/bev_assignment_scoring.cpp","loc":69,"old-loc":67,"code-health":9.11380182785474,"old-code-health":9.11380182785474},{"file":"perception/autoware_multi_object_tracker/lib/object_model/shapes.cpp","loc":204,"old-loc":209,"code-health":9.6882083290695,"old-code-health":9.387218218812514},{"file":"perception/autoware_multi_object_tracker/lib/tracker/model/tracker_base.cpp","loc":487,"old-loc":480,"code-health":8.60735252960091,"old-code-health":8.64122327585742},{"file":"perception/autoware_multi_object_tracker/lib/tracker/model/vehicle_tracker.cpp","loc":382,"old-loc":337,"code-health":8.212934597307035,"old-code-health":8.212934597307035}]},"removed-files":{"code-health":0.0,"old-code-health":0.0,"files":[]},"external-review-id":"12560","analysis-time":"2026-05-08T08:02:44Z","negative-impact-count":1,"suppressions":{"number-of-types":0,"number-of-files-touched":0,"findings":[]},"affected-hotspots":0,"commits":["27396ea0fe271d106d14ae888a69184081e7c8ef","afac49d44f862d03c964e5f3530ea46a08a1428e","fb75459fc7988541d97a2fcb9ea1127016f5afb8","335d917e16fe3b69b363ee3df589449d60138f40","30b58be91f16df5d2e0ebffbf53c71ead5b66866"],"is-negative-review":true,"negative-findings":{"number-of-types":1,"number-of-files-touched":1,"findings":[{"method":"Tracker::updateWithMeasurement","why-it-occurs":"A Complex Method has a high cyclomatic complexity. The recommended threshold for the C++ language is a cyclomatic complexity lower than 9.","name":"Complex Method","file":"perception/autoware_multi_object_tracker/lib/tracker/model/tracker_base.cpp","refactoring-examples":[{"architectural-component-id":null,"author-name":"Taekjin LEE","training-data":{"loc-added":"11","loc-deleted":"14","delta-cc-mean":"0.0","delta-cc-total":"0","delta-penalties":"1.0","delta-n-functions":"0","current-file-score":"10.0"},"author-email":"taekjin.lee@tier4.jp","commit-full-message":"* feat(tracker_processor): set existence probability for tracked objects\n\nSigned-off-by: Taekjin LEE <taekjin.lee@tier4.jp>\n\n* refactor(tracker): rename classification parameter for clarity in updateClassification method\n\nSigned-off-by: Taekjin LEE <taekjin.lee@tier4.jp>\n\n* fix(association): ensure minimum covariance values to prevent large Mahalanobis distance\n\nSigned-off-by: Taekjin LEE <taekjin.lee@tier4.jp>\n\n* feat(tracker): disable trust in existence probability for input channels\n\nSigned-off-by: Taekjin LEE <taekjin.lee@tier4.jp>\n\n* fix(tracker): update decay rate for existence probability to reflect a 0.5s half-life\n\nSigned-off-by: Taekjin LEE <taekjin.lee@tier4.jp>\n\n* style(pre-commit): autofix\n\nSigned-off-by: Taekjin LEE <taekjin.lee@tier4.jp>\n\n* fix(association): correct spelling of \"mahalanobis\" in comment for clarity\n\nSigned-off-by: Taekjin LEE <taekjin.lee@tier4.jp>\n\n---------\n\nSigned-off-by: Taekjin LEE <taekjin.lee@tier4.jp>\nCo-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>","commit-date":"2025-08-04T07:38:26Z","current-rev":"47a0fb82f4","filename":"autoware_universe/perception/autoware_multi_object_tracker/lib/tracker/model/tracker_base.cpp","previous-rev":"70be106253","commit-title":"fix(autoware_multi_object_tracker): existence probability adjustment to mitigate tracker lost  (#11109)","language":"C++","id":"410ebd13723902158abcb4c2d1698bc1c3c4c442","model-score":0.54,"author-id":null,"project-id":29372,"delta-file-score":0.31179166,"diff":"diff --git a/perception/autoware_multi_object_tracker/lib/tracker/model/tracker_base.cpp b/perception/autoware_multi_object_tracker/lib/tracker/model/tracker_base.cpp\nindex 094c9537a9..7c34b30b36 100644\n--- a/perception/autoware_multi_object_tracker/lib/tracker/model/tracker_base.cpp\n+++ b/perception/autoware_multi_object_tracker/lib/tracker/model/tracker_base.cpp\n@@ -46,3 +46,3 @@ float decayProbability(const float & prior, const float & delta_time)\n   constexpr float minimum_probability = 0.001;\n-  const float decay_rate = log(0.5f) / 0.3f;  // half-life (50% decay) of 0.3s\n+  const float decay_rate = log(0.5f) / 0.5f;  // half-life (50% decay) of 0.5s\n   return std::max(prior * std::exp(decay_rate * delta_time), minimum_probability);\n@@ -135,7 +135,4 @@ bool Tracker::updateWithMeasurement(\n     // update total existence probability\n-    const double existence_probability = channel_info.trust_existence_probability\n-                                           ? object.existence_probability\n-                                           : types::default_existence_probability;\n     total_existence_probability_ = updateProbability(\n-      total_existence_probability_, existence_probability * probability_true_detection,\n+      total_existence_probability_, object.existence_probability * probability_true_detection,\n       probability_false_detection);\n@@ -195,3 +192,3 @@ bool Tracker::updateWithoutMeasurement(const rclcpp::Time & timestamp)\n void Tracker::updateClassification(\n-  const std::vector<autoware_perception_msgs::msg::ObjectClassification> & classification)\n+  const std::vector<autoware_perception_msgs::msg::ObjectClassification> & input)\n {\n@@ -223,6 +220,6 @@ void Tracker::updateClassification(\n   // Normalize the input\n-  auto classification_input = classification;\n+  auto classification_input = input;\n   normalizeProbabilities(classification_input);\n \n-  auto & classification_ = object_.classification;\n+  auto & classification = object_.classification;\n \n@@ -231,3 +228,3 @@ void Tracker::updateClassification(\n     bool found = false;\n-    for (auto & old_class : classification_) {\n+    for (auto & old_class : classification) {\n       if (new_class.label == old_class.label) {\n@@ -242,3 +239,3 @@ void Tracker::updateClassification(\n       adding_class.probability *= gain;\n-      classification_.push_back(adding_class);\n+      classification.push_back(adding_class);\n     }\n@@ -247,10 +244,10 @@ void Tracker::updateClassification(\n   // If the probability is less than the threshold, remove the class\n-  classification_.erase(\n+  classification.erase(\n     std::remove_if(\n-      classification_.begin(), classification_.end(),\n+      classification.begin(), classification.end(),\n       [remove_threshold](const auto & a_class) { return a_class.probability < remove_threshold; }),\n-    classification_.end());\n+    classification.end());\n \n   // Normalize tracking classification\n-  normalizeProbabilities(classification_);\n+  normalizeProbabilities(classification);\n }\n","improvement-type":"Complex Method"}],"change-level":"warning","is-hotspot?":false,"line":135,"what-changed":"Tracker::updateWithMeasurement increases in cyclomatic complexity from 13 to 14, threshold = 9","how-to-fix":"There are many reasons for Complex Method. Sometimes, another design approach is beneficial such as a) modeling state using an explicit state machine rather than conditionals, or b) using table lookup rather than long chains of logic. In other scenarios, the function can be split using [EXTRACT FUNCTION](https://refactoring.com/catalog/extractFunction.html). Just make sure you extract natural and cohesive functions. Complex Methods can also be addressed by identifying complex conditional expressions and then using the [DECOMPOSE CONDITIONAL](https://refactoring.com/catalog/decomposeConditional.html) refactoring.","change-type":"degraded"}]},"positive-impact-count":3,"repo":"autoware_universe","code-health":8.591171844228727,"version":"3.0","authors":["Taekjin LEE"],"directives":{"added":[],"removed":[]},"positive-findings":{"number-of-types":3,"number-of-files-touched":3,"findings":[{"name":"Overall Code Complexity","file":"perception/autoware_multi_object_tracker/lib/association/bev_association.cpp","change-type":"improved","change-level":"improvement","is-hotspot?":false,"why-it-occurs":"Overall Code Complexity is measured by the mean cyclomatic complexity across all functions in the file. The lower the number, the better.\n\nCyclomatic complexity is a function level metric that measures the number of logical branches (if-else, loops, etc.). Cyclomatic complexity is a rough complexity measure, but useful as a way of estimating the minimum number of unit tests you would need. As such, prefer functions with low cyclomatic complexity (2-3 branches).","how-to-fix":"You address the overall cyclomatic complexity by a) modularizing the code, and b) abstract away the complexity. Let's look at some examples:\n\nModularizing the Code: Do an X-Ray and inspect the local hotspots. Are there any complex conditional expressions? If yes, then do a [DECOMPOSE CONDITIONAL](https://refactoring.com/catalog/decomposeConditional.html) refactoring. Extract the conditional logic into a separate function and put a good name on that function. This clarifies the intent and makes the original function easier to read. Repeat until all complex conditional expressions have been simplified.\n\n","what-changed":"The mean cyclomatic complexity decreases from 4.18 to 4.09, threshold = 4"},{"method":"calculateBevAssignmentScore","why-it-occurs":"Functions with many arguments indicate either a) low cohesion where the function has too many responsibilities, or b) a missing abstraction that encapsulates those arguments.\n\nThe threshold for the C++ language is 4 function arguments.","name":"Excess Number of Function Arguments","file":"perception/autoware_multi_object_tracker/lib/association/scoring/bev_assignment_scoring.cpp","change-level":"improvement","is-hotspot?":false,"line":34,"what-changed":"calculateBevAssignmentScore decreases from 9 to 8 arguments, max arguments = 4","how-to-fix":"Start by investigating the responsibilities of the function. Make sure it doesn't do too many things, in which case it should be split into smaller and more cohesive functions. Consider the refactoring [INTRODUCE PARAMETER OBJECT](https://refactoring.com/catalog/introduceParameterObject.html) to encapsulate arguments that refer to the same logical concept.","change-type":"improved"},{"method":"convertConvexHullToBoundingBox","why-it-occurs":"A Complex Method has a high cyclomatic complexity. The recommended threshold for the C++ language is a cyclomatic complexity lower than 9.","name":"Complex Method","file":"perception/autoware_multi_object_tracker/lib/object_model/shapes.cpp","change-level":"improvement","is-hotspot?":false,"line":188,"what-changed":"convertConvexHullToBoundingBox is no longer above the threshold for cyclomatic complexity","how-to-fix":"There are many reasons for Complex Method. Sometimes, another design approach is beneficial such as a) modeling state using an explicit state machine rather than conditionals, or b) using table lookup rather than long chains of logic. In other scenarios, the function can be split using [EXTRACT FUNCTION](https://refactoring.com/catalog/extractFunction.html). Just make sure you extract natural and cohesive functions. Complex Methods can also be addressed by identifying complex conditional expressions and then using the [DECOMPOSE CONDITIONAL](https://refactoring.com/catalog/decomposeConditional.html) refactoring.","change-type":"fixed"}]},"notices":{"number-of-types":0,"number-of-files-touched":0,"findings":[]},"external-review-provider":"GitHub"},"analysistime":"2026-05-08T08:02:44.000Z","project-name":"autoware.universe","repository":"https://github.com/autowarefoundation/autoware_universe.git"}}