archivesspace/archivesspace

View on GitHub

Showing 1,469 of 2,413 total issues

Function init_rapid_data_entry_form has 1261 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  $.fn.init_rapid_data_entry_form = function ($modal, uri) {
    $(this).each(function () {
      var $rde_form = $(this);
      var $table = $('table#rdeTable', $rde_form);

Severity: Major
Found in frontend/app/assets/javascripts/rde.js - About 6 days to fix

    Method configure_doc_rules has a Cognitive Complexity of 199 (exceeds 5 allowed). Consider refactoring.
    Open

      def configure_doc_rules
    
        add_document_prepare_hook {|doc, record|
          found_keys = Set.new
    
    
    Severity: Minor
    Found in indexer/app/lib/indexer_common.rb - About 4 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

    Method configure has a Cognitive Complexity of 190 (exceeds 5 allowed). Consider refactoring.
    Open

      def self.configure
        with 'ead' do |*|
          make :resource, {
            :publish => att('audience') != 'internal',
            :finding_aid_language => 'und',
    Severity: Minor
    Found in backend/app/converters/ead_converter.rb - About 3 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

    Function TokenList has 744 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      $.TokenList = function (input, url_or_data, settings) {
        //
        // Initialization
        //
    
    
    Severity: Major
    Found in frontend/app/assets/javascripts/jquery.tokeninput.js - About 3 days to fix

      Method configure has 722 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        def self.configure
          with 'ead' do |*|
            make :resource, {
              :publish => att('audience') != 'internal',
              :finding_aid_language => 'und',
      Severity: Major
      Found in backend/app/converters/ead_converter.rb - About 3 days to fix

        File rde.js has 1290 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        //= require jquery.event.drag-1.4.min
        //= require jquery.kiketable.colsizable-1.1
        //= require jquery.columnmanager.min
        //= require bootstrap-multiselect
        //= require linker
        Severity: Major
        Found in frontend/app/assets/javascripts/rde.js - About 3 days to fix

          File marcxml_bib_base_map.rb has 1270 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          module MarcXMLBibBaseMap
          
            AUTH_SUBJECT_SOURCE = {
              'a'=>"lcsh",
              'b'=>"LC subject headings for children's literature",
          Severity: Major
          Found in backend/app/converters/lib/marcxml_bib_base_map.rb - About 3 days to fix

            Method run has a Cognitive Complexity of 161 (exceeds 5 allowed). Consider refactoring.
            Open

              def run
                begin
                  # SETUP
                  @job.write_output("Resetting autogenerated slugs")
                  @job.write_output("================================")
            Severity: Minor
            Found in backend/app/lib/job_runners/generate_slugs_runner.rb - About 3 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

            Method BASE_RECORD_MAP has 639 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

              def BASE_RECORD_MAP
                {
                  :obj => :resource,
                  :defaults => {
                   :level => 'collection',
            Severity: Major
            Found in backend/app/converters/lib/marcxml_bib_base_map.rb - About 3 days to fix

              File ead3.rb has 1212 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              require_relative 'ead'
              class EAD3Serializer < EADSerializer
                serializer_for :ead3
              
                def valid_children_of_p
              Severity: Major
              Found in backend/app/exporters/serializers/ead3.rb - About 3 days to fix

                File 001_create_base_schema.rb has 1182 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                require_relative 'utils'
                
                
                Sequel.migration do
                  up do
                Severity: Major
                Found in common/db/migrations/001_create_base_schema.rb - About 3 days to fix

                  Method serialize_control has a Cognitive Complexity of 143 (exceeds 5 allowed). Consider refactoring.
                  Open

                    def serialize_control(data, xml, fragments)
                      control_atts = {
                        repositoryencoding: "iso15511",
                        countryencoding: "iso3166-1",
                        dateencoding: "iso8601",
                  Severity: Minor
                  Found in backend/app/exporters/serializers/ead3.rb - 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 eac_base_map.rb has 1132 lines of code (exceeds 250 allowed). Consider refactoring.
                  Open

                  module EACBaseMap
                    def EAC_BASE_MAP(opts = {:import_events => false})
                      import_events = opts[:import_events]
                  
                      {
                  Severity: Major
                  Found in backend/app/converters/lib/eac_base_map.rb - About 2 days to fix

                    File indexer_common.rb has 1095 lines of code (exceeds 250 allowed). Consider refactoring.
                    Open

                    require 'ashttp'
                    require 'uri'
                    require 'json'
                    require 'fileutils'
                    require 'aspace_i18n'
                    Severity: Major
                    Found in indexer/app/lib/indexer_common.rb - About 2 days to fix

                      Method configure_doc_rules has 536 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                        def configure_doc_rules
                      
                          add_document_prepare_hook {|doc, record|
                            found_keys = Set.new
                      
                      
                      Severity: Major
                      Found in indexer/app/lib/indexer_common.rb - About 2 days to fix

                        Method BASE_RECORD_MAP has a Cognitive Complexity of 132 (exceeds 5 allowed). Consider refactoring.
                        Open

                          def BASE_RECORD_MAP
                            {
                              :obj => :resource,
                              :defaults => {
                               :level => 'collection',
                        Severity: Minor
                        Found in backend/app/converters/lib/marcxml_bib_base_map.rb - 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

                        Function linker has 517 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                          $.fn.linker = function () {
                            $(this).each(function () {
                              var $this = $(this);
                              var $linkerWrapper = $this.parents('.linker-wrapper:first');
                        
                        
                        Severity: Major
                        Found in frontend/app/assets/javascripts/linker.js - About 2 days to fix

                          File aspace_form_helper.rb has 1009 lines of code (exceeds 250 allowed). Consider refactoring.
                          Open

                          require 'mixed_content_parser'
                          
                          module AspaceFormHelper
                          
                            COMBOBOX_MIN_LIMIT = 50 # if a <select> has equal or more options than this value, output a combobox
                          Severity: Major
                          Found in frontend/app/helpers/aspace_form_helper.rb - About 2 days to fix

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

                            /*
                             * jQuery Plugin: Tokenizing Autocomplete Text Entry
                             * Version 1.6.0
                             *
                             * Copyright (c) 2009 James Smith (http://loopj.com)
                            Severity: Major
                            Found in frontend/app/assets/javascripts/jquery.tokeninput.js - About 2 days to fix

                              Method serialize_eadheader has a Cognitive Complexity of 109 (exceeds 5 allowed). Consider refactoring.
                              Open

                                def serialize_eadheader(data, xml, fragments)
                                  eadid_url = data.ead_location
                              
                                  if AppConfig[:arks_enabled] && data.ark_name && (current_ark = data.ark_name.fetch('current', nil))
                                    eadid_url = current_ark
                              Severity: Minor
                              Found in backend/app/exporters/serializers/ead.rb - 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

                              Severity
                              Category
                              Status
                              Source
                              Language