sicambria/skilltree

View on GitHub

Showing 240 of 537 total issues

Function editMyTree has a Cognitive Complexity of 39 (exceeds 5 allowed). Consider refactoring.
Open

function editMyTree () {
    hideAll();

    var treeName = document.getElementById("treeName");
    treeName.setAttribute('list', 'TreeSearchResult');
Severity: Minor
Found in new design/draft_create_skill_modal_design/user/chartandtree.js - About 5 hrs to fix

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 toggleSkillDetailsPage has 140 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    toggleSkillDetailsPage(){
        var modal = document.getElementById('skillpage');
        var header = document.getElementById('skillnameHeader');
        var span = document.getElementById("closeORModal");
        var globalskill = undefined;
Severity: Major
Found in public/user/classes/itemcontainer.js - About 5 hrs to fix

    Function editTree has a Cognitive Complexity of 33 (exceeds 5 allowed). Consider refactoring.
    Open

    function editTree () {
        hideAll();
    
        var treeName = document.getElementById("treeName");
        treeName.setAttribute('list', 'TreeSearchResult');
    Severity: Minor
    Found in new design/draft_create_skill_modal_design/user/chartandtree.js - About 4 hrs to fix

    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 editTree has 112 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    function editTree () {
        hideAll();
    
        var treeName = document.getElementById("treeName");
        treeName.setAttribute('list', 'TreeSearchResult');
    Severity: Major
    Found in new design/draft_create_skill_modal_design/user/chartandtree.js - About 4 hrs to fix

      Function insertSkill has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring.
      Open

      async function insertSkill(skillToInsert, skillMatrix) {
          for (var component = 0; component < skillMatrix.length; component++) {
              for (var child = 0; child < skillToInsert.children.length; child++) {
                  for (var row = 0; row < skillMatrix[component].length; row++) {
                      if ((skillMatrix[component][row].map(obj => obj.name)).includes(skillToInsert.children[child].name)) {
      Severity: Minor
      Found in app.js - About 4 hrs to fix

      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 editMyTree has 109 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      function editMyTree () {
          hideAll();
      
          var treeName = document.getElementById("treeName");
          treeName.setAttribute('list', 'TreeSearchResult');
      Severity: Major
      Found in new design/draft_create_skill_modal_design/user/chartandtree.js - About 4 hrs to fix

        Function Group has 108 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            var Group = (function (_super) {
                __extends(Group, _super);
                function Group(zIndex, sorting) {
                    var _this = _super.call(this) || this;
                    _this._activeLayer = null;
        Severity: Major
        Found in new design/draft_create_skill_modal_design/user/pixi/pixi-layers.js - About 4 hrs to fix

          Function Group has 108 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              var Group = (function (_super) {
                  __extends(Group, _super);
                  function Group(zIndex, sorting) {
                      var _this = _super.call(this) || this;
                      _this._activeLayer = null;
          Severity: Major
          Found in new design/draft_offers_modal_design/user/pixi/pixi-layers.js - About 4 hrs to fix

            Function createTree has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring.
            Open

            function createTree () {
                hideAll();
            
                var treeName = document.getElementById("treeName");
                treeName.setAttribute('list', '');
            Severity: Minor
            Found in new design/draft_create_skill_modal_design/user/chartandtree.js - About 4 hrs to fix

            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 onreadystatechange has 101 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                            offerHttpRequest.onreadystatechange = function() {
                                if(offerHttpRequest.readyState == 4 && offerHttpRequest.status == 200) {
                                    if (offerHttpRequest.response !== undefined) {
                                        //Got the offer data, fill the offers table
            
            

              Function onreadystatechange has 101 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                              offerHttpRequest.onreadystatechange = function() {
                                  if(offerHttpRequest.readyState == 4 && offerHttpRequest.status == 200) {
                                      if (offerHttpRequest.response !== undefined) {
                                          //Got the offer data, fill the offers table
              
              
              Severity: Major
              Found in new design/draft_offers_modal_design/user/classes/itemcontainer.js - About 4 hrs to fix

                Function onreadystatechange has 99 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                        offerHttpRequest.onreadystatechange = function() {
                          if(offerHttpRequest.readyState == 4 && offerHttpRequest.status == 200) {
                            if (offerHttpRequest.response !== undefined) {
                              //Got the offer data, fill the offers table
                
                
                Severity: Major
                Found in public/user/classes/itemcontainer.js - About 3 hrs to fix

                  Function Stage has 99 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      var Stage = (function (_super) {
                          __extends(Stage, _super);
                          function Stage() {
                              var _this = _super.call(this) || this;
                              _this.isStage = true;
                  Severity: Major
                  Found in new design/draft_create_skill_modal_design/user/pixi/pixi-layers.js - About 3 hrs to fix

                    Function Stage has 99 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        var Stage = (function (_super) {
                            __extends(Stage, _super);
                            function Stage() {
                                var _this = _super.call(this) || this;
                                _this.isStage = true;
                    Severity: Major
                    Found in new design/draft_offers_modal_design/user/pixi/pixi-layers.js - About 3 hrs to fix

                      Function createTree has 95 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                      function createTree () {
                          hideAll();
                      
                          var treeName = document.getElementById("treeName");
                          treeName.setAttribute('list', '');
                      Severity: Major
                      Found in new design/draft_create_skill_modal_design/user/chartandtree.js - About 3 hrs to fix

                        Function editSkill has 93 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                        function editSkill () {
                            document.getElementById('newSkillForm').reset();
                        
                            var modal = document.getElementById("newSkillModal");
                            modal.style.display = "block";
                        Severity: Major
                        Found in public/user/chartandtree.js - About 3 hrs to fix

                          Function editSkill has 93 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                          function editSkill () {
                              document.getElementById('newSkillForm').reset();
                          
                              var modal = document.getElementById("newSkillModal");
                              modal.style.display = "block";
                          Severity: Major
                          Found in new design/draft_offers_modal_design/user/chartandtree.js - About 3 hrs to fix

                            Function editMySkill has 92 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                            function editMySkill () {
                                document.getElementById('newSkillForm').reset();
                            
                                var modal = document.getElementById("newSkillModal");
                                modal.style.display = "block";
                            Severity: Major
                            Found in public/user/chartandtree.js - About 3 hrs to fix

                              Function editMySkill has 92 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                              function editMySkill () {
                                  document.getElementById('newSkillForm').reset();
                              
                                  var modal = document.getElementById("newSkillModal");
                                  modal.style.display = "block";
                              Severity: Major
                              Found in new design/draft_offers_modal_design/user/chartandtree.js - About 3 hrs to fix

                                Function onClick has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring.
                                Open

                                    onClick(event) {
                                        if (!event.drag) {
                                            if (this.parentObj.self) {
                                                var children = this.parentObj.skill.children;
                                
                                
                                Severity: Minor
                                Found in public/user/classes/itemcontainer.js - About 3 hrs to fix

                                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

                                Severity
                                Category
                                Status
                                Source
                                Language