Showing 17 of 19 total issues
Method set_primary_attributes
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
def set_primary_attributes(context)
@item = context['form_model']
if @item
@attribute_name = resolve_value(@params.shift,context)
@first_attr = context['form_class_name']
- 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
File date_tags.rb
has 286 lines of code (exceeds 250 allowed). Consider refactoring. Open
require 'clot/date_tags'
require 'clot/no_model_form_tags'
module Clot
Method activate
has 55 lines of code (exceeds 25 allowed). Consider refactoring. Open
def self.activate
%w(
clot/active_record/droppable.rb
clot/base_drop.rb
clot/if_content_for.rb
Method apply_params
has 52 lines of code (exceeds 25 allowed). Consider refactoring. Open
def apply_params(params, context)
params.each do |pair|
pair_data = pair.split ":"
case pair_data[0]
when "label" then
Method set_primary_attributes
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
def set_primary_attributes(context)
@item = context['form_model']
if @item
@attribute_name = resolve_value(@params.shift,context)
@first_attr = context['form_class_name']
Method render
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
def render(context)
if @attributes.has_key?('url_helper')
Protected.config = context.registers[:controller]
@attributes['url'] = Protected.send(@attributes['url_helper'].to_sym) unless @attributes.has_key?('url_helper_params')
if params = context[@attributes['url_helper_params']]
- 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 apply_params
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def apply_params(params, context)
params.each do |pair|
pair_data = pair.split ":"
case pair_data[0]
when "label" then
- 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 personal_attributes
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
def personal_attributes(name,value)
case name
when "discard_day" then
@discard_day = true
when "include_blank" then
Method set_attributes
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def set_attributes(context)
set_primary_attributes(context)
@params.each do |pair|
pair.match /([^:]*):(.*)/
- 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 liquify
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def self.liquify(current_context, *records, &block)
i = -1
records =
records.inject [] do |all, r|
i+=1
- 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 value_string
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def value_string(val)
if @use_month_numbers
super(val)
else
if @use_month_names
- 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_form_action
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def set_form_action(context)
if @attributes.has_key?('ur_helper')
Protected.config = context.registers[:controller]
if @attributes['object'].nil?
- 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 get_options
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def get_options(from_val,to_val, selected_value = nil)
options = ""
if from_val < to_val
range = (from_val..to_val)
- 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 render
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def render(context)
@params = @_params.clone
@model = context[@params.shift]
if @model and @model.respond_to?(:errors) and @model.errors.count > 0
- 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 form_select_item
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def form_select_item(name, value, collection, errors, blank_option = nil)
Method render
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def render(context)
if @naked_yield
return context['content_for_layout']
else
partial = Liquid::Template.load_theme(context, @template_name)
- 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 render
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def render(context)
@tag_factory = context['tag_factory']
tag_generator(@params, context)
LinkItem.has_predecessor ||= {}
separator = ""
- 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"