sicambria/skilltree

View on GitHub

Showing 537 of 537 total issues

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

Array.prototype.sum = function (prop) {
    var total = 0;

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

Duplicated Code

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

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

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

Tuning

This issue has a mass of 73.

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

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

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

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

Refactorings

Further Reading

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

        await data.skills.forEach(async function (skill) {

        skill.achievedPoint = 0;
        if (user.skills.find(obj => obj.name == skill.name) == undefined) {
            user.skills.push(skill);
Severity: Major
Found in app.js and 1 other location - About 1 hr to fix
app.js on lines 574..578

Duplicated Code

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

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

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

Tuning

This issue has a mass of 73.

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

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

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

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

Refactorings

Further Reading

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

Array.prototype.sum = function (prop) {
    var total = 0;

    for (var i = 0; i < this.length; ++i) {
        total += this[i][prop];
new design/draft_offers_modal_design/user/chartandtree.js on lines 1130..1138

Duplicated Code

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

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

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

Tuning

This issue has a mass of 73.

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

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

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

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

Refactorings

Further Reading

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

    await skills.forEach(function (skill) {
        skill.achievedPoint = 0;
        if (user.skills.find(obj => obj.name == skill.name) == undefined){
            user.skills.push(skill);
        }});
Severity: Major
Found in app.js and 1 other location - About 1 hr to fix
app.js on lines 740..746

Duplicated Code

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

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

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

Tuning

This issue has a mass of 73.

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

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

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

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

Refactorings

Further Reading

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

        if (nextLvlDesc != undefined) btnPosY = nextLvlDesc.position.y + nextLvlDesc.height + 15;
        else if (curLvlDesc != undefined) btnPosY = curLvlDesc.position.y + curLvlDesc.height + 15;
new design/draft_create_skill_modal_design/user/classes/itemcontainer.js on lines 59..60

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

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 (nextLvlDesc != undefined) btnPosY = nextLvlDesc.position.y + nextLvlDesc.height + 15;
        else if (curLvlDesc != undefined) btnPosY = curLvlDesc.position.y + curLvlDesc.height + 15;
new design/draft_offers_modal_design/user/classes/itemcontainer.js on lines 72..73

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

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

    save.onclick = function () {
        var pointsTable = document.getElementById('pointsTable');
        var pointsNum = pointsTable.rows.length - 1;
        var pointDescription = [];
        for (i = 1; i < pointsNum + 1; ++i) pointDescription.push(pointsTable.rows[i].cells[1].children[0].value);
Severity: Minor
Found in new design/draft_create_skill_modal_design/user/chartandtree.js - About 1 hr 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 onclick has 44 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

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

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

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

          Function toggleSkillInfoPage has a Cognitive Complexity of 14 (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");

          Cognitive Complexity

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

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

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

          Further reading

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

                              if(par.children.find(obj => obj.name == this.skills[i].name).minPoint > par.achievedPoint || par.itemcontainer.container.interactive == false){
                                  var colorMatrixFilter = new PIXI.filters.ColorMatrixFilter;
                                  colorMatrixFilter.brightness(0.4);
                                  this.skills[i].itemcontainer.skillborder.filters = [colorMatrixFilter];
                                  this.skills[i].itemcontainer.skillicon.filters = [colorMatrixFilter];
          new design/draft_offers_modal_design/user/classes/itemcontainer.js on lines 323..341
          public/user/classes/itemcontainer.js on lines 380..402

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

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

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

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

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

          Refactorings

          Further Reading

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

                              if(par.children.find(obj => obj.name == this.skills[i].name).minPoint > par.achievedPoint || par.itemcontainer.container.interactive == false){
                                  var colorMatrixFilter = new PIXI.filters.ColorMatrixFilter;
                                  colorMatrixFilter.brightness(0.4);
                                  this.skills[i].itemcontainer.skillicon.filters = [colorMatrixFilter];
                                  this.skills[i].itemcontainer.skillborder.levelinfo.filters = [colorMatrixFilter];
          Severity: Major
          Found in public/user/classes/itemcontainer.js and 2 other locations - About 1 hr to fix
          new design/draft_create_skill_modal_design/user/classes/itemcontainer.js on lines 311..329
          new design/draft_offers_modal_design/user/classes/itemcontainer.js on lines 323..341

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

          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 14 (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 new design/draft_offers_modal_design/user/classes/itemcontainer.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

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

                              if(par.children.find(obj => obj.name == this.skills[i].name).minPoint > par.achievedPoint || par.itemcontainer.container.interactive == false){
                                  var colorMatrixFilter = new PIXI.filters.ColorMatrixFilter;
                                  colorMatrixFilter.brightness(0.4);
                                  this.skills[i].itemcontainer.skillicon.filters = [colorMatrixFilter];
                                  this.skills[i].itemcontainer.skillborder.levelinfo.filters = [colorMatrixFilter];
          new design/draft_create_skill_modal_design/user/classes/itemcontainer.js on lines 311..329
          public/user/classes/itemcontainer.js on lines 380..402

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

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

                  LayerTextureCache.prototype.pushTexture = function (renderer) {
                      var screen = renderer.screen;
                      if (!this.renderTexture) {
                          this.initRenderTexture(renderer);
                      }
          Severity: Minor
          Found in new design/draft_create_skill_modal_design/user/pixi/pixi-layers.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 pushTexture has 42 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                      LayerTextureCache.prototype.pushTexture = function (renderer) {
                          var screen = renderer.screen;
                          if (!this.renderTexture) {
                              this.initRenderTexture(renderer);
                          }
              Severity: Minor
              Found in new design/draft_offers_modal_design/user/pixi/pixi-layers.js - About 1 hr to fix

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

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

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

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