sicambria/skilltree

View on GitHub
public/user/chartandtree.js

Summary

Maintainability
F
2 mos
Test Coverage

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

var data = undefined;
var change = false;

// creates the pixi app
var app = new PIXI.Application({
Severity: Major
Found in public/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 public/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 public/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 public/user/chartandtree.js - About 3 hrs to fix

        Cognitive Complexity

        Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

        A method's cognitive complexity is based on a few simple rules:

        • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
        • Code is considered more complex for each "break in the linear flow of the code"
        • Code is considered more complex when "flow breaking structures are nested"

        Further reading

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

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

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

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

            Function 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 public/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 public/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 public/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 public/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 public/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 public/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 public/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 public/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 public/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 public/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 public/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 public/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 public/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 public/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 setAdmin has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

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

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

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

                                    Function editTree has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                                    Open

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

                                    Cognitive Complexity

                                    Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                                    A method's cognitive complexity is based on a few simple rules:

                                    • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                                    • Code is considered more complex for each "break in the linear flow of the code"
                                    • Code is considered more complex when "flow breaking structures are nested"

                                    Further reading

                                    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 public/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 public/user/chartandtree.js - About 45 mins to fix

                                        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 public/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 (skillList.options[j].text == children[i].name) skillList.remove(j);
                                        Severity: Major
                                        Found in public/user/chartandtree.js - About 45 mins to fix

                                          Avoid deeply nested control flow statements.
                                          Open

                                                                  if (this.response.success) showBottomAlert('success', "Password changed successfully!");
                                                                  else showBottomAlert("danger", "Wrong password!");
                                          Severity: Major
                                          Found in public/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 public/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

                                            Function validateNewPwd has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                                            Open

                                            function validateNewPwd() {
                                                var oldPassword = document.getElementById("curPassword");
                                                var password1 = document.getElementById("newPassword1");
                                                var password2 = document.getElementById("newPassword2");
                                            
                                            
                                            Severity: Minor
                                            Found in public/user/chartandtree.js - About 25 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 public/user/chartandtree.js and 1 other location - About 1 wk to fix
                                            new design/draft_offers_modal_design/user/chartandtree.js on lines 523..622

                                            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 public/user/chartandtree.js and 1 other location - About 1 wk to fix
                                            new design/draft_offers_modal_design/user/chartandtree.js on lines 296..407

                                            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 public/user/chartandtree.js and 1 other location - About 1 wk to fix
                                            new design/draft_offers_modal_design/user/chartandtree.js on lines 410..521

                                            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 public/user/chartandtree.js and 1 other location - About 6 days to fix
                                            new design/draft_offers_modal_design/user/chartandtree.js on lines 204..293

                                            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 public/user/chartandtree.js and 1 other location - About 6 days to fix
                                            new design/draft_offers_modal_design/user/chartandtree.js on lines 782..869

                                            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 public/user/chartandtree.js and 1 other location - About 5 days to fix
                                            new design/draft_offers_modal_design/user/chartandtree.js on lines 705..779

                                            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 public/user/chartandtree.js and 1 other location - About 5 days to fix
                                            new design/draft_offers_modal_design/user/chartandtree.js on lines 139..201

                                            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 public/user/chartandtree.js and 1 other location - About 3 days to fix
                                            new design/draft_offers_modal_design/user/chartandtree.js on lines 871..911

                                            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 public/user/chartandtree.js and 1 other location - About 2 days to fix
                                            new design/draft_offers_modal_design/user/chartandtree.js on lines 913..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 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 public/user/chartandtree.js and 1 other location - About 2 days to fix
                                            new design/draft_offers_modal_design/user/chartandtree.js on lines 992..1045

                                            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 public/user/chartandtree.js and 1 other location - About 2 days to fix
                                            new design/draft_offers_modal_design/user/chartandtree.js on lines 1048..1079

                                            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 public/user/chartandtree.js and 1 other location - About 2 days to fix
                                            new design/draft_offers_modal_design/user/chartandtree.js on lines 959..989

                                            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 public/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
                                            new design/draft_offers_modal_design/user/chartandtree.js on lines 111..132

                                            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

                                                        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 public/user/chartandtree.js and 1 other location - About 6 hrs to fix
                                            new design/draft_offers_modal_design/user/chartandtree.js on lines 663..680

                                            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 public/user/chartandtree.js and 1 other location - About 5 hrs to fix
                                            new design/draft_offers_modal_design/user/chartandtree.js on lines 692..702

                                            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 public/user/chartandtree.js and 1 other location - About 5 hrs to fix
                                            new design/draft_offers_modal_design/user/chartandtree.js on lines 78..94

                                            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 public/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
                                            new design/draft_offers_modal_design/user/chartandtree.js on lines 1081..1092

                                            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

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

                                            function saveEmail () {
                                                var email = document.getElementById("email");
                                            
                                                if (email.value != '') {
                                                    request('POST', '/protected/newemail', {
                                            Severity: Major
                                            Found in public/user/chartandtree.js and 1 other location - About 4 hrs to fix
                                            public/user/chartandtree.js on lines 1179..1191

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

                                            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 savePlace () {
                                                var place = document.getElementById("place");
                                            
                                                if (place.value != '') {
                                                    request('POST', '/protected/newplace', {
                                            Severity: Major
                                            Found in public/user/chartandtree.js and 1 other location - About 4 hrs to fix
                                            public/user/chartandtree.js on lines 1193..1205

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

                                            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

                                                revokeBtn.onclick = function () {
                                                    var username = document.getElementById('newAdminUser').value;
                                            
                                                    request('POST', '/admin/setadmin', {
                                                        username: username,
                                            Severity: Major
                                            Found in public/user/chartandtree.js and 1 other location - About 3 hrs to fix
                                            public/user/chartandtree.js on lines 1111..1122

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

                                            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

                                                giveBtn.onclick = function () {
                                                    var username = document.getElementById('newAdminUser').value;
                                            
                                                    request('POST', '/admin/setadmin', {
                                                        username: username,
                                            Severity: Major
                                            Found in public/user/chartandtree.js and 1 other location - About 3 hrs to fix
                                            public/user/chartandtree.js on lines 1125..1136

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

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

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

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

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

                                            Refactorings

                                            Further Reading

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

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

                                            Duplicated Code

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

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

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

                                            Tuning

                                            This issue has a mass of 94.

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

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

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

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

                                            Refactorings

                                            Further Reading

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

                                            window.setInterval(function () {
                                                if (change) {
                                                    submit();
                                                    change = false;
                                                    document.getElementById('submitBtn').innerText = "Saved";
                                            Severity: Major
                                            Found in public/user/chartandtree.js and 1 other location - About 2 hrs to fix
                                            new design/draft_offers_modal_design/user/chartandtree.js on lines 96..103

                                            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 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 public/user/chartandtree.js and 1 other location - About 1 hr to fix
                                            new design/draft_offers_modal_design/user/chartandtree.js on lines 1114..1118

                                            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 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 public/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
                                            new design/draft_offers_modal_design/user/chartandtree.js on lines 6..15

                                            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 public/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
                                            new design/draft_offers_modal_design/user/chartandtree.js on lines 1095..1101

                                            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 public/user/chartandtree.js and 1 other location - About 1 hr to fix
                                            new design/draft_offers_modal_design/user/chartandtree.js on lines 69..75

                                            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 public/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
                                            new design/draft_offers_modal_design/user/chartandtree.js on lines 686..689

                                            Duplicated Code

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

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

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

                                            Tuning

                                            This issue has a mass of 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