sicambria/skilltree

View on GitHub

Showing 537 of 537 total issues

Function refreshAvaliability has 27 lines of code (exceeds 25 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 1 hr to fix

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

            var foundUserSkills = user.skills.filter(obj => obj.name.match(new RegExp(".*" + data.value + ".*", "i")) != null);
    Severity: Major
    Found in app.js and 1 other location - About 1 hr to fix
    app.js on lines 307..307

    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 56.

    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

            var foundUserSkills = user.skills.filter(obj => obj.name.match(new RegExp(".*" + data.value + ".*", "i")) != null);
    Severity: Major
    Found in app.js and 1 other location - About 1 hr to fix
    app.js on lines 281..281

    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 56.

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

    function approveTrainings () {
        hideAll();
    
        var approveTrees = document.getElementById("approveTrainings");
        approveTrees.style.display = "block";
    Severity: Minor
    Found in new design/draft_create_skill_modal_design/user/chartandtree.js - About 1 hr to fix

      Function approveTrainings has 26 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

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

        Function getPublicTreeData has 26 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        function getPublicTreeData(){
          var treeToSearch = {value: document.getElementById('cardSearchBar').value};
          request('POST', '/protected/getPublicTreeData', treeToSearch, function() {
              if(this.readyState == 4 && this.status == 200) {
                var modal = document.getElementById('searchModal');
        Severity: Minor
        Found in new design/draft_create_skill_modal_design/user/src/search.js - About 1 hr to fix

          Function refreshAvaliability has 26 lines of code (exceeds 25 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]);

            Function approveTrainings has 26 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            function approveTrainings () {
                hideMenus();
            
                var approveTrees = document.getElementById("approveTrainings");
                approveTrees.style.display = "block";
            Severity: Minor
            Found in new design/draft_offers_modal_design/user/chartandtree.js - About 1 hr to fix

              Similar blocks of code found in 5 locations. Consider refactoring.
              Open

                      for (var i = 0; i < this.skill.parents.length; ++i) parentNames += this.skill.parents[i] + ', ';
              new design/draft_create_skill_modal_design/user/classes/itemcontainer.js on lines 668..668
              new design/draft_offers_modal_design/user/classes/itemcontainer.js on lines 684..684
              new design/draft_offers_modal_design/user/classes/itemcontainer.js on lines 689..689
              public/user/classes/itemcontainer.js on lines 713..713

              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 55.

              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

              Similar blocks of code found in 5 locations. Consider refactoring.
              Open

                      for (var i = 0; i < this.skill.parents.length; ++i) parentNames += this.skill.parents[i] + ', ';
              Severity: Major
              Found in public/user/classes/itemcontainer.js and 4 other locations - About 1 hr to fix
              new design/draft_create_skill_modal_design/user/classes/itemcontainer.js on lines 668..668
              new design/draft_create_skill_modal_design/user/classes/itemcontainer.js on lines 673..673
              new design/draft_offers_modal_design/user/classes/itemcontainer.js on lines 684..684
              new design/draft_offers_modal_design/user/classes/itemcontainer.js on lines 689..689

              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 55.

              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

              Similar blocks of code found in 5 locations. Consider refactoring.
              Open

                      for (var i = 0; i < this.skill.pointDescription.length; ++i) pointDesc += this.skill.pointDescription[i] + ', ';
              new design/draft_create_skill_modal_design/user/classes/itemcontainer.js on lines 673..673
              new design/draft_offers_modal_design/user/classes/itemcontainer.js on lines 684..684
              new design/draft_offers_modal_design/user/classes/itemcontainer.js on lines 689..689
              public/user/classes/itemcontainer.js on lines 713..713

              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 55.

              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

              Similar blocks of code found in 5 locations. Consider refactoring.
              Open

                      for (var i = 0; i < this.skill.pointDescription.length; ++i) pointDesc += this.skill.pointDescription[i] + ', ';
              new design/draft_create_skill_modal_design/user/classes/itemcontainer.js on lines 668..668
              new design/draft_create_skill_modal_design/user/classes/itemcontainer.js on lines 673..673
              new design/draft_offers_modal_design/user/classes/itemcontainer.js on lines 689..689
              public/user/classes/itemcontainer.js on lines 713..713

              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 55.

              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

              Similar blocks of code found in 5 locations. Consider refactoring.
              Open

                      for (var i = 0; i < this.skill.parents.length; ++i) parentNames += this.skill.parents[i] + ', ';
              new design/draft_create_skill_modal_design/user/classes/itemcontainer.js on lines 668..668
              new design/draft_create_skill_modal_design/user/classes/itemcontainer.js on lines 673..673
              new design/draft_offers_modal_design/user/classes/itemcontainer.js on lines 684..684
              public/user/classes/itemcontainer.js on lines 713..713

              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 55.

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

              function createSkill () {
                  var modal = document.getElementById("newSkillModal");
                  modal.style.display = "block";
              
                  var span = document.getElementById("closeSkillModal");
              Severity: Minor
              Found in new design/draft_create_skill_modal_design/user/chartandtree.js - About 55 mins 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 a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
              Open

              function editTree () {
                  $('.clear').find('input:text').val('');
                  $('.clear').find('textarea').val('');
                  hideMenus();
              
              
              Severity: Minor
              Found in public/user/chartandtree.js - About 55 mins 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 checkFirstLogin has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
              Open

              function checkFirstLogin() {
                  if (data.mainTree != undefined) startLoader();
                  else {
                      var modal = document.getElementById('firstLogin');
                      var btn = document.getElementById('savebtn');
              Severity: Minor
              Found in new design/draft_create_skill_modal_design/user/src/init.js - About 55 mins 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 editMySkill has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
              Open

              function editMySkill () {
                  var modal = document.getElementById("newSkillModal");
                  modal.style.display = "block";
              
                  var span = document.getElementById("closeSkillModal");
              Severity: Minor
              Found in new design/draft_create_skill_modal_design/user/chartandtree.js - About 55 mins 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 a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
              Open

              function editTree () {
                  $('.clear').find('input:text').val('');
                  $('.clear').find('textarea').val('');
                  hideMenus();
              
              
              Severity: Minor
              Found in new design/draft_offers_modal_design/user/chartandtree.js - About 55 mins 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

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

                      if (!this.self && this.skill.endorsement.find(obj => obj == payload.username) == undefined) showEndorseBtn = true;
              new design/draft_offers_modal_design/user/classes/itemcontainer.js on lines 93..93
              public/user/classes/itemcontainer.js on lines 107..107

              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 53.

              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 3 locations. Consider refactoring.
              Open

                      if (!this.self && this.skill.endorsement.find(obj => obj == payload.username) == undefined) showEndorseBtn = true;
              new design/draft_create_skill_modal_design/user/classes/itemcontainer.js on lines 80..80
              public/user/classes/itemcontainer.js on lines 107..107

              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 53.

              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

              Severity
              Category
              Status
              Source
              Language