SysMO-DB/seek

View on GitHub

Showing 714 of 1,025 total issues

File models_controller.rb has 452 lines of code (exceeds 250 allowed). Consider refactoring.
Open

require 'libxml'
require 'bives'

class ModelsController < ApplicationController

Severity: Minor
Found in app/controllers/models_controller.rb - About 6 hrs to fix

    File assays.js has 450 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    var sops_assets=new Array();
    var models_assets=new Array();
    var data_files_assets=new Array();
    var organisms = new Array();
    var assays_array = new Array();
    Severity: Minor
    Found in app/assets/javascripts/assays.js - About 6 hrs to fix

      File application_controller.rb has 449 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      require 'authenticated_system'
      
      class ApplicationController < ActionController::Base
      
        include Seek::Errors::ControllerErrorHandling
      Severity: Minor
      Found in app/controllers/application_controller.rb - About 6 hrs to fix

        Method dictionary_definition has 164 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            def dictionary_definition
              # in the future this could be moved out to a file
              { refresh: 'famfamfam_silk/arrow_refresh_small.png',
                arrow_up: 'famfamfam_silk/arrow_up.png',
                arrow_down: 'famfamfam_silk/arrow_down.png',
        Severity: Major
        Found in lib/seek/image_file_dictionary.rb - About 6 hrs to fix

          Function Position has a Cognitive Complexity of 42 (exceeds 5 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 6 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

          Function Position has a Cognitive Complexity of 42 (exceeds 5 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 6 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

          Method extended_xml has a Cognitive Complexity of 42 (exceeds 5 allowed). Consider refactoring.
          Open

            def extended_xml builder,object        
              
              submitter = determine_submitter object
              builder.tag! "submitter" do 
                api_partial(builder,submitter)
          Severity: Minor
          Found in app/helpers/api_helper.rb - About 6 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

          Method log_event has a Cognitive Complexity of 42 (exceeds 5 allowed). Consider refactoring.
          Open

            def log_event
              User.with_current_user current_user do
                c = self.controller_name.downcase
                a = self.action_name.downcase
          
          
          Severity: Minor
          Found in app/controllers/application_controller.rb - About 6 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

          Function prototype has 160 lines of code (exceeds 25 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: Major
          Found in doc/seek/js/searcher.js - About 6 hrs to fix

            Method tree_editor_display has a Cognitive Complexity of 40 (exceeds 5 allowed). Consider refactoring.
            Open

              def tree_editor_display type, show_edit=true, show_delete=true, selected_id=nil, related_resource_type="Person",selective_display=false, foldable=false
            
                selected_display_items = nil
            
                if selected_id && selective_display
            Severity: Minor
            Found in app/helpers/projects_helper.rb - About 6 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

            File policy.rb has 400 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            class Policy < ActiveRecord::Base
              
              has_many :permissions,
                       :dependent => :destroy,
                       :order => "created_at ASC",
            Severity: Minor
            Found in app/models/policy.rb - About 5 hrs to fix

              Function ResizeableTextbox has a Cognitive Complexity of 37 (exceeds 5 allowed). Consider refactoring.
              Open

              function ResizeableTextbox(id, parent)
              {
                var MINWIDTH = 125;
                var MINHEIGHT = 80;
                var MINSIZE = 38;
              Severity: Minor
              Found in app/assets/javascripts/jws/Resizeable_Textbox/javascript.js - About 5 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

              Method create has a Cognitive Complexity of 37 (exceeds 5 allowed). Consider refactoring.
              Open

                def create
                  if handle_upload_data
              
                    @data_file = DataFile.new params[:data_file]
              
              
              Severity: Minor
              Found in app/controllers/data_files_controller.rb - About 5 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

              Method indented_child_options has a Cognitive Complexity of 37 (exceeds 5 allowed). Consider refactoring.
              Open

                      def indented_child_options type, parent, depth=0, selected_id
              
                        result = []
                        unless parent.children.empty?
                          parent.children.sort { |a, b| a.title.downcase <=> b.title.downcase }.each do |child|
              Severity: Minor
              Found in lib/acts_as_ontology_view_helper.rb - About 5 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

              File admins_controller.rb has 399 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              require 'delayed/command'
              
              class AdminsController < ApplicationController
                include CommonSweepers
              
              
              Severity: Minor
              Found in app/controllers/admins_controller.rb - About 5 hrs to fix

                Class User has 41 methods (exceeds 20 allowed). Consider refactoring.
                Open

                class User < ActiveRecord::Base
                  acts_as_annotation_source
                  include SavageBeast::UserInit
                
                  acts_as_tagger
                Severity: Minor
                Found in app/models/user.rb - About 5 hrs to fix

                  Function ResizeableContainer has a Cognitive Complexity of 36 (exceeds 5 allowed). Consider refactoring.
                  Open

                  function ResizeableContainer(contentID, parent)
                  {
                    var MINSIZE = 38;
                    var EDGE_THICKNESS = 7;
                    var EDGEDIFFSIZE = 2*EDGE_THICKNESS + 3;
                  Severity: Minor
                  Found in app/assets/javascripts/jws/Resizeable_Container/javascript.js - About 5 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

                  Method append_list_assay_organisms has a Cognitive Complexity of 36 (exceeds 5 allowed). Consider refactoring.
                  Open

                    def append_list_assay_organisms assay_organisms
                      result=""
                  
                      organism=nil
                      strain = nil
                  Severity: Minor
                  Found in app/helpers/assays_helper.rb - About 5 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

                  Method set_attributes_with_sharing has a Cognitive Complexity of 35 (exceeds 5 allowed). Consider refactoring.
                  Open

                    def set_attributes_with_sharing sharing, projects
                      # if no data about sharing is given, it should be some user (not the owner!)
                      # who is editing the asset - no need to do anything with policy / permissions: return success
                      self.tap do |policy|
                        if sharing
                  Severity: Minor
                  Found in app/models/policy.rb - About 5 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

                  Method get_resource_hash has a Cognitive Complexity of 35 (exceeds 5 allowed). Consider refactoring.
                  Open

                    def get_resource_hash scale, external_resource_hash
                      internal_resource_hash = {}
                      if external_resource_hash.blank?
                        @results_scaled[scale].each do |item|
                          tab = item.respond_to?(:tab) ? item.tab : item.class.name
                  Severity: Minor
                  Found in app/helpers/search_helper.rb - About 5 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

                  Severity
                  Category
                  Status
                  Source
                  Language