SysMO-DB/seek

View on GitHub

Showing 714 of 1,025 total issues

Function roundRectangleIntersectLine has 97 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    canvas_prototype.roundRectangleIntersectLine = function(
        x, y, nodeX, nodeY, width, height, padding) {

        //Manually change for seek to fix that safari quits unexpectedly
        var cornerRadius = 0;
Severity: Major
Found in app/assets/javascripts/modified_cytoscape.js - About 3 hrs to fix

    Method add_as_new has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring.
    Open

        def add_as_new resource
          #FIXME: this method is too long 
          begin
            warning=nil
            warning_code=0
    Severity: Minor
    Found in lib/jerm/embedded_populator.rb - About 3 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 build_all_bio_sample_json has 92 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        def build_all_bio_sample_json sheet
    
          # population order should NOT change, DB is populated only if @to_populate is set to be true
    
          # probing number of rows with data in sheet
    Severity: Major
    Found in lib/seek/data/bio_samples.rb - About 3 hrs to fix

      Method text_or_not_specified has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring.
      Open

        def text_or_not_specified text, options = {}
          text=text.to_s if text.kind_of?(Numeric)
          if text.nil? or text.chomp.empty?
            not_specified_text||=options[:none_text]
            not_specified_text||="No description specified" if options[:description]==true
      Severity: Minor
      Found in app/helpers/application_helper.rb - About 3 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 handle_upload_data has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring.
      Open

            def handle_upload_data
              blob_params = content_blob_params
      
              # MERGENOTE - the manipulation and validation of the params still needs a bit of cleaning up
              blob_params = update_params_for_batch(blob_params)
      Severity: Minor
      Found in lib/seek/upload_handling/data_upload.rb - About 3 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 generate_triples has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring.
      Open

            def generate_triples subject, method, property,uri_or_literal,transformation,collection_transform,rdf_graph
              resource = subject.rdf_resource
              transform = transformation.strip unless transformation.nil?
              collection_transform = collection_transform.strip unless collection_transform.nil?
              items = subject.send(method)
      Severity: Minor
      Found in lib/seek/rdf/rdf_generation.rb - About 3 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 populate_specimen has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring.
      Open

          def populate_specimen specimen_json
      
            specimen_title = specimen_json["title"]
            sex = specimen_json["sex"]
            age = specimen_json["age"]
      Severity: Minor
      Found in lib/seek/data/bio_samples.rb - About 3 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 populate_treatment has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring.
      Open

          def populate_treatment treatment_json, specimen=nil, sample=nil
      
              start_value = treatment_json["start value"]
              end_value = treatment_json["end value"]
              standard_deviation = treatment_json["standard deviation"]
      Severity: Minor
      Found in lib/seek/data/bio_samples.rb - About 3 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 dragObject has 89 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      function dragObject(element, attachElement, lowerBound, upperBound, startCallback, moveCallback, endCallback, attachLater)
      {
        if(typeof(element) == "string")
          element = document.getElementById(element);
        if(element == null)
      Severity: Major
      Found in app/assets/javascripts/jws/Resizeable_Container/javascript.js - About 3 hrs to fix

        Function dragObject has 89 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        function dragObject(element, attachElement, lowerBound, upperBound, startCallback, moveCallback, endCallback, attachLater)
        {
          if(typeof(element) == "string")
            element = document.getElementById(element);
          if(element == null)
        Severity: Major
        Found in app/assets/javascripts/jws/Resizeable_Textbox/javascript.js - About 3 hrs to fix

          File data_files_controller.rb has 313 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          require 'simple-spreadsheet-extractor'
          
          class DataFilesController < ApplicationController
          
            include IndexPager
          Severity: Minor
          Found in app/controllers/data_files_controller.rb - About 3 hrs to fix

            Method populate_specimen has 86 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                def populate_specimen specimen_json
            
                  specimen_title = specimen_json["title"]
                  sex = specimen_json["sex"]
                  age = specimen_json["age"]
            Severity: Major
            Found in lib/seek/data/bio_samples.rb - About 3 hrs to fix

              Method parse_spreadsheet_xml has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring.
              Open

                    def parse_spreadsheet_xml(spreadsheet_xml)
                      workbook = Workbook.new
              
                      doc = LibXML::XML::Parser.string(spreadsheet_xml).parse
                      doc.root.namespaces.default_prefix="ss"
              Severity: Minor
              Found in lib/seek/data/spreadsheet_explorer_representation.rb - About 3 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 populate has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring.
              Open

                  def populate      
                    begin
                      @translucent_id = @node.find_first("id").content unless @node.find_first("id").nil?
                      @author_seek_id = @node.find_first("submitter").content unless @node.find_first("submitter").nil?
                      if @type=="Model"
              Severity: Minor
              Found in lib/jerm/translucent_resource.rb - About 3 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

              Class Publication has 28 methods (exceeds 20 allowed). Consider refactoring.
              Open

              class Publication < ActiveRecord::Base
                include Seek::Rdf::RdfGeneration
                title_trimmer
                alias_attribute :description, :abstract
                #searchable must come before acts_as_asset is called
              Severity: Minor
              Found in app/models/publication.rb - About 3 hrs to fix

                Class Workflow has 28 methods (exceeds 20 allowed). Consider refactoring.
                Open

                class Workflow < ActiveRecord::Base
                
                  acts_as_asset
                
                  scope :default_order, order('title')
                Severity: Minor
                Found in app/models/workflow.rb - About 3 hrs to fix

                  Class ModelsController has 28 methods (exceeds 20 allowed). Consider refactoring.
                  Open

                  class ModelsController < ApplicationController
                  
                    include WhiteListHelper
                    include IndexPager
                    include DotGenerator
                  Severity: Minor
                  Found in app/controllers/models_controller.rb - About 3 hrs to fix

                    Method add_items_to_queue has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
                    Open

                      def self.add_items_to_queue items, t=5.seconds.from_now, priority=0, queuepriority=priority
                        if Seek::Config.auth_lookup_enabled
                    
                          items = [items] if items.nil?
                          items = Array(items)
                    Severity: Minor
                    Found in app/jobs/auth_lookup_update_job.rb - About 3 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 a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
                    Open

                    Search.prototype = $.extend({}, Navigation, new function() {
                      var suid = 1;
                    
                      this.init = function() {
                        var _this = this;
                    Severity: Minor
                    Found in doc/seek/js/search.js - About 3 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 authorized_list has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
                    Open

                      def authorized_list all_items, attribute, sort=true, max_length=75, count_hidden_items=false
                        items = all_items.select &:can_view?
                        if Seek::Config.is_virtualliver
                          title_only_items = (all_items - items).select &:title_is_public?
                        else
                    Severity: Minor
                    Found in app/helpers/application_helper.rb - About 3 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