Showing 36 of 36 total issues

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

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

      var LoginView = View.extend({
      
            /*
              * @private
           */
      Severity: Major
      Found in public.devel/app/views/LoginView.js and 1 other location - About 3 hrs to fix
      public.devel/app/views/SparqlView.js on lines 13..62

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

      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 SparqlView = View.extend({
      
            /*
              * @private
           */
      Severity: Major
      Found in public.devel/app/views/SparqlView.js and 1 other location - About 3 hrs to fix
      public.devel/app/views/LoginView.js on lines 13..62

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

      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

      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

        File application.rb has 304 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        require 'sinatra'
        # require 'sinatra_warden'
        
        require 'uri'
        require 'sanitize'
        Severity: Minor
        Found in lib/application.rb - About 3 hrs to fix

          Method get_concepts has 74 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              def get_concepts(type=nil,uri=nil, lang=nil, page=nil)
              
          
                  if uri.nil?
                    # return null to save resources
          Severity: Major
          Found in lib/application.rb - About 2 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

              Method get_concepts has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
              Open

                  def get_concepts(type=nil,uri=nil, lang=nil, page=nil)
                  
              
                      if uri.nil?
                        # return null to save resources
              Severity: Minor
              Found in lib/application.rb - 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

              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

              var OntologiesCollection = Collection.extend({
              
                  //--------------------------------------
                  //+ PUBLIC PROPERTIES / CONSTANTS
                  //--------------------------------------
              Severity: Major
              Found in public.devel/app/collections/OntologiesCollection.js and 1 other location - About 1 hr to fix
              public.devel/app/collections/GraphCollection.js on lines 12..40

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

              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 GraphCollection = Collection.extend({
              
                  //--------------------------------------
                  //+ PUBLIC PROPERTIES / CONSTANTS
                  //--------------------------------------
              Severity: Major
              Found in public.devel/app/collections/GraphCollection.js and 1 other location - About 1 hr to fix
              public.devel/app/collections/OntologiesCollection.js on lines 12..40

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

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

                Method get_concept has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    def get_concept(uri=nil, lang=nil)
                    
                
                        if uri.nil?
                          # return null to save resources
                Severity: Minor
                Found in lib/application.rb - 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

                      Method get_ontologies has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          def get_ontologies(lang=nil)
                          
                              if lang.nil? || !lang.length == 2
                                lang = 'EN'
                              else
                      Severity: Minor
                      Found in lib/application.rb - About 1 hr to fix
                        Severity
                        Category
                        Status
                        Source
                        Language