{"results":{"result":{"added-files":{"code-health":0.0,"old-code-health":0.0,"files":[]},"external-review-url":"https://github.com/autowarefoundation/autoware_universe/pull/11962","old-code-health":8.690694510197023,"modified-files":{"code-health":8.517364394025195,"old-code-health":8.690694510197023,"files":[{"file":"planning/motion_velocity_planner/autoware_motion_velocity_run_out_module/src/objects_filtering.cpp","loc":320,"old-loc":275,"code-health":7.9087644186687704,"old-code-health":8.113929864182499},{"file":"planning/motion_velocity_planner/autoware_motion_velocity_run_out_module/src/run_out_module.cpp","loc":213,"old-loc":211,"code-health":9.43169299549964,"old-code-health":9.442401987230168}]},"removed-files":{"code-health":0.0,"old-code-health":0.0,"files":[]},"external-review-id":"11962","analysis-time":"2026-01-23T02:11:51Z","negative-impact-count":2,"suppressions":{"number-of-types":0,"number-of-files-touched":0,"findings":[]},"affected-hotspots":0,"commits":["62d4db7d06b5423d2ca2e835463fae8ef3744f41"],"is-negative-review":true,"negative-findings":{"number-of-types":2,"number-of-files-touched":2,"findings":[{"method":"skip_object_condition","why-it-occurs":"A complex conditional is an expression inside a branch such as an <code>if</code>-statmeent which consists of multiple, logical operations. Example: <code>if (x.started() && y.running())</code>.Complex conditionals make the code even harder to read, and contribute to the Complex Method code smell. Encapsulate them.","name":"Complex Conditional","file":"planning/motion_velocity_planner/autoware_motion_velocity_run_out_module/src/objects_filtering.cpp","refactoring-examples":[{"diff":"diff --git a/complex_conditional.js b/complex_conditional.js\nindex c43da09584..94259ce874 100644\n--- a/complex_conditional.js\n+++ b/complex_conditional.js\n@@ -1,16 +1,34 @@\n function messageReceived(message, timeReceived) {\n-   // Ignore all messages which aren't from known customers:\n-   if (!message.sender &&\n-       customers.getId(message.name) == null) {\n+   // Refactoring #1: encapsulate the business rule in a\n+   // function. A clear name replaces the need for the comment:\n+   if (!knownCustomer(message)) {\n      log('spam received -- ignoring');\n      return;\n    }\n \n-  // Provide an auto-reply when outside business hours:\n-  if ((timeReceived.getHours() > 17) ||\n-      (timeReceived.getHours() < 8)) {\n+  // Refactoring #2: encapsulate the business rule.\n+  // Again, note how a clear function name replaces the\n+  // need for a code comment:\n+  if (outsideBusinessHours(timeReceived)) {\n     return autoReplyTo(message);\n   }\n \n   pingAgentFor(message);\n+}\n+\n+function outsideBusinessHours(timeReceived) {\n+  // Refactoring #3: replace magic numbers with\n+  // symbols that communicate with the code reader:\n+  const closingHour = 17;\n+  const openingHour = 8;\n+\n+  const hours = timeReceived.getHours();\n+\n+  // Refactoring #4: simple conditional rules can\n+  // be further clarified by introducing a variable:\n+  const afterClosing = hours > closingHour;\n+  const beforeOpening = hours < openingHour;\n+\n+  // Yeah -- look how clear the business rule is now!\n+  return afterClosing || beforeOpening;\n }\n\\ No newline at end of file\n","language":"c++","improvement-type":"Complex Conditional"}],"change-level":"warning","is-hotspot?":false,"line":107,"what-changed":"skip_object_condition has 1 complex conditionals with 2 branches, threshold = 2","how-to-fix":"Apply the [DECOMPOSE CONDITIONAL](https://refactoring.com/catalog/decomposeConditional.html) refactoring so that the complex conditional is encapsulated in a separate function with a good name that captures the business rule. Optionally, for simple expressions, introduce a new variable which holds the result of the complex conditional.","change-type":"introduced"},{"method":"RunOutModule::plan","why-it-occurs":"Overly long functions make the code harder to read. The recommended maximum function length for the C++ language is 70 lines of code. Severity: Brain Method - Complex Method - Long Method.","name":"Large Method","file":"planning/motion_velocity_planner/autoware_motion_velocity_run_out_module/src/run_out_module.cpp","refactoring-examples":null,"change-level":"warning","is-hotspot?":false,"line":165,"what-changed":"RunOutModule::plan increases from 73 to 75 lines of code, threshold = 70","how-to-fix":"We recommend to be careful here -- just splitting long functions don't necessarily make the code easier to read. Instead, look for natural chunks inside the functions that expresses a specific task or concern. Often, such concerns are indicated by a Code Comment followed by an if-statement. Use the [EXTRACT FUNCTION](https://refactoring.com/catalog/extractFunction.html) refactoring to encapsulate that concern.","change-type":"degraded"}]},"positive-impact-count":0,"repo":"autoware_universe","code-health":8.517364394025195,"version":"3.0","authors":["Maxime CLEMENT"],"directives":{"added":[],"removed":[]},"positive-findings":{"number-of-types":0,"number-of-files-touched":0,"findings":[]},"notices":{"number-of-types":0,"number-of-files-touched":0,"findings":[]},"external-review-provider":"GitHub"},"analysistime":"2026-01-23T02:11:50.000Z","project-name":"autoware.universe","repository":"https://github.com/autowarefoundation/autoware_universe.git"}}