sicambria/skilltree

View on GitHub

Showing 537 of 537 total issues

Function checkFirstLogin has 29 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function checkFirstLogin() {
    if (data.mainTree != undefined) startLoader();
    else {
        var modal = document.getElementById('firstLogin');
        var btn = document.getElementById('savebtn');
Severity: Minor
Found in new design/draft_offers_modal_design/user/src/init.js - About 1 hr to fix

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

            if (childNames != '') {
                childNames = childNames.substring(0, childNames.length - 2);
                children.innerText = childNames;
            } else children.innerText = '-';
    new design/draft_create_skill_modal_design/user/classes/itemcontainer.js on lines 697..700
    new design/draft_offers_modal_design/user/classes/itemcontainer.js on lines 703..706
    new design/draft_offers_modal_design/user/classes/itemcontainer.js on lines 713..716
    public/user/classes/itemcontainer.js on lines 727..730
    public/user/classes/itemcontainer.js on lines 737..740

    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

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

            if (trainingNames != '') {
                trainingNames = trainingNames.substring(0, trainingNames.length - 2);
                trainings.innerHTML = trainingNames;
            } else trainings.innerText = '-';
    new design/draft_create_skill_modal_design/user/classes/itemcontainer.js on lines 687..690
    new design/draft_offers_modal_design/user/classes/itemcontainer.js on lines 703..706
    new design/draft_offers_modal_design/user/classes/itemcontainer.js on lines 713..716
    public/user/classes/itemcontainer.js on lines 727..730
    public/user/classes/itemcontainer.js on lines 737..740

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

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

            this.nextlvlDesc = new PIXI.Text("", {fontSize: descriptionFontSize, fontStyle: 'italic', fill: 0x000000, wordWrap: true, wordWrapWidth: detailsWidth - this.detailsMargin * 2});
    Severity: Major
    Found in public/user/classes/itemcontainer.js and 1 other location - About 1 hr to fix
    public/user/classes/itemcontainer.js on lines 58..58

    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

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

            this.curlvlDesc = new PIXI.Text("", {fontSize: descriptionFontSize, fontStyle: 'italic', fill: 0x000000, wordWrap: true, wordWrapWidth: detailsWidth - this.detailsMargin * 2});
    Severity: Major
    Found in public/user/classes/itemcontainer.js and 1 other location - About 1 hr to fix
    public/user/classes/itemcontainer.js on lines 71..71

    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

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

            if (childNames != '') {
                childNames = childNames.substring(0, childNames.length - 2);
                children.innerText = childNames;
            } else children.innerText = '-';
    new design/draft_create_skill_modal_design/user/classes/itemcontainer.js on lines 687..690
    new design/draft_create_skill_modal_design/user/classes/itemcontainer.js on lines 697..700
    new design/draft_offers_modal_design/user/classes/itemcontainer.js on lines 713..716
    public/user/classes/itemcontainer.js on lines 727..730
    public/user/classes/itemcontainer.js on lines 737..740

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

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

    Duplicated Code

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

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

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

    Tuning

    This issue has a mass of 58.

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

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

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

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

    Refactorings

    Further Reading

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

            if (trainingNames != '') {
                trainingNames = trainingNames.substring(0, trainingNames.length - 2);
                trainings.innerHTML = trainingNames;
            } else trainings.innerText = '-';
    new design/draft_create_skill_modal_design/user/classes/itemcontainer.js on lines 687..690
    new design/draft_create_skill_modal_design/user/classes/itemcontainer.js on lines 697..700
    new design/draft_offers_modal_design/user/classes/itemcontainer.js on lines 703..706
    public/user/classes/itemcontainer.js on lines 727..730
    public/user/classes/itemcontainer.js on lines 737..740

    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

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

            if (childNames != '') {
                childNames = childNames.substring(0, childNames.length - 2);
                children.innerText = childNames;
            } else children.innerText = '-';
    Severity: Major
    Found in public/user/classes/itemcontainer.js and 5 other locations - About 1 hr to fix
    new design/draft_create_skill_modal_design/user/classes/itemcontainer.js on lines 687..690
    new design/draft_create_skill_modal_design/user/classes/itemcontainer.js on lines 697..700
    new design/draft_offers_modal_design/user/classes/itemcontainer.js on lines 703..706
    new design/draft_offers_modal_design/user/classes/itemcontainer.js on lines 713..716
    public/user/classes/itemcontainer.js on lines 737..740

    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

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

            if (trainingNames != '') {
                trainingNames = trainingNames.substring(0, trainingNames.length - 2);
                trainings.innerHTML = trainingNames;
            } else trainings.innerText = '-';
    Severity: Major
    Found in public/user/classes/itemcontainer.js and 5 other locations - About 1 hr to fix
    new design/draft_create_skill_modal_design/user/classes/itemcontainer.js on lines 687..690
    new design/draft_create_skill_modal_design/user/classes/itemcontainer.js on lines 697..700
    new design/draft_offers_modal_design/user/classes/itemcontainer.js on lines 703..706
    new design/draft_offers_modal_design/user/classes/itemcontainer.js on lines 713..716
    public/user/classes/itemcontainer.js on lines 727..730

    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

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

    function getPublicTreeData(){
      var treeToSearch = {value: document.getElementById('cardSearchBar').value};
      document.getElementById("searchModalTitle").innerHTML = "Click on a tree, to add it to your trees!";
      request('POST', '/protected/getPublicTreeData', treeToSearch, function() {
          if(this.readyState == 4 && this.status == 200) {
    Severity: Minor
    Found in public/user/src/search.js - About 1 hr to fix

      Function switchSearch has 28 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      function switchSearch(type){
        document.getElementById('advSearchDetails').innerHTML = "";
        if (type === "Skill") {
          document.getElementById('cardSearchBar').onkeyup = function(){
            if (Array.from(document.getElementById('skillSearchResult').options).find(obj => obj.value == document.getElementById('cardSearchBar').value) == undefined){
      Severity: Minor
      Found in public/user/src/search.js - About 1 hr to fix

        Function insertSkill has 28 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        async function insertSkill(skillToInsert, skillMatrix) {
            for (var component = 0; component < skillMatrix.length; component++) {
                for (var child = 0; child < skillToInsert.children.length; child++) {
                    for (var row = 0; row < skillMatrix[component].length; row++) {
                        if ((skillMatrix[component][row].map(obj => obj.name)).includes(skillToInsert.children[child].name)) {
        Severity: Minor
        Found in app.js - About 1 hr to fix

          Function validate has 28 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          function validate() {
              var loginBox = document.getElementById("loginBox");
              var username = document.getElementById("username");
              var password1 = document.getElementById("password1");
              var password2 = document.getElementById("password2");
          Severity: Minor
          Found in public/register.js - About 1 hr to fix

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

            function getPublicTreeData(){
              var treeToSearch = {value: document.getElementById('cardSearchBar').value};
              document.getElementById("searchModalTitle").innerHTML = "Click on a tree, to add it to your trees!";
              request('POST', '/protected/getPublicTreeData', treeToSearch, function() {
                  if(this.readyState == 4 && this.status == 200) {
            Severity: Minor
            Found in new design/draft_offers_modal_design/user/src/search.js - About 1 hr to fix

              Function switchSearch has 28 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              function switchSearch(type){
                document.getElementById('advSearchDetails').innerHTML = "";
                if (type === "Skill") {
                  document.getElementById('cardSearchBar').onkeyup = function(){
                    if (Array.from(document.getElementById('skillSearchResult').options).find(obj => obj.value == document.getElementById('cardSearchBar').value) == undefined){
              Severity: Minor
              Found in new design/draft_offers_modal_design/user/src/search.js - About 1 hr to fix

                Function _finishInteractionProcess has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                        _finishInteractionProcess: function (event, func) {
                            var queue = this._queue;
                            var q = queue[0];
                            var i = 0;
                            for (; i < q.length; i++) {
                Severity: Minor
                Found in new design/draft_create_skill_modal_design/user/pixi/pixi-layers.js - About 1 hr to fix

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

                            _finishInteractionProcess: function (event, func) {
                                var queue = this._queue;
                                var q = queue[0];
                                var i = 0;
                                for (; i < q.length; i++) {
                    Severity: Minor
                    Found in new design/draft_offers_modal_design/user/pixi/pixi-layers.js - About 1 hr to fix
                      Severity
                      Category
                      Status
                      Source
                      Language