Wonder-Technology/Wonder-Editor

View on GitHub

Showing 57 of 287 total issues

File ExtractAndRelateAssetsUtils.js has 508 lines of code (exceeds 250 allowed). Consider refactoring.
Confirmed



import * as Curry from "../../../../../../../../../../../../../../../node_modules/bs-platform/lib/es6/curry.js";
import * as Caml_option from "../../../../../../../../../../../../../../../node_modules/bs-platform/lib/es6/caml_option.js";
import * as ImageUtils$WonderEditor from "../../../../../../../../../../header/utils/ImageUtils.js";

    File IterateTreeAssetService.js has 406 lines of code (exceeds 250 allowed). Consider refactoring.
    Confirmed

    
    
    import * as List from "../../../../../../../node_modules/bs-platform/lib/es6/list.js";
    import * as Block from "../../../../../../../node_modules/bs-platform/lib/es6/block.js";
    import * as Curry from "../../../../../../../node_modules/bs-platform/lib/es6/curry.js";

      Function extractAndRelateAssets has 95 lines of code (exceeds 25 allowed). Consider refactoring.
      Confirmed

      function extractAndRelateAssets(allGameObjects, imageUint8ArrayDataMap, param) {
        var engineState = param[1];
        var editorState = param[0];
        var match = _prepareData(editorState, engineState);
        var match$1 = match[6];

        Function buildComponentUIComponent has 84 lines of code (exceeds 25 allowed). Consider refactoring.
        Confirmed

        function buildComponentUIComponent(param, type_, gameObject, languageType) {
          var dispatchFunc = param[1];
          var uiState = param[0];
          switch (type_) {
            case 0 : 

          Function _checkIntersectTriangleForBackAndNoneCull has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
          Confirmed

          function _checkIntersectTriangleForBackAndNoneCull(cullType, param, ray) {
            var direction = ray[/* direction */1];
            var va = param[0];
            var edge1 = Vector3Service$Wonderjs.sub(/* Float */0, param[1], va);
            var edge2 = Vector3Service$Wonderjs.sub(/* Float */0, param[2], va);

          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 _checkIntersectTriangleForBackAndNoneCull has 71 lines of code (exceeds 25 allowed). Consider refactoring.
          Confirmed

          function _checkIntersectTriangleForBackAndNoneCull(cullType, param, ray) {
            var direction = ray[/* direction */1];
            var va = param[0];
            var edge1 = Vector3Service$Wonderjs.sub(/* Float */0, param[1], va);
            var edge2 = Vector3Service$Wonderjs.sub(/* Float */0, param[2], va);

            Function checkNodeRelation has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
            Confirmed

            function checkNodeRelation(sourceNodeId, targetNodeId, param) {
              var editorState = param[0];
              var sourceNode = OperateTreeAssetEditorService$WonderEditor.unsafeFindNodeById(sourceNodeId, editorState);
              var targetNode = OperateTreeAssetEditorService$WonderEditor.unsafeFindNodeById(targetNodeId, editorState);
              var match = !FolderNodeAssetService$WonderEditor.isFolderNode(targetNode);

            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

            File SceneTreeNode.js has 275 lines of code (exceeds 250 allowed). Consider refactoring.
            Confirmed

            
            
            import * as Block from "../../../../../../../../node_modules/bs-platform/lib/es6/block.js";
            import * as Curry from "../../../../../../../../node_modules/bs-platform/lib/es6/curry.js";
            import * as React from "react";

              Function isIntersectAABB has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
              Confirmed

              function isIntersectAABB(param, ray) {
                var max = param[/* max */1];
                var maxZ = max[2];
                var maxY = max[1];
                var maxX = max[0];

              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

              File MainEditorMaterialMap.js has 265 lines of code (exceeds 250 allowed). Consider refactoring.
              Confirmed

              
              
              import * as Block from "../../../../../../../../../../../../../../node_modules/bs-platform/lib/es6/block.js";
              import * as Curry from "../../../../../../../../../../../../../../node_modules/bs-platform/lib/es6/curry.js";
              import * as React from "react";

                File FloatInput.js has 254 lines of code (exceeds 250 allowed). Consider refactoring.
                Confirmed

                
                
                import * as Block from "../../../../../../node_modules/bs-platform/lib/es6/block.js";
                import * as Curry from "../../../../../../node_modules/bs-platform/lib/es6/curry.js";
                import * as React from "react";
                Severity: Minor
                Found in lib/es6_global/src/core/atom_component/floatInput/FloatInput.js - About 2 hrs to fix

                  Function isIntersectAABB has 47 lines of code (exceeds 25 allowed). Consider refactoring.
                  Confirmed

                  function isIntersectAABB(param, ray) {
                    var max = param[/* max */1];
                    var maxZ = max[2];
                    var maxY = max[1];
                    var maxX = max[0];

                    Function generateASB has 43 lines of code (exceeds 25 allowed). Consider refactoring.
                    Confirmed

                    function generateASB(imageUint8ArrayMap, param) {
                      var match = HeaderBuildJsonDataUtils$WonderEditor.buildJsonData(imageUint8ArrayMap, /* tuple */[
                            param[0],
                            param[1]
                          ]);

                      Function handleFileByTypeAsync has 43 lines of code (exceeds 25 allowed). Consider refactoring.
                      Confirmed

                      function handleFileByTypeAsync(fileResult, createJsZipFunc) {
                        var match = StateLogicService$WonderEditor.getEditorState(IdAssetEditorService$WonderEditor.generateNodeId);
                        var assetNodeId = match[1];
                        var editorState = match[0];
                        var engineState = StateEngineService$WonderEditor.unsafeGetState(/* () */0);

                        Function removeComponentByType has 41 lines of code (exceeds 25 allowed). Consider refactoring.
                        Confirmed

                        function removeComponentByType(type_, currentSceneTreeNode, param) {
                          var engineState = param[1];
                          var editorState = param[0];
                          var exit = 0;
                          switch (type_) {

                          Function addComponentByType has 41 lines of code (exceeds 25 allowed). Consider refactoring.
                          Confirmed

                          function addComponentByType(type_, currentSceneTreeNode, param) {
                            var engineState = param[1];
                            var editorState = param[0];
                            var exit = 0;
                            switch (type_) {

                            Function _import has 40 lines of code (exceeds 25 allowed). Consider refactoring.
                            Confirmed

                            function _import(result) {
                              _disposeAssets(/* () */0);
                              StateEngineService$WonderEditor.setState(ReallocateCPUMemoryJob$WonderEditor.reallocate(0.1, JobEngineService$WonderEditor.execDisposeJob(StateEngineService$WonderEditor.unsafeGetState(/* () */0))));
                              _initAssetTreeRoot(/* () */0);
                              StateLogicService$WonderEditor.getAndSetEditorState(PickingEditorService$WonderEditor.clearSphereShape);

                              Function _handleSelectAxisGizmo has 40 lines of code (exceeds 25 allowed). Consider refactoring.
                              Confirmed

                              function _handleSelectAxisGizmo(ray, editorState, engineState) {
                                var match = isSelectTranslationAxisGizmo(OperateTranslationGizmoSceneViewEditorService$WonderEditor.unsafeGetTranslationXAxisGizmo(editorState), ray, engineState, editorState);
                                if (match) {
                                  var partial_arg = GameObjectEngineService$WonderEditor.getAllBasicMaterials(HierarchyGameObjectEngineService$WonderEditor.getAllGameObjects(OperateTranslationGizmoSceneViewEditorService$WonderEditor.unsafeGetTranslationXAxisGizmo(editorState), engineState), engineState);
                                  return _selectAxisGizmo(ray, /* tuple */[

                                Function _bindDragStartEvent has 39 lines of code (exceeds 25 allowed). Consider refactoring.
                                Confirmed

                                function _bindDragStartEvent(engineState) {
                                  return ManageEventEngineService$WonderEditor.onCustomGlobalEvent(SceneViewEventEditorService$WonderEditor.getPointDragStartEventName(/* () */0), (function ($$event, engineState) {
                                                var match = MouseEventService$WonderEditor.isLeftMouseButton($$event);
                                                if (match) {
                                                  var editorState = StateEditorService$WonderEditor.getState(/* () */0);

                                  Function render has 38 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Confirmed

                                  function render(param, currentSceneTreeNode, self) {
                                    var send = self[/* send */3];
                                    var state = self[/* state */1];
                                    var dispatchFunc = param[1];
                                    var uiState = param[0];
                                    Severity
                                    Category
                                    Status
                                    Source
                                    Language