sicambria/skilltree

View on GitHub

Showing 537 of 537 total issues

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 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 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 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 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_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

              Identical blocks of code found in 2 locations. Consider refactoring.
              Open

              function hideMenus () {
                  document.getElementById('submitBtn').style.display = "none";
              
                  var elements = document.getElementsByClassName("hide");
              
              
              Severity: Major
              Found in new design/draft_offers_modal_design/user/chartandtree.js and 1 other location - About 2 hrs to fix
              public/user/chartandtree.js on lines 1140..1148

              Duplicated Code

              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

              Tuning

              This issue has a mass of 94.

              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

              Refactorings

              Further Reading

              Identical blocks of code found in 2 locations. Consider refactoring.
              Open

              function hideMenus () {
                  document.getElementById('submitBtn').style.display = "none";
              
                  var elements = document.getElementsByClassName("hide");
              
              
              Severity: Major
              Found in public/user/chartandtree.js and 1 other location - About 2 hrs to fix
              new design/draft_offers_modal_design/user/chartandtree.js on lines 1104..1112

              Duplicated Code

              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

              Tuning

              This issue has a mass of 94.

              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

              Refactorings

              Further Reading

              Identical blocks of code found in 2 locations. Consider refactoring.
              Open

                      if (this.skill.achievedPoint == this.skill.maxPoint) {
                        this.setFilter(this, nullFilter, maxPointFilter);
                      } else if (this.skill.achievedPoint > 0){
                        this.setFilter(this, nullFilter, notNullPointFilter);
                      } else{
              Severity: Major
              Found in public/user/classes/itemcontainer.js and 1 other location - About 2 hrs to fix
              new design/draft_offers_modal_design/user/classes/itemcontainer.js on lines 239..245

              Duplicated Code

              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

              Tuning

              This issue has a mass of 92.

              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

              Refactorings

              Further Reading

              Identical blocks of code found in 2 locations. Consider refactoring.
              Open

                      for (var i = 0; i < data.focusArea.treeNames.length; ++i) {
                          var option = document.createElement('option');
                          option.value = option.text = data.focusArea.treeNames[i];
                          mainTree.add(option);
                      }
              Severity: Major
              Found in new design/draft_create_skill_modal_design/user/src/init.js and 1 other location - About 2 hrs to fix
              new design/draft_offers_modal_design/user/src/init.js on lines 83..87

              Duplicated Code

              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

              Tuning

              This issue has a mass of 92.

              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

              Refactorings

              Further Reading

              Identical blocks of code found in 2 locations. Consider refactoring.
              Open

                      for (var i = 0; i < data.focusArea.treeNames.length; ++i) {
                          var option = document.createElement('option');
                          option.value = option.text = data.focusArea.treeNames[i];
                          mainTree.add(option);
                      }
              Severity: Major
              Found in new design/draft_offers_modal_design/user/src/init.js and 1 other location - About 2 hrs to fix
              new design/draft_create_skill_modal_design/user/src/init.js on lines 94..98

              Duplicated Code

              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

              Tuning

              This issue has a mass of 92.

              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

              Refactorings

              Further Reading

              Identical blocks of code found in 2 locations. Consider refactoring.
              Open

                      if (this.skill.achievedPoint == this.skill.maxPoint) {
                        this.setFilter(this, nullFilter, maxPointFilter);
                      } else if (this.skill.achievedPoint > 0){
                        this.setFilter(this, nullFilter, notNullPointFilter);
                      } else{
              public/user/classes/itemcontainer.js on lines 253..259

              Duplicated Code

              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

              Tuning

              This issue has a mass of 92.

              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

              Refactorings

              Further Reading

              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

                    Function createSkill has 67 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    function createSkill () {
                        var modal = document.getElementById("newSkillModal");
                        modal.style.display = "block";
                    
                        var span = document.getElementById("closeSkillModal");
                    Severity: Major
                    Found in new design/draft_create_skill_modal_design/user/chartandtree.js - About 2 hrs to fix
                      Severity
                      Category
                      Status
                      Source
                      Language