public.devel/app/views/HomeView.js

Summary

Maintainability
F
5 days
Test Coverage

File HomeView.js has 606 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/**
 * View Description
 * 
 * @langversion JavaScript
 * 
Severity: Major
Found in public.devel/app/views/HomeView.js - About 1 day to fix

    Function createGraph has 124 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

            createGraph: function (){
    
               var self = this;
               var removing = false;           
               //Create a new ST instance
    Severity: Major
    Found in public.devel/app/views/HomeView.js - About 4 hrs to fix

      Function createGraph has a Cognitive Complexity of 32 (exceeds 5 allowed). Consider refactoring.
      Open

              createGraph: function (){
      
                 var self = this;
                 var removing = false;           
                 //Create a new ST instance
      Severity: Minor
      Found in public.devel/app/views/HomeView.js - About 4 hrs to fix

      Cognitive Complexity

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

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

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

      Further reading

      HomeView has 28 functions (exceeds 20 allowed). Consider refactoring.
      Open

       var HomeView = View.extend({
      
          /*
           * @private
           */
      Severity: Minor
      Found in public.devel/app/views/HomeView.js - About 3 hrs to fix

        Function addSubtreeAndPagers has 54 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

           addSubtreeAndPagers: function(nodeId, tree) {
           
                      var paginator_right = '_pag_r_' + nodeId;
                      var paginator_left = '_pag_l_' + nodeId;
                      var pag = this.idToLevelsPageNum[nodeId];
        Severity: Major
        Found in public.devel/app/views/HomeView.js - About 2 hrs to fix

          Function initSearchBox has 32 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

             initSearchBox: function(){
          
                          var sURL = '/api/getsimilarconcepts?lang='+this.currentLang
                          $("#selector").select2({
                            width: '100%',
          Severity: Minor
          Found in public.devel/app/views/HomeView.js - About 1 hr to fix

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

                 getNewSubtree: function(nodeId) {
            
                    var self = this;
                    var data, uri = '';
                        
            Severity: Minor
            Found in public.devel/app/views/HomeView.js - About 1 hr to fix

              Function addIdsFromUris has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
              Open

                 addIdsFromUris: function (tree) {
              
                      var self = this;
                      var newTree = _.map(tree,function (obj) { 
                        
              Severity: Minor
              Found in public.devel/app/views/HomeView.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 paginateUpdate has 27 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                 paginateUpdate: function(parentNode, newSubtree) {
                 
                    var self = this;
                    
                    var node = self.graph.graph.getNode(parentNode);
              Severity: Minor
              Found in public.devel/app/views/HomeView.js - About 1 hr to fix

                Function customRenderingFunctionsInit has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                Open

                        customRenderingFunctionsInit: function () {
                              
                           $jit.ST.Plot.NodeTypes.implement({
                            'nodeline': {
                              'render': function(node, canvas, animating) {
                Severity: Minor
                Found in public.devel/app/views/HomeView.js - About 35 mins 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 initializeScreen has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                Open

                  initializeScreen: function () {
                           
                      var ua = navigator.userAgent;
                      var iStuff = ua.match(/iPhone/i) || ua.match(/iPad/i);
                      var typeOfCanvas = typeof HTMLCanvasElement;
                Severity: Minor
                Found in public.devel/app/views/HomeView.js - About 35 mins 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 paginate has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                Open

                   paginate: function(node, fx) {
                
                      var parentNode = this.computeParentNode(node);
                      var subtree;
                      
                Severity: Minor
                Found in public.devel/app/views/HomeView.js - About 25 mins 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 addSubtreeAndPagers has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                Open

                   addSubtreeAndPagers: function(nodeId, tree) {
                   
                              var paginator_right = '_pag_r_' + nodeId;
                              var paginator_left = '_pag_l_' + nodeId;
                              var pag = this.idToLevelsPageNum[nodeId];
                Severity: Minor
                Found in public.devel/app/views/HomeView.js - About 25 mins 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 getNewSubtree has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                Open

                     getNewSubtree: function(nodeId) {
                
                        var self = this;
                        var data, uri = '';
                            
                Severity: Minor
                Found in public.devel/app/views/HomeView.js - About 25 mins 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

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

                                 if (page > 1) {
                                   newSubtreeLeft = [{
                                     'name': '«',
                                     'id': paginator_left,
                                     'children': [],
                Severity: Major
                Found in public.devel/app/views/HomeView.js and 1 other location - About 1 hr to fix
                public.devel/app/views/HomeView.js on lines 857..871

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

                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

                                 if (page < pages) {
                                   newSubtreeRight = [{
                                     'name': '&raquo;',
                                     'id': paginator_right,
                                     'children': [],
                Severity: Major
                Found in public.devel/app/views/HomeView.js and 1 other location - About 1 hr to fix
                public.devel/app/views/HomeView.js on lines 874..888

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

                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

                    show: function () {
                      if (!this.elem) {
                        this.elem = $("#spinner");
                      }
                      this.elem.attr("style", "display:block;");
                Severity: Minor
                Found in public.devel/app/views/HomeView.js and 1 other location - About 55 mins to fix
                public.devel/app/views/HomeView.js on lines 697..702

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

                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

                    hide: function () {
                      if (!this.elem) {
                        this.elem = $("#spinner");
                      }
                      this.elem.attr("style", "display:none;");
                Severity: Minor
                Found in public.devel/app/views/HomeView.js and 1 other location - About 55 mins to fix
                public.devel/app/views/HomeView.js on lines 690..696

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

                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

                      self.collection.url = '/api/getconcept?uri=' + self.customEncode(self.currentUri) +'&lang='+self.currentLang+'&a='+self.unCacheString;
                Severity: Minor
                Found in public.devel/app/views/HomeView.js and 1 other location - About 55 mins to fix
                public.devel/app/views/HomeView.js on lines 130..130

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

                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

                        self.collection.url = '/api/getnarrowerconcepts?uri=' + self.customEncode(self.currentUri) +'&lang='+self.currentLang +'&a='+self.unCacheString;
                Severity: Minor
                Found in public.devel/app/views/HomeView.js and 1 other location - About 55 mins to fix
                public.devel/app/views/HomeView.js on lines 120..120

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

                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

                                if (node.selected) {    
                                  style.color = '#00B19E';
                                  style.fontSize = '15px';
                                  style.lineHeight='15px';
                                  style.fontWeight = 'bold';
                Severity: Minor
                Found in public.devel/app/views/HomeView.js and 1 other location - About 35 mins to fix
                public.devel/app/views/HomeView.js on lines 604..609

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

                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

                                else {
                                  style.color = '#666';
                                  style.fontSize = '13px';
                                  style.lineHeight='13px';
                                  style.fontWeight = 'normal';
                Severity: Minor
                Found in public.devel/app/views/HomeView.js and 1 other location - About 35 mins to fix
                public.devel/app/views/HomeView.js on lines 598..603

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

                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

                There are no issues that match your filters.

                Category
                Status