Showing 345 of 709 total issues
Method manifestation_params
has 75 lines of code (exceeds 25 allowed). Consider refactoring. Open
def manifestation_params
params.require(:manifestation).permit(
:original_title, :title_alternative, :title_transcription,
:manifestation_identifier, :date_copyrighted,
:access_address, :language_id, :carrier_type_id, :start_page,
Method get_mods_carrier_and_content_types
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
def self.get_mods_carrier_and_content_types(doc)
carrier_type = content_type = nil
doc.xpath('//mods:form', NS).each do |e|
authority = e.attributes['authority'].try(:content)
case authority
- 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 set_agent_role_type
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
def set_agent_role_type(agent_lists, options = {scope: :creator})
agent_lists.each do |agent_list|
name_and_role = agent_list[:full_name].split('||')
if agent_list[:agent_identifier].present?
agent = Agent.find_by(agent_identifier: agent_list[:agent_identifier])
- 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
Function transformOptions
has 71 lines of code (exceeds 25 allowed). Consider refactoring. Open
function transformOptions(sourceOptions, start, end, timezone, calendar) {
var url = API_BASE + '/' + encodeURIComponent(sourceOptions.googleCalendarId) + '/events?callback=?'; // jsonp
var apiKey = sourceOptions.googleCalendarApiKey || calendar.options.googleCalendarApiKey;
var success = sourceOptions.success;
var data;
Function limitRow
has 69 lines of code (exceeds 25 allowed). Consider refactoring. Open
limitRow: function(row, levelLimit) {
var _this = this;
var rowStruct = this.rowStructs[row];
var moreNodes = []; // array of "more" <a> links and <td> DOM nodes
var col = 0; // col #, left-to-right (not chronologically)
Method index
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
def index
@count = {}
if request.format.text?
per_page = 65534
else
- 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
Function renderSegRow
has 68 lines of code (exceeds 25 allowed). Consider refactoring. Open
renderSegRow: function(row, rowSegs) {
var colCnt = this.colCnt;
var segLevels = this.buildSegLevels(rowSegs); // group into sub-arrays of levels
var levelCnt = Math.max(1, segLevels.length); // ensure at least one level
var tbody = $('<tbody/>');
File reserve.rb
has 279 lines of code (exceeds 250 allowed). Consider refactoring. Open
class Reserve < ApplicationRecord
include Statesman::Adapters::ActiveRecordQueries[
transition_class: ReserveTransition,
initial_state: ReserveStateMachine.initial_state
]
Method index
has 65 lines of code (exceeds 25 allowed). Consider refactoring. Open
def index
if params[:mode] == 'add'
unless current_user.try(:has_role?, 'Librarian')
access_denied
return
Method edit
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
def edit
unless current_user.has_role?('Librarian')
unless params[:mode] == 'tag_edit'
access_denied
return
- 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
Function mutateEvent
has 64 lines of code (exceeds 25 allowed). Consider refactoring. Open
function mutateEvent(event, newProps, largeUnit) {
var miscProps = {};
var oldProps;
var clearEnd;
var startDelta;
Method import_record_from_cinii_books
has 62 lines of code (exceeds 25 allowed). Consider refactoring. Open
def import_record_from_cinii_books(doc)
# http://ci.nii.ac.jp/info/ja/api/api_outline.html#cib_od
# return nil
ncid = doc.at('//cinii:ncid').try(:content)
Function buildEventFromInput
has 62 lines of code (exceeds 25 allowed). Consider refactoring. Open
function buildEventFromInput(input, source) {
var out = {};
var start, end;
var allDay;
Method export
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
def self.export(options = {format: :text})
header = %w(
username
full_name
full_name_transcription
- 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 available_for_checkout?
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
def available_for_checkout?
if item.blank?
errors.add(:base, I18n.t('activerecord.errors.messages.checked_item.item_not_found'))
return false
end
- 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 update
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
def update
unless current_user.has_role?('Librarian')
if @reserve.user != current_user
access_denied
return
- 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 export
has 60 lines of code (exceeds 25 allowed). Consider refactoring. Open
def self.export(options = {format: :text})
header = %w(
username
full_name
full_name_transcription
File oai_model.rb
has 264 lines of code (exceeds 250 allowed). Consider refactoring. Open
module EnjuOai
module OaiModel
extend ActiveSupport::Concern
OAI::Provider::Base.register_format(EnjuOai::Jpcoar.instance)
OAI::Provider::Base.register_format(EnjuOai::Dcndl.instance)
Class Reserve
has 22 methods (exceeds 20 allowed). Consider refactoring. Open
class Reserve < ApplicationRecord
include Statesman::Adapters::ActiveRecordQueries[
transition_class: ReserveTransition,
initial_state: ReserveStateMachine.initial_state
]
Function mutateEvents
has 58 lines of code (exceeds 25 allowed). Consider refactoring. Open
function mutateEvents(events, clearEnd, allDay, dateDelta, durationDelta, miscProps) {
var isAmbigTimezone = t.getIsAmbigTimezone();
var undoFunctions = [];
// normalize zero-length deltas to be null