sicambria/skilltree

View on GitHub

Showing 537 of 537 total issues

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

(function (pixi_display) {
    Object.assign(PIXI.Container.prototype, {
        renderWebGL: function (renderer) {
            if (this._activeParentLayer && this._activeParentLayer != renderer._activeLayer) {
                return;
new design/draft_create_skill_modal_design/user/pixi/pixi-layers.js on lines 2..35

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

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

(function (pixi_display) {
    Object.assign(PIXI.Container.prototype, {
        renderWebGL: function (renderer) {
            if (this._activeParentLayer && this._activeParentLayer != renderer._activeLayer) {
                return;
new design/draft_offers_modal_design/user/pixi/pixi-layers.js on lines 2..35

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

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

Duplicated Code

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

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

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

Tuning

This issue has a mass of 315.

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

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

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

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

Refactorings

Further Reading

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

        if (showEndorseBtn) {
            var btnEndorse = new PIXI.Sprite(btnG.generateTexture());

            var txtEndorse = new PIXI.Text("ENDORSE", {fontSize: 14, fill: 0x000000});
            txtEndorse.anchor.set(0.5, 0.5);
new design/draft_create_skill_modal_design/user/classes/itemcontainer.js on lines 84..108

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

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 (showEndorseBtn) {
            var btnEndorse = new PIXI.Sprite(btnG.generateTexture());

            var txtEndorse = new PIXI.Text("ENDORSE", {fontSize: 14, fill: 0x000000});
            txtEndorse.anchor.set(0.5, 0.5);
new design/draft_offers_modal_design/user/classes/itemcontainer.js on lines 97..121

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

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

File pixi-layers.js has 725 lines of code (exceeds 250 allowed). Consider refactoring.
Open

var pixi_display;
(function (pixi_display) {
    Object.assign(PIXI.Container.prototype, {
        renderWebGL: function (renderer) {
            if (this._activeParentLayer && this._activeParentLayer != renderer._activeLayer) {
Severity: Major
Found in new design/draft_create_skill_modal_design/user/pixi/pixi-layers.js - About 1 day to fix

    File pixi-layers.js has 725 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    var pixi_display;
    (function (pixi_display) {
        Object.assign(PIXI.Container.prototype, {
            renderWebGL: function (renderer) {
                if (this._activeParentLayer && this._activeParentLayer != renderer._activeLayer) {
    Severity: Major
    Found in new design/draft_offers_modal_design/user/pixi/pixi-layers.js - About 1 day to fix

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

      function initData(){
        var dataRequest = new XMLHttpRequest();
        dataRequest.open('GET', '/protected/userdata', true);
        dataRequest.setRequestHeader('Content-type', 'application/x-www-form-urlencoded');
        dataRequest.setRequestHeader('x-access-token', localStorage.getItem("loginToken"));
      Severity: Major
      Found in public/user/src/init.js and 1 other location - About 1 day to fix
      new design/draft_offers_modal_design/user/src/init.js on lines 2..23

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

      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 initData(){
        var dataRequest = new XMLHttpRequest();
        dataRequest.open('GET', '/protected/userdata', true);
        dataRequest.setRequestHeader('Content-type', 'application/x-www-form-urlencoded');
        dataRequest.setRequestHeader('x-access-token', localStorage.getItem("loginToken"));
      Severity: Major
      Found in new design/draft_offers_modal_design/user/src/init.js and 1 other location - About 1 day to fix
      public/user/src/init.js on lines 2..23

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

      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

              for (var i = 0; i < data.parents.length; ++i) {
                  if (user.skills.find(obj => obj.name == data.parents[i].name) == undefined) { // add parent skill to user if not already there
                      var parent = await findSkillByName(data.parents[i].name);
                      user.skills.push(parent);
                  }
      Severity: Major
      Found in app.js and 2 other locations - About 1 day to fix
      app.js on lines 649..658

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

      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

              for (var i = 0; i < data.parents.length; ++i) {
                  if (user.skills.find(obj => obj.name == data.parents[i].name) == undefined) { // add parent skill to user if not already there
                      var parent = await findSkillByName(data.parents[i].name);
                      user.skills.push(parent);
                  }
      Severity: Major
      Found in app.js and 2 other locations - About 1 day to fix
      app.js on lines 830..839

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

      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

                      for (var i = 0; i < data.parents.length; ++i) {
                          if (user.skills.find(obj => obj.name == data.parents[i].name) == undefined) { // add parent skill to user if not already there
                              var parent = await findSkillByName(data.parents[i].name);
                              user.skills.push(parent);
                          }
      Severity: Major
      Found in app.js and 2 other locations - About 1 day to fix
      app.js on lines 649..658
      app.js on lines 830..839

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

      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 toggleSkillDetailsPage has a Cognitive Complexity of 66 (exceeds 5 allowed). Consider refactoring.
      Open

          toggleSkillDetailsPage(){
              var modal = document.getElementById('skillpage');
              var header = document.getElementById('skillnameHeader');
              var span = document.getElementById("closeORModal");
              var globalskill = undefined;

      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 toggleSkillDetailsPage has a Cognitive Complexity of 66 (exceeds 5 allowed). Consider refactoring.
      Open

          toggleSkillDetailsPage(){
              var modal = document.getElementById('skillpage');
              var header = document.getElementById('skillnameHeader');
              var span = document.getElementById("closeORModal");
              var globalskill = undefined;
      Severity: Minor
      Found in new design/draft_offers_modal_design/user/classes/itemcontainer.js - About 1 day 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

      File itemcontainer.js has 576 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

        // a quick note on filters: filters will have 2 element, the 0th element is
        // reserved for hover animations, the 1st element is reserved for more permanent
        // effect, eg. green glowfilters for maxed out skills. Keep in mind that .filters
        // should NEVER be nulled, only modified. If you want to empty a slot, apply
        // nullFilter there, it does nothing, it's kind of a placeholder filter.
      Severity: Major
      Found in public/user/classes/itemcontainer.js - About 1 day to fix

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

            createBtn.onclick = function () {
                if (document.getElementById('treeName').value.length > 0) {
                    if (skillsToAdd.length > 0) {
                        for (var i = 0; i < skillsToAdd.length; ++i) {
                            delete skillsToAdd[i].itemcontainer;
        new design/draft_create_skill_modal_design/user/chartandtree.js on lines 772..792

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

        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

            createBtn.onclick = function () {
                if (document.getElementById('treeName').value.length > 0) {
                    if (skillsToAdd.length > 0) {
                        for (var i = 0; i < skillsToAdd.length; ++i) {
                            delete skillsToAdd[i].itemcontainer;
        new design/draft_create_skill_modal_design/user/chartandtree.js on lines 903..923

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

        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

        File itemcontainer.js has 553 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

          // a quick note on filters: filters will have 2 element, the 0th element is
          // reserved for hover animations, the 1st element is reserved for more permanent
          // effect, eg. green glowfilters for maxed out skills. Keep in mind that .filters
          // should NEVER be nulled, only modified. If you want to empty a slot, apply
          // nullFilter there, it does nothing, it's kind of a placeholder filter.
        Severity: Major
        Found in new design/draft_offers_modal_design/user/classes/itemcontainer.js - About 1 day to fix

          Function toggleSkillDetailsPage has a Cognitive Complexity of 58 (exceeds 5 allowed). Consider refactoring.
          Open

              toggleSkillDetailsPage(){
                  var modal = document.getElementById('skillpage');
                  var header = document.getElementById('skillnameHeader');
                  var span = document.getElementById("closeORModal");
                  var globalskill = undefined;
          Severity: Minor
          Found in public/user/classes/itemcontainer.js - About 1 day 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