{"results":{"result":{"added-files":{"code-health":9.6882083290695,"old-code-health":0.0,"files":[{"file":"jsonschema-module-jackson/src/main/java/com/github/victools/jsonschema/module/jackson/JacksonSchemaModule.java","loc":213,"code-health":9.6882083290695}]},"external-review-url":"https://github.com/victools/jsonschema-generator/pull/561","old-code-health":9.744653372944848,"modified-files":{"code-health":9.759836145364343,"old-code-health":9.744653372944848,"files":[{"file":"jsonschema-maven-plugin/src/main/java/com/github/victools/jsonschema/plugin/maven/SchemaGeneratorMojo.java","loc":343,"old-loc":343,"code-health":9.6882083290695,"old-code-health":9.6882083290695},{"file":"jsonschema-module-jackson/src/main/java/com/github/victools/jsonschema/module/jackson/CustomEnumDefinitionProvider.java","loc":98,"old-loc":98,"code-health":9.6882083290695,"old-code-health":9.6882083290695},{"file":"jsonschema-module-jackson/src/main/java/com/github/victools/jsonschema/module/jackson/JacksonModule.java","loc":10,"old-loc":213,"code-health":10.0,"old-code-health":9.6882083290695},{"file":"jsonschema-module-jackson/src/main/java/com/github/victools/jsonschema/module/jackson/JsonIdentityReferenceDefinitionProvider.java","loc":76,"old-loc":75,"code-health":10.0,"old-code-health":10.0},{"file":"jsonschema-module-jackson/src/main/java/com/github/victools/jsonschema/module/jackson/JsonPropertySorter.java","loc":66,"old-loc":66,"code-health":10.0,"old-code-health":10.0},{"file":"jsonschema-module-jackson/src/main/java/com/github/victools/jsonschema/module/jackson/JsonSubTypesResolver.java","loc":300,"old-loc":296,"code-health":9.6882083290695,"old-code-health":9.6882083290695},{"file":"jsonschema-module-jackson/src/main/java/com/github/victools/jsonschema/module/jackson/JsonUnwrappedDefinitionProvider.java","loc":69,"old-loc":69,"code-health":10.0,"old-code-health":10.0}]},"removed-files":{"code-health":0.0,"old-code-health":0.0,"files":[]},"external-review-id":"561","analysis-time":"2026-01-13T12:09:29Z","negative-impact-count":1,"suppressions":{"number-of-types":0,"number-of-files-touched":0,"findings":[]},"affected-hotspots":3,"commits":["7beaac55287afaa3774c90ab1d86e92f3aa40233"],"is-negative-review":true,"negative-findings":{"number-of-types":1,"number-of-files-touched":1,"findings":[{"method":"getPropertyNameOverrideBasedOnJsonPropertyAnnotation","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":"jsonschema-module-jackson/src/main/java/com/github/victools/jsonschema/module/jackson/JacksonSchemaModule.java","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":"java","improvement-type":"Complex Conditional"}],"change-level":"warning","is-hotspot?":false,"line":215,"what-changed":"getPropertyNameOverrideBasedOnJsonPropertyAnnotation 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"}]},"positive-impact-count":1,"repo":"jsonschema-generator","code-health":9.746851698665788,"version":"3.0","authors":["Filip Hrisafov"],"directives":{"added":[],"removed":[]},"positive-findings":{"number-of-types":1,"number-of-files-touched":1,"findings":[{"method":"getPropertyNameOverrideBasedOnJsonPropertyAnnotation","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":"jsonschema-module-jackson/src/main/java/com/github/victools/jsonschema/module/jackson/JacksonModule.java","change-level":"improvement","is-hotspot?":true,"line":215,"what-changed":"getPropertyNameOverrideBasedOnJsonPropertyAnnotation no longer has a complex conditional","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":"fixed"}]},"notices":{"number-of-types":0,"number-of-files-touched":0,"findings":[]},"external-review-provider":"GitHub"},"analysistime":"2026-01-13T12:09:29.000Z","project-name":"jsonschema-generator","repository":"https://github.com/victools/jsonschema-generator.git"}}