Showing 57 of 287 total issues
Function checkIntersectTriangle
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Confirmed
function checkIntersectTriangle(cullType, param, ray) {
var direction = ray[/* direction */1];
var vc = param[2];
var vb = param[1];
var va = param[0];
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function getRelatedMaterialDataFromGameObject
has 7 arguments (exceeds 4 allowed). Consider refactoring. Confirmed
function getRelatedMaterialDataFromGameObject(gameObject, replacedTargetMaterialMap, imageUint8ArrayDataMap, param, param$1, isLightMaterialDataEqualFunc, engineState) {
Function make
has 7 arguments (exceeds 4 allowed). Consider refactoring. Confirmed
function make(dragDropFunc, label, defaultValue, changeComponentValueFunc, blurValueFunc, title, _children) {
Avoid deeply nested control flow statements. Confirmed
if (match$4) {
return /* Fail */Block.__(1, ["target node shouldn't has the child with the same name of the source node"]);
} else {
return /* Success */Block.__(0, [/* () */0]);
}
Function make
has 6 arguments (exceeds 4 allowed). Consider refactoring. Confirmed
function make(label, title, getColorFunc, changeColorFunc, closeColorPickFunc, _children) {
Function buildDebugMessage
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Confirmed
function buildDebugMessage(description, params, param) {
var message = "";
var match = description.length > 0 && params.length === 0;
if (match) {
return message + description;
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function _find
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Confirmed
function _find(_gameObject, _rootGameObject, currentSceneTreeNodeOpt, engineState) {
while(true) {
var rootGameObject = _rootGameObject;
var gameObject = _gameObject;
var match = HierarchyGameObjectEngineService$WonderEditor.getParentGameObject(gameObject, engineState);
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function buildSceneTreeArray
has 5 arguments (exceeds 4 allowed). Consider refactoring. Confirmed
function buildSceneTreeArray(param, currentSceneTreeNode, param$1, param$2, sceneGraphArr) {
Function _addExtractedTextureAssetData
has 5 arguments (exceeds 4 allowed). Consider refactoring. Confirmed
function _addExtractedTextureAssetData(sourceTexture, replacedTargetTextureMap, imageUint8ArrayDataMap, param, param$1) {
Function _mergeTreeByFolderNodeName
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Confirmed
function _mergeTreeByFolderNodeName(isNodeEqualByName, tree1, onlyFolderNodeTree) {
var _folderNodeFunc = function (param, nodeId, nodeData, children) {
var newTree = param[1];
var parentFolderNodeInNewTree = param[0];
if (parentFolderNodeInNewTree !== undefined) {
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function getMaterialTypeByGameObject
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Confirmed
function getMaterialTypeByGameObject(gameObject, engineState) {
var match = GameObjectComponentEngineService$WonderEditor.hasBasicMaterialComponent(gameObject, engineState);
var match$1 = GameObjectComponentEngineService$WonderEditor.hasLightMaterialComponent(gameObject, engineState);
var exit = 0;
if (match) {
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function getLightTypeByGameObject
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Confirmed
function getLightTypeByGameObject(gameObject, engineState) {
var match = GameObjectComponentEngineService$WonderEditor.hasDirectionLightComponent(gameObject, engineState);
var match$1 = GameObjectComponentEngineService$WonderEditor.hasPointLightComponent(gameObject, engineState);
var exit = 0;
if (match) {
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Avoid too many return
statements within this function. Confirmed
return /* Success */Block.__(0, [/* () */0]);
Avoid too many return
statements within this function. Confirmed
return _at(qdn / ddn$1, ray);
Avoid too many return
statements within this function. Confirmed
return /* tuple */[
engineState,
$$event
];
Function isIntersectSphere
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Confirmed
function isIntersectSphere(param, ray) {
var radius = param[/* radius */0];
var v1 = Vector3Service$Wonderjs.sub(/* Float */0, ray[/* origin */0], param[/* center */1]);
var b = Vector3Service$WonderEditor.dot(ray[/* direction */1], v1);
var c = Vector3Service$WonderEditor.dot(v1, v1) - radius * radius;
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function _checkIntersectTriangleForFrontCull
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Confirmed
function _checkIntersectTriangleForFrontCull(param, param$1, param$2) {
var direction = param$2[/* direction */1];
var origin = param$2[/* origin */0];
var inv_det = 1 / param[0];
var tvec = Vector3Service$Wonderjs.sub(/* Float */0, origin, param$1[0]);
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"