Showing 6 of 62 total issues
Class AssetType
has 32 methods (exceeds 20 allowed). Consider refactoring. Open
class AssetType
# The Asset Type encapsulates a type of attachment.
# Conventionally this would a sensible category like 'image' or 'video'
# that should be processed and presented in a particular way.
Class Asset
has 29 methods (exceeds 20 allowed). Consider refactoring. Open
class Asset < Base
include Paperclip::Glue
has_many :page_attachments, :dependent => :destroy, :class_name => 'Hijack::OutputDrivers::Radiant::PageAttachment'
Method inner_suck
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
def inner_suck(p, limit)
return if enough?(limit)
p.links.each do
|l|
begin
- 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 excluded_uris
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def excluded_uris(exclude)
m_e = exclude
links_on_page.each do
|lop|
if lop.match(MANDATORY_EXCLUDES)
- 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 define_radius_tags
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def define_radius_tags
type = self.name
Page.class_eval {
tag "asset:if_#{type}" do |tag|
tag.expand if find_asset(tag, tag.attr.dup).send("#{type}?".to_sym)
- 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 strip
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def strip(uri)
res = nil
base = nil
#
# are we relative or absolute?
- 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"