sicambria/skilltree

View on GitHub

Showing 240 of 537 total issues

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

function loadSkillToEditor (skill, global) {
    document.getElementById('newSkillName').value = skill.name;
    document.getElementById('newSkillDesc').value = skill.description;
    document.getElementById('newSkillIcon').value = skill.skillIcon;
    document.getElementById('newSkillWiki').value = skill.descriptionWikipediaURL;
Severity: Minor
Found in public/user/chartandtree.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

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

function loadSkillToEditor (skill, global) {
    document.getElementById('newSkillName').value = skill.name;
    document.getElementById('newSkillDesc').value = skill.description;
    document.getElementById('newSkillIcon').value = skill.skillIcon;
    document.getElementById('newSkillWiki').value = skill.descriptionWikipediaURL;
Severity: Minor
Found in new design/draft_offers_modal_design/user/chartandtree.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

Function LayerTextureCache has 84 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    var LayerTextureCache = (function () {
        function LayerTextureCache(layer) {
            this.layer = layer;
            this.renderTexture = null;
            this.doubleBuffer = null;
Severity: Major
Found in new design/draft_create_skill_modal_design/user/pixi/pixi-layers.js - About 3 hrs to fix

    Function LayerTextureCache has 84 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        var LayerTextureCache = (function () {
            function LayerTextureCache(layer) {
                this.layer = layer;
                this.renderTexture = null;
                this.doubleBuffer = null;
    Severity: Major
    Found in new design/draft_offers_modal_design/user/pixi/pixi-layers.js - About 3 hrs to fix

      Function drawConnectionLines has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
      Open

          drawConnectionLines() {
              var connectionGroup = new PIXI.display.Group(-1, false);
      
              for (var j = 0; j < this.skills.length; j++) {
                  if (this.skills[j].children !== undefined) {
      Severity: Minor
      Found in new design/draft_create_skill_modal_design/user/classes/tree.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

      Function drawConnectionLines has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
      Open

          drawConnectionLines() {
              var connectionGroup = new PIXI.display.Group(-1, false);
      
              for (var j = 0; j < this.skills.length; j++) {
                  if (this.skills[j].children !== undefined) {
      Severity: Minor
      Found in new design/draft_offers_modal_design/user/classes/tree.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

      Function drawConnectionLines has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
      Open

          drawConnectionLines() {
              var connectionGroup = new PIXI.display.Group(-1, false);
      
              for (var j = 0; j < this.skills.length; j++) {
                  if (this.skills[j].children !== undefined) {
      Severity: Minor
      Found in public/user/classes/tree.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

      Function refreshAvaliability has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
      Open

          refreshAvaliability(){
              for (var i = 0; i < this.skills.length; i++) {
                  for (var j = 0; j < this.skills[i].parents.length; j++) {
      
                      var par = this.skills.find(obj => obj.name == this.skills[i].parents[j]);
      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

      Function refreshAvaliability has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
      Open

          refreshAvaliability(){
              for (var i = 0; i < this.skills.length; i++) {
                  for (var j = 0; j < this.skills[i].parents.length; j++) {
      
                      var par = this.skills.find(obj => obj.name == this.skills[i].parents[j]);

      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 refreshAvaliability has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
      Open

          refreshAvaliability(){
              for (var i = 0; i < this.skills.length; i++) {
                  for (var j = 0; j < this.skills[i].parents.length; j++) {
      
                      var par = this.skills.find(obj => obj.name == this.skills[i].parents[j]);
      Severity: Minor
      Found in new design/draft_offers_modal_design/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

      Function showChart has 77 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      function showChart() {
          document.getElementById('creator').style.display = "none";
          document.getElementById('approveTrees').style.display = "none";
          document.getElementById('approveSkills').style.display = "none";
          document.getElementById('pixiCanvas').style.display = "block";
      Severity: Major
      Found in public/user/src/display.js - About 3 hrs to fix

        Function showChart has 77 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        function showChart() {
            document.getElementById('creator').style.display = "none";
            document.getElementById('approveTrees').style.display = "none";
            document.getElementById('approveSkills').style.display = "none";
            document.getElementById('pixiCanvas').style.display = "block";
        Severity: Major
        Found in new design/draft_create_skill_modal_design/user/src/display.js - About 3 hrs to fix

          Function showChart has 77 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          function showChart() {
              document.getElementById('creator').style.display = "none";
              document.getElementById('approveTrees').style.display = "none";
              document.getElementById('approveSkills').style.display = "none";
              document.getElementById('pixiCanvas').style.display = "block";
          Severity: Major
          Found in new design/draft_offers_modal_design/user/src/display.js - About 3 hrs to fix

            Function loadSkillToEditor has 76 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            function loadSkillToEditor (skill, global) {
                document.getElementById('newSkillName').value = skill.name;
                document.getElementById('newSkillDesc').value = skill.description;
                document.getElementById('newSkillIcon').value = skill.skillIcon;
                document.getElementById('newSkillWiki').value = skill.descriptionWikipediaURL;
            Severity: Major
            Found in public/user/chartandtree.js - About 3 hrs to fix

              Function loadSkillToEditor has 76 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              function loadSkillToEditor (skill, global) {
                  document.getElementById('newSkillName').value = skill.name;
                  document.getElementById('newSkillDesc').value = skill.description;
                  document.getElementById('newSkillIcon').value = skill.skillIcon;
                  document.getElementById('newSkillWiki').value = skill.descriptionWikipediaURL;
              Severity: Major
              Found in new design/draft_offers_modal_design/user/chartandtree.js - About 3 hrs to fix

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

                    loadSkill.onclick =function(){
                        //request for the skill to load data from
                        var skillname = document.getElementById('newSkillName').value;
                
                        skillData = {
                Severity: Major
                Found in new design/draft_create_skill_modal_design/user/chartandtree.js - About 3 hrs to fix

                  Function editTree has 69 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  function editTree () {
                      $('.clear').find('input:text').val('');
                      $('.clear').find('textarea').val('');
                      hideMenus();
                  
                  
                  Severity: Major
                  Found in public/user/chartandtree.js - About 2 hrs to fix

                    Function editTree has 69 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    function editTree () {
                        $('.clear').find('input:text').val('');
                        $('.clear').find('textarea').val('');
                        hideMenus();
                    
                    
                    Severity: Major
                    Found in new design/draft_offers_modal_design/user/chartandtree.js - About 2 hrs to fix

                      Function onRightClick has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
                      Open

                          onRightClick() {
                              if (this.parentObj.self) {
                                  var children = this.parentObj.skill.children;
                      
                                  // Decrease skill level
                      Severity: Minor
                      Found in public/user/classes/itemcontainer.js - About 2 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 getPublicSkillData has 68 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                      function getPublicSkillData(){
                        var skillToSearch = {value: document.getElementById('cardSearchBar').value};
                        document.getElementById("searchModalTitle").innerHTML = "Click on a skill, to view its details!";
                        request('POST', '/protected/getPublicSkillData', skillToSearch, function() {
                            if(this.readyState == 4 && this.status == 200) {
                      Severity: Major
                      Found in public/user/src/search.js - About 2 hrs to fix
                        Severity
                        Category
                        Status
                        Source
                        Language