sicambria/skilltree

View on GitHub

Showing 537 of 537 total issues

Function createTableRow has 38 lines of code (exceeds 25 allowed). Consider refactoring.
Open

        function createTableRow( data1, data2, data3, data4, data5, classname )
        {
            //Creating an offer tablerow
            var Row = document.createElement('div');
            Row.className = "divTableRow";
Severity: Minor
Found in new design/draft_offers_modal_design/user/classes/itemcontainer.js - About 1 hr to fix

    Function 5 has 38 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        },{}],5:[function(require,module,exports){
        
        
        /**
        * SimpleLightmap, originally by Oza94

      Function addSkillToList has 37 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      function addSkillToList () {
          var skill = {value: document.getElementById('skillSearchTree').value};
          var skillList = document.getElementById("skillList");
      
          request('POST', '/protected/getskill', skill, function() {
      Severity: Minor
      Found in public/user/chartandtree.js - About 1 hr to fix

        Function 3 has 37 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            },{}],3:[function(require,module,exports){
            
            
            /**
             * GlowFilter, originally by mishaa

          Function 3 has 37 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              },{}],3:[function(require,module,exports){
              
              
              /**
               * GlowFilter, originally by mishaa

            Function addSkillToList has 37 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            function addSkillToList () {
                var skill = {value: document.getElementById('skillSearchTree').value};
                var skillList = document.getElementById("skillList");
            
                request('POST', '/protected/getskill', skill, function() {
            Severity: Minor
            Found in new design/draft_offers_modal_design/user/chartandtree.js - About 1 hr to fix

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

                  var foundUsers = await User.find({
                                  "username": {$regex : ".*" + data.value + ".*", '$options' : 'i'}
                          }, 'username mainTree willingToTeach teachingDay teachingTime location focusArea skills trees', function (err, user) {
                                  if (err) throw err;
                          return user;
              Severity: Major
              Found in app.js and 1 other location - About 1 hr to fix
              app.js on lines 363..368

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

              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

                  var foundSkills = await Skill.find({
                              "name": {$regex : ".*" + data.value + ".*", '$options' : 'i'}
                      }, 'name categoryName description descriptionWikipediaURL pointDescription', function(err, skill) {
                              if (err) throw err;
                              return skill;
              Severity: Major
              Found in app.js and 1 other location - About 1 hr to fix
              app.js on lines 337..342

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

              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 switchSearch has a Cognitive Complexity of 12 (exceeds 5 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

              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 switchSearch has a Cognitive Complexity of 12 (exceeds 5 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

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

                  constructor(app, treeData, treeID, skillID) {
                      this.app = app;
                      this.treeData = treeData; // only this tree's data
                      this.skillData = treeData.skills[skillID];
                      this.skillData.treeID = treeID;

                Function constructor has 35 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    constructor(app, treeData, treeID, skillID) {
                        this.app = app;
                        this.treeData = treeData; // only this tree's data
                        this.skillData = treeData.skills[skillID];
                        this.skillData.treeID = treeID;

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

                                      if (this.parentObj.skill.achievedPoint < this.parentObj.skill.maxPoint) this.parentObj.nextlvlDesc.text = "Next level: " + this.parentObj.readMoreSplit(this.parentObj.skill.pointDescription[this.parentObj.skill.achievedPoint]);
                  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 352..352

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

                  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

                                  this.parentObj.nextlvlDesc.text = "Next level: " + this.parentObj.readMoreSplit(this.parentObj.skill.pointDescription[this.parentObj.skill.achievedPoint]);
                  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 308..308

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

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

                      addBtn.onclick = function () {
                          var skill = {value: document.getElementById('skillSearchTree').value};
                  
                          request('POST', '/protected/getskill', skill, function() {
                              if(this.readyState == 4 && this.status == 200) {
                  Severity: Minor
                  Found in new design/draft_create_skill_modal_design/user/chartandtree.js - About 1 hr to fix

                    Function getPublicUserData has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

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

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

                          addBtn.onclick = function () {
                              var skill = {value: document.getElementById('skillSearchTree').value};
                      
                              request('POST', '/protected/getskill', skill, function() {
                                  if(this.readyState == 4 && this.status == 200) {
                      Severity: Minor
                      Found in new design/draft_create_skill_modal_design/user/chartandtree.js - About 1 hr to fix

                        Function _addRecursive has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                                Stage.prototype._addRecursive = function (displayObject) {
                                    if (!displayObject.visible) {
                                        return;
                                    }
                                    if (displayObject.isLayer) {
                        Severity: Minor
                        Found in new design/draft_create_skill_modal_design/user/pixi/pixi-layers.js - About 1 hr to fix

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

                              addBtn.onclick = function () {
                                  var skill = {value: document.getElementById('skillSearchTree').value};
                          
                                  request('POST', '/protected/getskill', skill, function() {
                                      if(this.readyState == 4 && this.status == 200) {
                          Severity: Minor
                          Found in new design/draft_create_skill_modal_design/user/chartandtree.js - About 1 hr to fix

                            Function _addRecursive has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                    Stage.prototype._addRecursive = function (displayObject) {
                                        if (!displayObject.visible) {
                                            return;
                                        }
                                        if (displayObject.isLayer) {
                            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