Showing 57 of 287 total issues
Function reducer
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Confirmed
function reducer(param, param$1, action, state) {
var dragDropFunc = param$1[2];
var blurEventFunc = param$1[1];
var gameObjectComponent = param$1[0];
var dispatchFunc = param[1];
Function checkIntersectTriangle
has 37 lines of code (exceeds 25 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];
Function _extractAndRelateTextureAssets
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Confirmed
function _extractAndRelateTextureAssets(gameObject, imageUint8ArrayDataMap, param, param$1) {
var engineState = param$1[1];
var editorState = param$1[0];
var extractedTextureAssetDataArr = param[2];
var hasExtractedTextureAssetMap = param[1];
Function _buildMessage
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Confirmed
function _buildMessage(description, reason, solution, params) {
var message = "";
var match = description.length > 0 && reason.length === 0 && solution.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 render
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Confirmed
function render(param, self) {
var send = self[/* send */3];
var dispatchFunc = param[1];
var uiState = param[0];
var languageType = StateLogicService$WonderEditor.getEditorState(LanguageEditorService$WonderEditor.unsafeGetType);
Function _bindDragOverEvent
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Confirmed
function _bindDragOverEvent(engineState) {
return ManageEventEngineService$WonderEditor.onCustomGlobalEvent(SceneViewEventEditorService$WonderEditor.getPointDragOverEventName(/* () */0), (function ($$event, engineState) {
var match = MouseEventService$WonderEditor.isLeftMouseButton($$event);
if (match) {
var editorState = StateEditorService$WonderEditor.getState(/* () */0);
Function make
has 10 arguments (exceeds 4 allowed). Consider refactoring. Confirmed
function make(uiState, dispatchFunc, materialComponent, label, getMapFunc, onDropFunc, removeTextureFunc, isShowTextureGroup, title, _children) {
Function _bindDragGizmoDropEvent
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Confirmed
function _bindDragGizmoDropEvent(engineState) {
return ManageEventEngineService$WonderEditor.onCustomGlobalEvent(SceneViewEventEditorService$WonderEditor.getPointDragDropEventName(/* () */0), (function ($$event, engineState) {
var match = MouseEventService$WonderEditor.isLeftMouseButton($$event);
if (match) {
var editorState = StateEditorService$WonderEditor.getState(/* () */0);
Function getRelatedTextureData
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Confirmed
function getRelatedTextureData(gameObject, param, param$1, param$2) {
var engineState = param$2[1];
var replacedTargetTextureMap = param[0];
var material = Curry._2(param$1[0], gameObject, engineState);
var match = Curry._2(param$1[1], material, engineState);
Function _addExtractedTextureAssetData
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Confirmed
function _addExtractedTextureAssetData(sourceTexture, replacedTargetTextureMap, imageUint8ArrayDataMap, param, param$1) {
var engineState = param$1[1];
var extractedTextureAssetDataArr = param[1];
var hasExtractedTextureAssetMap = param[0];
var match;
Function _addExtractedMaterialAssetData
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Confirmed
function _addExtractedMaterialAssetData(param, replacedTargetMaterialMap, param$1, engineState) {
var extractedMaterialAssetDataArr = param$1[1];
var hasExtractedMaterialAssetMap = param$1[0];
var materialType = param[1];
var sourceMaterial = param[0];
Function _isGeometryDataEqualForSceneGameObjectGeometry
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Confirmed
function _isGeometryDataEqualForSceneGameObjectGeometry(param, param$1, engineState) {
var texCoords1 = param[3];
var normals1 = param[2];
var vertices1 = param[1];
Contract$WonderLog.requireCheck((function (param) {
Function generateWDBForWPK
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Confirmed
function generateWDBForWPK(sceneGameObject, imageUint8ArrayMap, engineState) {
return GenerateWDBSystem$Wonderjs.generateWDB(sceneGameObject, OptionService$WonderEditor.unsafeGet((imageUint8ArrayMap == null) ? undefined : Caml_option.some(imageUint8ArrayMap)), /* tuple */[
/* tuple */[
(function (geometry, engineState) {
var length = _gePointstLength(geometry, engineState, VerticesGeometryMainService$Wonderjs.getVertices);
Function _addTextureNodeToAssetTree
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Confirmed
function _addTextureNodeToAssetTree(extractedTextureAssetDataArr, selectedFolderNodeInAssetTree, param) {
var engineState = param[1];
var editorState = param[0];
var match = extractedTextureAssetDataArr.length === 0;
if (match) {
Function _extractAndRelateMaterialAssets
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Confirmed
function _extractAndRelateMaterialAssets(gameObject, param, param$1, engineState) {
var extractedMaterialAssetDataArr = param[2];
var hasExtractedMaterialAssetMap = param[1];
var match = RelateGameObjectAndMaterialAssetUtils$WonderEditor.getRelatedMaterialDataFromGameObject(gameObject, param[0], param$1[0], param$1[1], param$1[2], _isLightMaterialDataEqual, engineState);
var replacedTargetMaterialMap = match[3];
Function _folderNodeFunc
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Confirmed
function _folderNodeFunc(param, parentFolderNode, param$1, nodeId, nodeData, children) {
var engineState = param$1[2];
var tree = param$1[1];
var result = param$1[0];
var name = param[1];
Function dragWDB
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Confirmed
function dragWDB(wdbGameObject, targetGameObject, dragPosition, param) {
var editorState = param[0];
var match = _checkLightCount(wdbGameObject, /* tuple */[
editorState,
param[1]
Function isUint8ArrayEqual
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Confirmed
function isUint8ArrayEqual(uint8Array1, uint8Array2) {
if (uint8Array1 !== undefined) {
if (uint8Array2 !== undefined) {
var uint8Array2$1 = Caml_option.valFromOption(uint8Array2);
var uint8Array1$1 = Caml_option.valFromOption(uint8Array1);
- 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 _isGeometryDataEqualForSceneGameObjectGeometry
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Confirmed
function _isGeometryDataEqualForSceneGameObjectGeometry(param, param$1, engineState) {
var texCoords1 = param[3];
var normals1 = param[2];
var vertices1 = param[1];
Contract$WonderLog.requireCheck((function (param) {
- 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 _computePlaneLocalPosition
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Confirmed
function _computePlaneLocalPosition(editorState, engineState) {
var cameraPosInWholeGizmoLocalCoordSystem = _computeCameraPosInWholeGizmoLocalCoordSystem(editorState, engineState);
if (_isInPXPYPZ(cameraPosInWholeGizmoLocalCoordSystem)) {
return /* tuple */[
/* tuple */[
- 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"