SysMO-DB/seek

View on GitHub

Showing 714 of 1,025 total issues

Function bxSlider has 723 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    $.fn.bxSlider = function(options){

        if(this.length == 0) return this;

        // support mutltiple elements
Severity: Major
Found in app/assets/javascripts/jquery.bxslider.js - About 3 days to fix

    Function DropMenu1 has a Cognitive Complexity of 102 (exceeds 5 allowed). Consider refactoring.
    Open

    function DropMenu1(id) {
    
        /* Type of the menu: "horizontal" or "vertical" */
        this.type = "horizontal";
    
    Severity: Minor
    Found in app/assets/javascripts/dropMenu.js - About 2 days 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 bio_samples.rb has 800 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    require "libxml"
    
    module Seek
      module Data
        class BioSamples
    Severity: Major
    Found in lib/seek/data/bio_samples.rb - About 1 day to fix

      File jquery.bxslider.js has 784 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      /**
       * BxSlider v4.1.1 - Fully loaded, responsive content slider
       * http://bxslider.com
       *
       * Copyright 2013, Steven Wanderski - http://stevenwanderski.com - http://bxcreative.com
      Severity: Major
      Found in app/assets/javascripts/jquery.bxslider.js - About 1 day to fix

        Function prototype has a Cognitive Complexity of 67 (exceeds 5 allowed). Consider refactoring.
        Open

        Searcher.prototype = new function() {
          // search is performed in chunks of 1000 for non-blocking user input
          var CHUNK_SIZE = 1000;
          // do not try to find more than 100 results
          var MAX_RESULTS = 100;
        Severity: Minor
        Found in doc/seek/js/searcher.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

        Function redraw has 244 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            canvas_prototype.redraw = function( forcedContext, drawAll, forcedZoom, forcedPan ) {
                var r = this;
        
                if( this.averageRedrawTime === undefined ){ this.averageRedrawTime = 0; }
        
        
        Severity: Major
        Found in app/assets/javascripts/modified_cytoscape.js - About 1 day to fix

          File application_helper.rb has 573 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          require 'savage_beast/application_helper'
          require 'app_version'
          
          module ApplicationHelper  
            include SavageBeast::ApplicationHelper
          Severity: Major
          Found in app/helpers/application_helper.rb - About 1 day to fix

            Function ResizeableTextbox has 239 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            function ResizeableTextbox(id, parent)
            {
              var MINWIDTH = 125;
              var MINHEIGHT = 80;
              var MINSIZE = 38;
            Severity: Major
            Found in app/assets/javascripts/jws/Resizeable_Textbox/javascript.js - About 1 day to fix

              File modified_cytoscape.js has 563 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              /*
                 Some cystoscape functions are overiden here, in order to:
                 - Fix bugs
                 - Change the default behavior which can not do through api or configuration
               */
              Severity: Major
              Found in app/assets/javascripts/modified_cytoscape.js - About 1 day to fix

                Method dortmund_hengstler_mapping has a Cognitive Complexity of 60 (exceeds 5 allowed). Consider refactoring.
                Open

                    def dortmund_hengstler_mapping
                
                      age_regex = /(\d+-?\d*)\s*(day|week|month|year)s?/i
                      treatment_regex = /(\d*\.?\d*)\s*(\w+\/\w+)\s*([\w\.\s,']*),?\s+([\w\.]*)/
                      incubation_time_regex = /(\d+\.?\d*)(\w{1})/
                Severity: Minor
                Found in lib/seek/parser_mapper.rb - 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

                Function ResizeableContainer has 228 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                function ResizeableContainer(contentID, parent)
                {
                  var MINSIZE = 38;
                  var EDGE_THICKNESS = 7;
                  var EDGEDIFFSIZE = 2*EDGE_THICKNESS + 3;
                Severity: Major
                Found in app/assets/javascripts/jws/Resizeable_Container/javascript.js - About 1 day to fix

                  File spreadsheet_explorer.js has 542 lines of code (exceeds 250 allowed). Consider refactoring.
                  Open

                  function annotation_source(id, type, name, url) {
                      this.id = id;
                      this.type = type;
                      this.name = name;
                      this.url = url;
                  Severity: Major
                  Found in app/assets/javascripts/spreadsheet_explorer.js - About 1 day to fix

                    Method indented_tree_child_options has a Cognitive Complexity of 55 (exceeds 5 allowed). Consider refactoring.
                    Open

                      def indented_tree_child_options parent, depth=0, show_edit=true, show_delete=true, selected_id=nil, related_resource_type="Person",selected_display_items=nil, foldable=true
                        result = []
                        unless parent.children.empty?
                          parent.children.sort { |a, b| a.title.downcase <=> b.title.downcase }.each do |child|
                            display_style = (foldable==true) ? "display:none" : "display:block"
                    Severity: Minor
                    Found in app/helpers/projects_helper.rb - 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 parser_mapper.rb has 518 lines of code (exceeds 250 allowed). Consider refactoring.
                    Open

                    module Seek
                    
                      class ParserMapper
                    
                    
                    
                    Severity: Major
                    Found in lib/seek/parser_mapper.rb - About 1 day to fix

                      Method dortmund_bcat_ko_mapping has a Cognitive Complexity of 54 (exceeds 5 allowed). Consider refactoring.
                      Open

                          def dortmund_bcat_ko_mapping
                      
                            age_regex = /(\d+-?\d*)\s*(day|week|month|year)s?/i
                            treatment_substance_regex = /.*\((control|treated)\s?=\s?(.*)\)/i
                            treatment_concentration_unit_regex = /(\d*[,\.]?\d*)\s*([\w\s\/]*).*$/
                      Severity: Minor
                      Found in lib/seek/parser_mapper.rb - 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

                      Function DropMenu1 has 199 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                      function DropMenu1(id) {
                      
                          /* Type of the menu: "horizontal" or "vertical" */
                          this.type = "horizontal";
                      
                      Severity: Major
                      Found in app/assets/javascripts/dropMenu.js - About 7 hrs to fix

                        Class Person has 55 methods (exceeds 20 allowed). Consider refactoring.
                        Open

                        class Person < ActiveRecord::Base
                        
                          include Seek::Rdf::RdfGeneration
                          include Seek::Taggable
                          include Seek::AdminDefinedRoles
                        Severity: Major
                        Found in app/models/person.rb - About 7 hrs to fix

                          Function run has 186 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              $$("layout", "breadthfirst").prototype.run = function(){
                                  var params = this.options;
                                  var options = params;
                          
                                  var cy = params.cy;
                          Severity: Major
                          Found in app/assets/javascripts/modified_cytoscape.js - About 7 hrs to fix

                            File javascript.js has 470 lines of code (exceeds 250 allowed). Consider refactoring.
                            Open

                            function Position(x, y)
                            {
                              this.X = x;
                              this.Y = y;
                              
                            Severity: Minor
                            Found in app/assets/javascripts/jws/Resizeable_Textbox/javascript.js - About 7 hrs to fix

                              File javascript.js has 459 lines of code (exceeds 250 allowed). Consider refactoring.
                              Open

                              function Position(x, y)
                              {
                                this.X = x;
                                this.Y = y;
                                
                              Severity: Minor
                              Found in app/assets/javascripts/jws/Resizeable_Container/javascript.js - About 7 hrs to fix
                                Severity
                                Category
                                Status
                                Source
                                Language