sicambria/skilltree

View on GitHub

Showing 240 of 537 total issues

Function addSkillToList has 37 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function addSkillToList () {
    var skill = {value: document.getElementById('skillSearchTree').value};
    var skillList = document.getElementById("skillList");

    request('POST', '/protected/getskill', skill, function() {
Severity: Minor
Found in public/user/chartandtree.js - About 1 hr to fix

    Function 3 has 37 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        },{}],3:[function(require,module,exports){
        
        
        /**
         * GlowFilter, originally by mishaa

      Function addSkillToList has 37 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      function addSkillToList () {
          var skill = {value: document.getElementById('skillSearchTree').value};
          var skillList = document.getElementById("skillList");
      
          request('POST', '/protected/getskill', skill, function() {
      Severity: Minor
      Found in new design/draft_offers_modal_design/user/chartandtree.js - About 1 hr to fix

        Function switchSearch has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
        Open

        function switchSearch(type){
          document.getElementById('advSearchDetails').innerHTML = "";
          if (type === "Skill") {
            document.getElementById('cardSearchBar').onkeyup = function(){
              if (Array.from(document.getElementById('skillSearchResult').options).find(obj => obj.value == document.getElementById('cardSearchBar').value) == undefined){
        Severity: Minor
        Found in public/user/src/search.js - About 1 hr 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 switchSearch has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
        Open

        function switchSearch(type){
          document.getElementById('advSearchDetails').innerHTML = "";
          if (type === "Skill") {
            document.getElementById('cardSearchBar').onkeyup = function(){
              if (Array.from(document.getElementById('skillSearchResult').options).find(obj => obj.value == document.getElementById('cardSearchBar').value) == undefined){
        Severity: Minor
        Found in new design/draft_offers_modal_design/user/src/search.js - About 1 hr 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 constructor has 35 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            constructor(app, treeData, treeID, skillID) {
                this.app = app;
                this.treeData = treeData; // only this tree's data
                this.skillData = treeData.skills[skillID];
                this.skillData.treeID = treeID;

          Function constructor has 35 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              constructor(app, treeData, treeID, skillID) {
                  this.app = app;
                  this.treeData = treeData; // only this tree's data
                  this.skillData = treeData.skills[skillID];
                  this.skillData.treeID = treeID;

            Function onclick has 34 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                addBtn.onclick = function () {
                    var skill = {value: document.getElementById('skillSearchTree').value};
            
                    request('POST', '/protected/getskill', skill, function() {
                        if(this.readyState == 4 && this.status == 200) {
            Severity: Minor
            Found in new design/draft_create_skill_modal_design/user/chartandtree.js - About 1 hr to fix

              Function onclick has 34 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  addBtn.onclick = function () {
                      var skill = {value: document.getElementById('skillSearchTree').value};
              
                      request('POST', '/protected/getskill', skill, function() {
                          if(this.readyState == 4 && this.status == 200) {
              Severity: Minor
              Found in new design/draft_create_skill_modal_design/user/chartandtree.js - About 1 hr to fix

                Function onclick has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    addBtn.onclick = function () {
                        var skill = {value: document.getElementById('skillSearchTree').value};
                
                        request('POST', '/protected/getskill', skill, function() {
                            if(this.readyState == 4 && this.status == 200) {
                Severity: Minor
                Found in new design/draft_create_skill_modal_design/user/chartandtree.js - About 1 hr to fix

                  Function getPublicUserData has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  function getPublicUserData(){
                    var userToSearch = {value: document.getElementById('cardSearchBar').value};
                    document.getElementById("searchModalTitle").innerHTML = "Click on a user, to view his/her main tree!";
                    request('POST', '/protected/getPublicUserData', userToSearch, function() {
                        if(this.readyState == 4 && this.status == 200) {
                  Severity: Minor
                  Found in public/user/src/search.js - About 1 hr to fix

                    Function _addRecursive has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                            Stage.prototype._addRecursive = function (displayObject) {
                                if (!displayObject.visible) {
                                    return;
                                }
                                if (displayObject.isLayer) {
                    Severity: Minor
                    Found in new design/draft_create_skill_modal_design/user/pixi/pixi-layers.js - About 1 hr to fix

                      Function _addRecursive has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                              Stage.prototype._addRecursive = function (displayObject) {
                                  if (!displayObject.visible) {
                                      return;
                                  }
                                  if (displayObject.isLayer) {
                      Severity: Minor
                      Found in new design/draft_offers_modal_design/user/pixi/pixi-layers.js - About 1 hr to fix

                        Function getPublicUserData has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                        function getPublicUserData(){
                          var userToSearch = {value: document.getElementById('cardSearchBar').value};
                          document.getElementById("searchModalTitle").innerHTML = "Click on a user, to view his/her main tree!";
                          request('POST', '/protected/getPublicUserData', userToSearch, function() {
                              if(this.readyState == 4 && this.status == 200) {
                        Severity: Minor
                        Found in new design/draft_offers_modal_design/user/src/search.js - About 1 hr to fix

                          Function onclick has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                                    row.onclick = function(){
                                      var foundmodal = document.getElementById('searchedSkillModal');
                                      var header = document.getElementById('searchedSkillModalHeader');
                                      var category = document.getElementById('searchedSkillModalCategory');
                                      var pdesc = document.getElementById('searchedSkillModalPDesc');
                          Severity: Minor
                          Found in public/user/src/search.js - About 1 hr to fix

                            Function onclick has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                      row.onclick = function(){
                                        var searchedUserModal = document.getElementById('searchedUserModal');
                                        var closeSearchedUserModal = document.getElementById('closeSearchedUserModal');
                                        var searchedUserModalHeader = document.getElementById('searchedUserModalHeader');
                                        var searchedUserlModalInfo = document.getElementById('searchedUserlModalInfo');
                            Severity: Minor
                            Found in new design/draft_create_skill_modal_design/user/src/search.js - About 1 hr to fix

                              Function 2 has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                  },{}],2:[function(require,module,exports){
                                  
                                  
                                  /**
                                   * ColorReplaceFilter, originally by mishaa, updated by timetocode

                                Function 2 has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                    },{}],2:[function(require,module,exports){
                                    
                                    
                                    /**
                                     * ColorReplaceFilter, originally by mishaa, updated by timetocode

                                  Function approveSkills has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                  function approveSkills() {
                                      hideMenus();
                                  
                                      var approveSkills = document.getElementById("approveSkills");
                                  
                                  
                                  Severity: Minor
                                  Found in public/user/chartandtree.js - About 1 hr to fix

                                    Function approveSkills has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                    function approveSkills() {
                                        hideAll();
                                    
                                        var approveSkills = document.getElementById("approveSkills");
                                    
                                    
                                    Severity: Minor
                                    Found in new design/draft_create_skill_modal_design/user/chartandtree.js - About 1 hr to fix
                                      Severity
                                      Category
                                      Status
                                      Source
                                      Language