{"results":{"result":{"added-files":{"code-health":0.0,"old-code-health":0.0,"files":[]},"external-review-url":"https://github.com/gama-platform/gama/pull/292","old-code-health":7.106711345609554,"modified-files":{"code-health":7.106711345609554,"old-code-health":7.106711345609554,"files":[{"file":"gama.core/src/gama/gaml/operators/Strings.java","loc":556,"old-loc":521,"code-health":7.106711345609554,"old-code-health":7.106711345609554}]},"removed-files":{"code-health":0.0,"old-code-health":0.0,"files":[]},"external-review-id":"292","analysis-time":"2024-08-23T15:39:04Z","negative-impact-count":0,"suppressions":{"number-of-types":0,"number-of-files-touched":0,"findings":[]},"affected-hotspots":0,"commits":["94d813faa1c51bff9d5e447262eb93a77591561d","30a9a8e6c2a70a2918cdbf10d3b9f23cc64ea99e"],"is-negative-review":false,"negative-findings":{"number-of-types":0,"number-of-files-touched":0,"findings":[]},"positive-impact-count":2,"repo":"gama","code-health":7.106711345609554,"version":"3.0","authors":["AlexisDrogoul"],"directives":{"added":[],"removed":[]},"positive-findings":{"number-of-types":2,"number-of-files-touched":1,"findings":[{"name":"Primitive Obsession","file":"gama.core/src/gama/gaml/operators/Strings.java","change-type":"improved","change-level":"improvement","is-hotspot?":false,"why-it-occurs":"Code that uses a high degree of built-in, primitives such as integers, strings, floats, lacks a domain language that encapsulates the validation and semantics of function arguments. Primitive Obsession has several consequences: 1) In a statically typed language, the compiler will detect less erroneous assignments. 2) Security impact since the possible value range of a variable/argument isn't retricted.\n\nIn this module, 80 % of all functions have primitive types as arguments.","how-to-fix":"Primitive Obsession indicates a missing domain language. Introduce data types that encapsulate the details and constraints of your domain. For example, instead of `int userId`, consider `User clicked`.","what-changed":"The ratio of primitive types in function arguments decreases from 85.19% to 79.66%, threshold = 30.0%"},{"name":"String Heavy Function Arguments","file":"gama.core/src/gama/gaml/operators/Strings.java","change-type":"improved","change-level":"improvement","is-hotspot?":false,"why-it-occurs":"String is a generic type that fail to capture the constraints of the domain object it represents. In this module, 68 % of all function arguments are string types.","how-to-fix":"Heavy string usage indicates a missing domain language. Introduce data types that encapsulate the semantics. For example, a user_name is better represented as a constrained User type rather than a pure string, which could be anything.","what-changed":"The ratio of strings in function arguments decreases from 72.22% to 67.80%, threshold = 39.0%"}]},"notices":{"number-of-types":0,"number-of-files-touched":0,"findings":[]},"external-review-provider":"GitHub"},"analysistime":"2024-08-23T15:39:03.000Z","project-name":"gama","repository":"https://github.com/gama-platform/gama.git"}}