sicambria/skilltree

View on GitHub

Showing 537 of 537 total issues

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

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

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

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

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

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

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

          if (PIXI.particles && PIXI.particles.ParticleContainer) {
              PIXI.particles.ParticleContainer.prototype.layerableChildren = false;
          }
          else if (PIXI.ParticleContainer) {
              PIXI.ParticleContainer.prototype.layerableChildren = false;
          new design/draft_create_skill_modal_design/user/pixi/pixi-layers.js on lines 46..51

          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

          if (PIXI.particles && PIXI.particles.ParticleContainer) {
              PIXI.particles.ParticleContainer.prototype.layerableChildren = false;
          }
          else if (PIXI.ParticleContainer) {
              PIXI.ParticleContainer.prototype.layerableChildren = false;
          new design/draft_offers_modal_design/user/pixi/pixi-layers.js on lines 46..51

          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

          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

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

          Duplicated Code

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

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

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

          Tuning

          This issue has a mass of 77.

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

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

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

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

          Refactorings

          Further Reading

          Function toggleSkillInfoPage has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
          Open

              toggleSkillInfoPage () {
                  var modal = document.getElementById('skillinfopage');
                  var header = document.getElementById('infoSkillnameHeader');
                  var span = document.getElementById("closeInfoModal");
                  var desc = document.getElementById("imDesc");
          Severity: Minor
          Found in public/user/classes/itemcontainer.js - About 2 hrs to fix

          Cognitive Complexity

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

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

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

          Further reading

          Function getPublicSkillData has 52 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          function getPublicSkillData(){
            var skillToSearch = {value: document.getElementById('cardSearchBar').value};
            request('POST', '/protected/getPublicSkillData', skillToSearch, function() {
                if(this.readyState == 4 && this.status == 200) {
                  var modal = document.getElementById('searchModal');
          Severity: Major
          Found in new design/draft_create_skill_modal_design/user/src/search.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 addTraining has 50 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

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

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

                function parseJwt (token) {
                    var base64Url = token.split('.')[1];
                    var base64 = base64Url.replace('-', '+').replace('_', '/');
                    return JSON.parse(window.atob(base64));
                }
                new design/draft_offers_modal_design/user/chartandtree.js on lines 1124..1128

                Duplicated Code

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

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

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

                Tuning

                This issue has a mass of 74.

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

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

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

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

                Refactorings

                Further Reading

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

                function hideCardsAndAlerts (event) {
                    if (!event.target.matches("#userCard, .float-right *")) $(".hide-on-click").collapse("hide");
                    if (!event.target.matches("#createTree")) $(".alert").hide();
                }
                Severity: Major
                Found in 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 2 locations. Consider refactoring.
                Open

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

                Duplicated Code

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

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

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

                Tuning

                This issue has a mass of 74.

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

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

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

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

                Refactorings

                Further Reading

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

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

                Duplicated Code

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

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

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

                Tuning

                This issue has a mass of 74.

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

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

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

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

                Refactorings

                Further Reading

                Function showChart has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
                Open

                function showChart() {
                    document.getElementById('creator').style.display = "none";
                    document.getElementById('approveTrees').style.display = "none";
                    document.getElementById('approveSkills').style.display = "none";
                    document.getElementById('pixiCanvas').style.display = "block";
                Severity: Minor
                Found in new design/draft_create_skill_modal_design/user/src/display.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 constructor has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
                Open

                    constructor(app, skills, skillName, owner) {
                        this.app = app;
                        this.skills = skills;
                        this.skill = skills.find(obj => obj.name == skillName);
                        this.self = owner.self;

                Cognitive Complexity

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

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

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

                Further reading

                Function showChart has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
                Open

                function showChart() {
                    document.getElementById('creator').style.display = "none";
                    document.getElementById('approveTrees').style.display = "none";
                    document.getElementById('approveSkills').style.display = "none";
                    document.getElementById('pixiCanvas').style.display = "block";
                Severity: Minor
                Found in public/user/src/display.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 showChart has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
                Open

                function showChart() {
                    document.getElementById('creator').style.display = "none";
                    document.getElementById('approveTrees').style.display = "none";
                    document.getElementById('approveSkills').style.display = "none";
                    document.getElementById('pixiCanvas').style.display = "block";
                Severity: Minor
                Found in new design/draft_offers_modal_design/user/src/display.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

                Severity
                Category
                Status
                Source
                Language