Showing 12 of 44 total issues
Class SolrDocument
has 72 methods (exceeds 20 allowed). Consider refactoring. Open
Open
class SolrDocument
include Blacklight::Solr::Document
include BlacklightOaiProvider::SolrDocument
use_extension Blacklight::Document::DublinCore
Class JatsIngestWork
has 39 methods (exceeds 20 allowed). Consider refactoring. Open
Open
class JatsIngestWork
include ActiveModel
attr_reader :xml_path
def initialize(xml_path:)
File catalog_controller.rb
has 306 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
class CatalogController < ApplicationController
include BlacklightAdvancedSearch::Controller
include BlacklightRangeLimit::ControllerOverride
include Hydra::Catalog
include Hydra::Controller::ControllerBehavior
File doi_create_service.rb
has 269 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
module Tasks
class DoiCreateService
include HycHelper
# From page 38 https://schema.datacite.org/meta/kernel-4.2/doc/DataCite-MetadataKernel_v4.2.pdf
File proquest_ingest_service.rb
has 264 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
module Tasks
require 'fileutils'
require 'htmlentities'
require 'zip'
require 'tasks/migration_helper'
Method add_assertions
has a Cognitive Complexity of 33 (exceeds 24 allowed). Consider refactoring. Open
Open
def add_assertions(prefix_method, solr_doc = {})
fields.each do |field_key, field_info|
if person_fields.include? field_key.to_s
unless field_info.values.blank?
field_to_use = field_key == 'based_near' ? field_info : field_info.behaviors
- Read upRead up
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 model_attributes
has a Cognitive Complexity of 33 (exceeds 24 allowed). Consider refactoring. Open
Open
def self.model_attributes(form_params)
agreement = form_params['agreement']
attrs = super
single_value_fields.each do |field|
- Read upRead up
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 doi_update_request
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def doi_update_request(id, data, retries, doi_update_url, datacite_user, datacite_password)
Method combined_stats
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def combined_stats(object, start_date, object_method, ga_key, user_id = nil)
Method notify_reviewers
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def self.notify_reviewers(work, work_id, group_name, type, access)
Avoid too many return
statements within this method. Open
Open
return false if !can?(:download, file_set)
Avoid too many return
statements within this method. Open
Open
return object.suppressed? if object.respond_to?(:suppressed?)