sicambria/skilltree

View on GitHub
new design/draft_offers_modal_design/user/chartandtree.js

Summary

Maintainability
F
2 mos
Test Coverage

File chartandtree.js has 904 lines of code (exceeds 250 allowed). Consider refactoring.
Open

var data = undefined;
var change = false;
initData();

// creates the pixi app
Severity: Major
Found in new design/draft_offers_modal_design/user/chartandtree.js - About 2 days 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 new design/draft_offers_modal_design/user/chartandtree.js - About 3 hrs to fix

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

            function createSkill () {
                //$('#newSkillForm').reset();
                document.getElementById('newSkillForm').reset();
            
                var modal = document.getElementById("newSkillModal");
            Severity: Major
            Found in new design/draft_offers_modal_design/user/chartandtree.js - About 2 hrs to fix

              Function deleteSkillFromList has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
              Open

              function deleteSkillFromList () {
                  var skillList = document.getElementById("skillList");
                  var children = [];
                  getChildren(skillsToAdd, skillsToAdd.find(obj => obj.name == skillList.options[skillList.selectedIndex].text), children);
              
              
              Severity: Minor
              Found in new design/draft_offers_modal_design/user/chartandtree.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 editMyTree has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
              Open

              function editMyTree () {
                  $('.clear').find('input:text').val('');
                  $('.clear').find('textarea').val('');
                  var skillList = document.getElementById("skillList");
                  skillList.innerHTML = "";
              Severity: Minor
              Found in new design/draft_offers_modal_design/user/chartandtree.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 editMyTree has 59 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              function editMyTree () {
                  $('.clear').find('input:text').val('');
                  $('.clear').find('textarea').val('');
                  var skillList = document.getElementById("skillList");
                  skillList.innerHTML = "";
              Severity: Major
              Found in new design/draft_offers_modal_design/user/chartandtree.js - About 2 hrs to fix

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

                    save.onclick = function () {
                        var pointsTable = document.getElementById('pointsTable');
                        var pointsNum = pointsTable.rows.length - 1;
                        var pointDescription = [];
                        for (i = 1; i < pointsNum + 1; ++i) pointDescription.push(pointsTable.rows[i].cells[1].children[0].value);
                Severity: Major
                Found in new design/draft_offers_modal_design/user/chartandtree.js - About 2 hrs to fix

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

                      save.onclick = function () {
                          var pointsTable = document.getElementById('pointsTable');
                          var pointsNum = pointsTable.rows.length - 1;
                          var pointDescription = [];
                          for (i = 1; i < pointsNum + 1; ++i) pointDescription.push(pointsTable.rows[i].cells[1].children[0].value);
                  Severity: Major
                  Found in new design/draft_offers_modal_design/user/chartandtree.js - About 2 hrs to fix

                    Function addTraining has 50 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    function addTraining () {
                        document.getElementById('addTrainingForm').reset();
                    
                        var modal = document.getElementById("addTrainingModal");
                        modal.style.display = "block";
                    Severity: Minor
                    Found in new design/draft_offers_modal_design/user/chartandtree.js - About 2 hrs to fix

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

                          save.onclick = function () {
                              var pointsTable = document.getElementById('pointsTable');
                              var pointsNum = pointsTable.rows.length - 1;
                              var pointDescription = [];
                              for (i = 1; i < pointsNum + 1; ++i) pointDescription.push(pointsTable.rows[i].cells[1].children[0].value);
                      Severity: Minor
                      Found in new design/draft_offers_modal_design/user/chartandtree.js - About 1 hr to fix

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

                        function createTree () {
                            $('.clear').find('input:text').val('');
                            $('.clear').find('textarea').val('');
                            var skillList = document.getElementById("skillList");
                            skillList.innerHTML = "";
                        Severity: Minor
                        Found in new design/draft_offers_modal_design/user/chartandtree.js - About 1 hr to fix

                          Function editMySkill has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
                          Open

                          function editMySkill () {
                              document.getElementById('newSkillForm').reset();
                          
                              var modal = document.getElementById("newSkillModal");
                              modal.style.display = "block";
                          Severity: Minor
                          Found in new design/draft_offers_modal_design/user/chartandtree.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 onclick has 39 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              save.onclick = function () {
                                  var trainingsTable = document.getElementById('addTrainingsTable');
                                  var trainings = [];
                                  for (i = 1; i < trainingsTable.rows.length; ++i) {
                                      trainings.push({
                          Severity: Minor
                          Found in new design/draft_offers_modal_design/user/chartandtree.js - About 1 hr to fix

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

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

                                Function editSkill has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                                Open

                                function editSkill () {
                                    document.getElementById('newSkillForm').reset();
                                
                                    var modal = document.getElementById("newSkillModal");
                                    modal.style.display = "block";
                                Severity: Minor
                                Found in new design/draft_offers_modal_design/user/chartandtree.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 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

                                  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

                                  Function getChildren has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                                  Open

                                  function getChildren (skills, skill, children) {
                                      var temp = [];
                                      for (var i = 0; skill.children != undefined && i < skill.children.length; ++i) {
                                          var child = skills.find(obj => obj.name == skill.children[i].name);
                                  
                                  
                                  Severity: Minor
                                  Found in new design/draft_offers_modal_design/user/chartandtree.js - About 45 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

                                  Avoid deeply nested control flow statements.
                                  Open

                                                          if (confirm(text)) {
                                                              skillsToAdd.push(this.response.skill);
                                                              var option = document.createElement("option");
                                                              option.text = this.response.skill.name;
                                                              skillList.add(option);
                                  Severity: Major
                                  Found in new design/draft_offers_modal_design/user/chartandtree.js - About 45 mins to fix

                                    Avoid deeply nested control flow statements.
                                    Open

                                                            for (var i = 0; i < this.response.dependency.length; ++i) {
                                                                text += this.response.dependency[i].name + "\n";
                                                            }
                                    Severity: Major
                                    Found in new design/draft_offers_modal_design/user/chartandtree.js - About 45 mins to fix

                                      Avoid deeply nested control flow statements.
                                      Open

                                                          if (skillList.options[j].text == children[i].name) skillList.remove(j);
                                      Severity: Major
                                      Found in new design/draft_offers_modal_design/user/chartandtree.js - About 45 mins to fix

                                        Function createSkill has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                                        Open

                                        function createSkill () {
                                            //$('#newSkillForm').reset();
                                            document.getElementById('newSkillForm').reset();
                                        
                                            var modal = document.getElementById("newSkillModal");
                                        Severity: Minor
                                        Found in new design/draft_offers_modal_design/user/chartandtree.js - About 35 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 2 locations. 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 and 1 other location - About 1 wk to fix
                                        public/user/chartandtree.js on lines 515..614

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

                                        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 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 and 1 other location - About 1 wk to fix
                                        public/user/chartandtree.js on lines 288..399

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

                                        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 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 and 1 other location - About 1 wk to fix
                                        public/user/chartandtree.js on lines 402..513

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

                                        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 createSkill () {
                                            //$('#newSkillForm').reset();
                                            document.getElementById('newSkillForm').reset();
                                        
                                            var modal = document.getElementById("newSkillModal");
                                        Severity: Major
                                        Found in new design/draft_offers_modal_design/user/chartandtree.js and 1 other location - About 6 days to fix
                                        public/user/chartandtree.js on lines 196..285

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

                                        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 editTree () {
                                            $('.clear').find('input:text').val('');
                                            $('.clear').find('textarea').val('');
                                            hideMenus();
                                        
                                        
                                        Severity: Major
                                        Found in new design/draft_offers_modal_design/user/chartandtree.js and 1 other location - About 6 days to fix
                                        public/user/chartandtree.js on lines 774..861

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

                                        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 editMyTree () {
                                            $('.clear').find('input:text').val('');
                                            $('.clear').find('textarea').val('');
                                            var skillList = document.getElementById("skillList");
                                            skillList.innerHTML = "";
                                        Severity: Major
                                        Found in new design/draft_offers_modal_design/user/chartandtree.js and 1 other location - About 5 days to fix
                                        public/user/chartandtree.js on lines 697..771

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

                                        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 addTraining () {
                                            document.getElementById('addTrainingForm').reset();
                                        
                                            var modal = document.getElementById("addTrainingModal");
                                            modal.style.display = "block";
                                        Severity: Major
                                        Found in new design/draft_offers_modal_design/user/chartandtree.js and 1 other location - About 5 days to fix
                                        public/user/chartandtree.js on lines 131..193

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

                                        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 addSkillToList () {
                                            var skill = {value: document.getElementById('skillSearchTree').value};
                                            var skillList = document.getElementById("skillList");
                                        
                                            request('POST', '/protected/getskill', skill, function() {
                                        Severity: Major
                                        Found in new design/draft_offers_modal_design/user/chartandtree.js and 1 other location - About 3 days to fix
                                        public/user/chartandtree.js on lines 863..903

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

                                        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 deleteSkillFromList () {
                                            var skillList = document.getElementById("skillList");
                                            var children = [];
                                            getChildren(skillsToAdd, skillsToAdd.find(obj => obj.name == skillList.options[skillList.selectedIndex].text), children);
                                        
                                        
                                        Severity: Major
                                        Found in new design/draft_offers_modal_design/user/chartandtree.js and 1 other location - About 2 days to fix
                                        public/user/chartandtree.js on lines 905..932

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

                                        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 approveSkills() {
                                            hideMenus();
                                        
                                            var approveSkills = document.getElementById("approveSkills");
                                        
                                        
                                        Severity: Major
                                        Found in new design/draft_offers_modal_design/user/chartandtree.js and 1 other location - About 2 days to fix
                                        public/user/chartandtree.js on lines 993..1046

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

                                        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 approveTrainings () {
                                            hideMenus();
                                        
                                            var approveTrees = document.getElementById("approveTrainings");
                                            approveTrees.style.display = "block";
                                        Severity: Major
                                        Found in new design/draft_offers_modal_design/user/chartandtree.js and 1 other location - About 2 days to fix
                                        public/user/chartandtree.js on lines 1049..1080

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

                                        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 approveTrees() {
                                            hideMenus();
                                        
                                            var approveTrees = document.getElementById("approveTrees");
                                            approveTrees.style.display = "block";
                                        Severity: Major
                                        Found in new design/draft_offers_modal_design/user/chartandtree.js and 1 other location - About 2 days to fix
                                        public/user/chartandtree.js on lines 960..990

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

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

                                        window.onresize = function () {
                                            app.renderer.resize(window.innerWidth, window.innerHeight - 60);
                                        
                                            if (chartContainer != undefined) {
                                                var ratio = chartContainer.width / chartContainer.height;
                                        Severity: Major
                                        Found in new design/draft_offers_modal_design/user/chartandtree.js and 2 other locations - About 1 day to fix
                                        new design/draft_create_skill_modal_design/user/chartandtree.js on lines 125..146
                                        public/user/chartandtree.js on lines 103..124

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

                                        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 getChildren (skills, skill, children) {
                                            var temp = [];
                                            for (var i = 0; skill.children != undefined && i < skill.children.length; ++i) {
                                                var child = skills.find(obj => obj.name == skill.children[i].name);
                                        
                                        
                                        Severity: Major
                                        Found in new design/draft_offers_modal_design/user/chartandtree.js and 1 other location - About 1 day to fix
                                        new design/draft_create_skill_modal_design/user/chartandtree.js on lines 926..940

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

                                        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 addTreeToUser(treeToAdd){
                                          request('POST', '/protected/addTreeToUser', treeToAdd, function() {
                                              if (this.readyState == 4 && this.status == 200) {
                                                if (this.response.success){
                                                  var forest = document.getElementById("treeList");
                                        Severity: Major
                                        Found in new design/draft_offers_modal_design/user/chartandtree.js and 1 other location - About 1 day to fix
                                        new design/draft_create_skill_modal_design/user/chartandtree.js on lines 83..99

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

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

                                        function searchUserSkillsByName(element){
                                            var skillToSearch = {value: element.value};
                                            var skillSearchResult = document.getElementById('skillSearchResult');
                                            request('POST', '/protected/searchUserSkillsByName', skillToSearch, function () {
                                                if (this.readyState == 4 && this.status == 200) {
                                        Severity: Major
                                        Found in new design/draft_offers_modal_design/user/chartandtree.js and 1 other location - About 7 hrs to fix
                                        new design/draft_create_skill_modal_design/user/chartandtree.js on lines 34..47

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

                                        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 (skillsToAdd.length > 0) {
                                                        /*var skillNames = [];
                                                        for (var i = 0; i < skillsToAdd.length; ++i) skillNames.push(skillsToAdd[i].name);*/
                                        
                                                        var treeData = {
                                        Severity: Major
                                        Found in new design/draft_offers_modal_design/user/chartandtree.js and 1 other location - About 6 hrs to fix
                                        public/user/chartandtree.js on lines 655..672

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

                                        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 addRow(table) {
                                          var x = document.getElementById(table);
                                          var new_row = x.rows[1].cloneNode(true);
                                          var len = x.rows.length;
                                          if (table == 'pointsTable') new_row.cells[0].innerText = len;
                                        Severity: Major
                                        Found in new design/draft_offers_modal_design/user/chartandtree.js and 1 other location - About 5 hrs to fix
                                        public/user/chartandtree.js on lines 684..694

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

                                        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 submit() {
                                            var submitData = [];
                                            for (var i = 0; i < data.skills.length; ++i) {
                                                var temp = {
                                                    name: data.skills[i].name,
                                        Severity: Major
                                        Found in new design/draft_offers_modal_design/user/chartandtree.js and 1 other location - About 5 hrs to fix
                                        public/user/chartandtree.js on lines 70..86

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

                                        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

                                        function addCheckBox(id, boxText, parent){
                                          var divToAdd = document.createElement('div');
                                          divToAdd.className = "advSearchDetailsItem";
                                          var spanToAdd = document.createElement('span');
                                          var boxToAdd = document.createElement('input');
                                        Severity: Major
                                        Found in new design/draft_offers_modal_design/user/chartandtree.js and 2 other locations - About 5 hrs to fix
                                        new design/draft_create_skill_modal_design/user/chartandtree.js on lines 1063..1074
                                        public/user/chartandtree.js on lines 1082..1093

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

                                        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 request (type, url, sendData, callback) {
                                            var req = new XMLHttpRequest();
                                            req.open(type, url, true);
                                            req.setRequestHeader('Content-type', 'application/json');
                                            req.setRequestHeader('x-access-token', localStorage.getItem("loginToken"));
                                        Severity: Major
                                        Found in new design/draft_offers_modal_design/user/chartandtree.js and 1 other location - About 4 hrs to fix
                                        new design/draft_create_skill_modal_design/user/chartandtree.js on lines 1115..1127

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

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

                                        window.setInterval(function () {
                                            if (change) {
                                                submit();
                                                change = false;
                                                document.getElementById('submitBtn').innerText = "Saved";
                                        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 88..95

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

                                        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 parseJwt (token) {
                                            var base64Url = token.split('.')[1];
                                            var base64 = base64Url.replace('-', '+').replace('_', '/');
                                            return JSON.parse(window.atob(base64));
                                        }
                                        Severity: Major
                                        Found in new design/draft_offers_modal_design/user/chartandtree.js and 1 other location - About 1 hr to fix
                                        new design/draft_create_skill_modal_design/user/chartandtree.js on lines 1099..1103

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

                                        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 hideCardsAndAlerts (event) {
                                            if (!event.target.matches("#userCard, .float-right *")) $(".hide-on-click").collapse("hide");
                                        
                                            if (!event.target.matches("#createTree")) $(".alert").hide();
                                        }
                                        Severity: Major
                                        Found in new design/draft_offers_modal_design/user/chartandtree.js and 1 other location - About 1 hr to fix
                                        public/user/chartandtree.js on lines 1150..1153

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

                                        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

                                        Array.prototype.sum = function (prop) {
                                            var total = 0;
                                        
                                            for (var i = 0; i < this.length; ++i) {
                                                total += this[i][prop];
                                        Severity: Major
                                        Found in new design/draft_offers_modal_design/user/chartandtree.js and 1 other location - About 1 hr to fix
                                        new design/draft_create_skill_modal_design/user/chartandtree.js on lines 1105..1113

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

                                        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

                                        var app = new PIXI.Application({
                                                view: pixiCanvas,
                                                width: window.innerWidth,
                                                height: window.innerHeight - 60,
                                                //backgroundColor: 0x000000,
                                        Severity: Major
                                        Found in new design/draft_offers_modal_design/user/chartandtree.js and 2 other locations - About 1 hr to fix
                                        new design/draft_create_skill_modal_design/user/chartandtree.js on lines 5..14
                                        public/user/chartandtree.js on lines 5..14

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

                                        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

                                        function dropoffers() {
                                            request('POST', '/admin/dropoffers', {} , function () {
                                                if (this.readyState == 4 && this.status == 200) {
                                                    window.open("/user/", "_self");
                                                }
                                        Severity: Major
                                        Found in new design/draft_offers_modal_design/user/chartandtree.js and 2 other locations - About 1 hr to fix
                                        new design/draft_create_skill_modal_design/user/chartandtree.js on lines 1077..1083
                                        public/user/chartandtree.js on lines 1096..1102

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

                                        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 closeModal(modal){
                                          window.onclick = function(event) {
                                              if (event.target == modal) {
                                                  modal.style.display = "none";
                                              }
                                        Severity: Major
                                        Found in new design/draft_offers_modal_design/user/chartandtree.js and 1 other location - About 1 hr to fix
                                        public/user/chartandtree.js on lines 61..67

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

                                        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

                                        function deleteRow(table, row) {
                                          var i = row.parentNode.parentNode.rowIndex;
                                          document.getElementById(table).deleteRow(i);
                                        }
                                        Severity: Major
                                        Found in new design/draft_offers_modal_design/user/chartandtree.js and 2 other locations - About 50 mins to fix
                                        new design/draft_create_skill_modal_design/user/chartandtree.js on lines 640..643
                                        public/user/chartandtree.js on lines 678..681

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

                                        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

                                        There are no issues that match your filters.

                                        Category
                                        Status