next-l/enju_leaf

View on GitHub

Showing 709 of 709 total issues

File fullcalendar.js has 8211 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/*!
 * FullCalendar v2.9.0
 * Docs & License: http://fullcalendar.io/
 * (c) 2016 Adam Shaw
 */
Severity: Major
Found in app/assets/javascripts/enju_event/fullcalendar.js - About 3 wks to fix

    Function EventManager has 850 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    function EventManager() { // assumed to be a calendar
        var t = this;
        
        
        // exports
    Severity: Major
    Found in app/assets/javascripts/enju_event/fullcalendar.js - About 4 days to fix

      Method import has a Cognitive Complexity of 135 (exceeds 5 allowed). Consider refactoring.
      Open

        def import
          transition_to!(:started)
          num = {
            manifestation_imported: 0,
            item_imported: 0,
      Severity: Minor
      Found in app/models/resource_import_file.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

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

        def index
          mode = params[:mode]
          if mode == 'add'
            unless current_user.try(:has_role?, 'Librarian')
              access_denied
      Severity: Minor
      Found in app/controllers/manifestations_controller.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

      Method fetch has a Cognitive Complexity of 123 (exceeds 5 allowed). Consider refactoring.
      Open

        def fetch(row, options = {edit_mode: 'create'})
          manifestation = nil
          item = nil
      
          if options[:edit_mode] == 'update'
      Severity: Minor
      Found in app/models/resource_import_file.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

      Method to_dcndl has a Cognitive Complexity of 123 (exceeds 5 allowed). Consider refactoring.
      Open

          def to_dcndl
            xml = Builder::XmlMarkup.new
            xml.tag! "rdf:RDF",
              "xmlns:rdf" => "http://www.w3.org/1999/02/22-rdf-syntax-ns#",
              "xmlns:dcterms" => "http://purl.org/dc/terms/",
      Severity: Minor
      Found in app/models/concerns/enju_oai/oai_model.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 Calendar_constructor has 484 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      function Calendar_constructor(element, overrides) {
          var t = this;
      
      
          // Exports
      Severity: Major
      Found in app/assets/javascripts/enju_event/fullcalendar.js - About 2 days to fix

        File resource_import_file.rb has 773 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        class ResourceImportFile < ApplicationRecord
          include Statesman::Adapters::ActiveRecordQueries[
            transition_class: ResourceImportFileTransition,
            initial_state: ResourceImportFileStateMachine.initial_state
          ]
        Severity: Major
        Found in app/models/resource_import_file.rb - About 1 day to fix

          File manifestations_controller.rb has 700 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          class ManifestationsController < ApplicationController
            before_action :set_manifestation, only: [:show, :edit, :update, :destroy]
            before_action :check_policy, only: [:index, :new, :create]
            before_action :authenticate_user!, only: :edit
            before_action :get_agent, :get_manifestation, except: [:create, :update, :destroy]
          Severity: Major
          Found in app/controllers/manifestations_controller.rb - About 1 day to fix

            Method index has a Cognitive Complexity of 73 (exceeds 5 allowed). Consider refactoring.
            Open

              def index
                query = params[:query].to_s.strip
                per_page = Item.default_per_page
                @count = {}
                if user_signed_in?
            Severity: Minor
            Found in app/controllers/items_controller.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 manifestation.rb has 632 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            class Manifestation < ApplicationRecord
              include EnjuCirculation::EnjuManifestation
              include EnjuSubject::EnjuManifestation
              include EnjuNdl::EnjuManifestation
              include EnjuNii::EnjuManifestation
            Severity: Major
            Found in app/models/manifestation.rb - About 1 day to fix

              Method rdf_statement has 279 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  def rdf_statement(manifestation)
                    nextl = RDF::Vocabulary.new('https://next-l.jp/vocab/')
                    subject = RDF::URI.new(manifestation_url(manifestation))
                    graph = RDF::Graph.new
              
              
              Severity: Major
              Found in app/helpers/manifestations_helper.rb - About 1 day to fix

                Function Header has 210 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                function Header(calendar) {
                    var t = this;
                    
                    // exports
                    t.render = render;
                Severity: Major
                Found in app/assets/javascripts/enju_event/fullcalendar.js - About 1 day to fix

                  Method index has 199 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                    def index
                      mode = params[:mode]
                      if mode == 'add'
                        unless current_user.try(:has_role?, 'Librarian')
                          access_denied
                  Severity: Major
                  Found in app/controllers/manifestations_controller.rb - About 7 hrs to fix

                    Method to_dcndl has 197 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        def to_dcndl
                          xml = Builder::XmlMarkup.new
                          xml.tag! "rdf:RDF",
                            "xmlns:rdf" => "http://www.w3.org/1999/02/22-rdf-syntax-ns#",
                            "xmlns:dcterms" => "http://purl.org/dc/terms/",
                    Severity: Major
                    Found in app/models/concerns/enju_oai/oai_model.rb - About 7 hrs to fix

                      File enju_manifestation.rb has 487 lines of code (exceeds 250 allowed). Consider refactoring.
                      Open

                      module EnjuLoc
                        module EnjuManifestation
                          extend ActiveSupport::Concern
                      
                          included do
                      Severity: Minor
                      Found in app/models/concerns/enju_loc/enju_manifestation.rb - About 7 hrs to fix

                        Method fetch has 185 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                          def fetch(row, options = {edit_mode: 'create'})
                            manifestation = nil
                            item = nil
                        
                            if options[:edit_mode] == 'update'
                        Severity: Major
                        Found in app/models/resource_import_file.rb - About 7 hrs to fix

                          Method import_record has a Cognitive Complexity of 47 (exceeds 5 allowed). Consider refactoring.
                          Open

                                def import_record(doc)
                                  iss_itemno = URI.parse(doc.at('//dcndl:BibAdminResource[@rdf:about]').values.first).path.split('/').last
                                  ndl_bib_id_record =NdlBibIdRecord.find_by(body: iss_itemno)
                                  return ndl_bib_id_record.manifestation if ndl_bib_id_record
                          
                          
                          Severity: Minor
                          Found in app/models/concerns/enju_ndl/enju_manifestation.rb - About 7 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 import has 169 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                            def import
                              transition_to!(:started)
                              num = {
                                manifestation_imported: 0,
                                item_imported: 0,
                          Severity: Major
                          Found in app/models/resource_import_file.rb - About 6 hrs to fix

                            Method create_additional_attributes has a Cognitive Complexity of 44 (exceeds 5 allowed). Consider refactoring.
                            Open

                                  def create_additional_attributes(doc, manifestation)
                                    title = get_title(doc)
                                    creators = get_creators(doc).uniq
                                    subjects = get_subjects(doc).uniq
                                    classifications = get_classifications(doc).uniq
                            Severity: Minor
                            Found in app/models/concerns/enju_ndl/enju_manifestation.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

                            Severity
                            Category
                            Status
                            Source
                            Language