Module has too many lines. [251/100] Open
module Defaults
# RABID:
#
# Defaults, mostly taken from the system_setting table on an existing
# Kete2 system's database.
- Read upRead up
- Exclude checks
This cop checks if the length a module exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable.
Class SystemSetting
has 82 methods (exceeds 20 allowed). Consider refactoring. Open
class SystemSetting
module Defaults
# RABID:
#
# Defaults, mostly taken from the system_setting table on an existing
File system_setting.rb
has 275 lines of code (exceeds 250 allowed). Consider refactoring. Open
class SystemSetting
module Defaults
# RABID:
#
# Defaults, mostly taken from the system_setting table on an existing
Use \
instead of +
or <<
to concatenate those strings. Open
'You are about to download a file from Kete. Kete is an open digital repository' +
- Read upRead up
- Exclude checks
This cop checks for string literal concatenation at the end of a line.
Example:
# bad
some_str = 'ala' +
'bala'
some_str = 'ala' <<
'bala'
# good
some_str = 'ala' \
'bala'
Method SystemSetting::Defaults#force_https_on_restricted_pages
is defined at both app/models/system_setting.rb:98 and app/models/system_setting.rb:412. Open
def force_https_on_restricted_pages
- Read upRead up
- Exclude checks
This cop checks for duplicated instance (or singleton) method definitions.
Example:
# bad
def duplicated
1
end
def duplicated
2
end
Example:
# bad
def duplicated
1
end
alias duplicated other_duplicated
Example:
# good
def duplicated
1
end
def other_duplicated
2
end
Unused method argument - args
. If it's necessary, use _
or _args
as an argument name to indicate that it won't be used. Open
def method_missing(meth, *args, &block)
- Read upRead up
- Exclude checks
This cop checks for unused method arguments.
Example:
# bad
def some_method(used, unused, _unused_but_allowed)
puts used
end
Example:
# good
def some_method(used, _unused, _unused_but_allowed)
puts used
end
Use \
instead of +
or <<
to concatenate those strings. Open
'Please ensure that your virus scan software is operating and is configured to ' +
- Read upRead up
- Exclude checks
This cop checks for string literal concatenation at the end of a line.
Example:
# bad
some_str = 'ala' +
'bala'
some_str = 'ala' <<
'bala'
# good
some_str = 'ala' \
'bala'
Use \
instead of +
or <<
to concatenate those strings. Open
"scan this download.\n" +
- Read upRead up
- Exclude checks
This cop checks for string literal concatenation at the end of a line.
Example:
# bad
some_str = 'ala' +
'bala'
some_str = 'ala' <<
'bala'
# good
some_str = 'ala' \
'bala'
Unused method argument - block
. If it's necessary, use _
or _block
as an argument name to indicate that it won't be used. Open
def method_missing(meth, *args, &block)
- Read upRead up
- Exclude checks
This cop checks for unused method arguments.
Example:
# bad
def some_method(used, unused, _unused_but_allowed)
puts used
end
Example:
# good
def some_method(used, _unused, _unused_but_allowed)
puts used
end
Rename is_configured
to configured?
. Open
def is_configured
- Read upRead up
- Exclude checks
This cop makes sure that predicates are named properly.
Example:
# bad
def is_even?(value)
end
# good
def even?(value)
end
# bad
def has_value?
end
# good
def value?
end
Use \
instead of +
or <<
to concatenate those strings. Open
'and as such we can not guarantee the integrity of any file in the repository. ' +
- Read upRead up
- Exclude checks
This cop checks for string literal concatenation at the end of a line.
Example:
# bad
some_str = 'ala' +
'bala'
some_str = 'ala' <<
'bala'
# good
some_str = 'ala' \
'bala'
When using method_missing
, define respond_to_missing?
and fall back on super
. Open
def method_missing(meth, *args, &block)
# catch any forgotten defaults with a better error message
raise "You probably asked for a default setting that does not exist. You need to add the #{meth} to Defaults"
end
- Read upRead up
- Exclude checks
This cop checks for the presence of method_missing
without also
defining respond_to_missing?
and falling back on super
.
Example:
#bad
def method_missing(name, *args)
# ...
end
#good
def respond_to_missing?(name, include_private)
# ...
end
def method_missing(name, *args)
# ...
super
end
Method SystemSetting.uses_basket_list_navigation_menu_on_every_page?
is defined at both app/models/system_setting.rb:441 and app/models/system_setting.rb:447. Open
def self.uses_basket_list_navigation_menu_on_every_page?
- Read upRead up
- Exclude checks
This cop checks for duplicated instance (or singleton) method definitions.
Example:
# bad
def duplicated
1
end
def duplicated
2
end
Example:
# bad
def duplicated
1
end
alias duplicated other_duplicated
Example:
# good
def duplicated
1
end
def other_duplicated
2
end