Showing 16 of 695 total issues
File content_spec.rb
has 367 lines of code (exceeds 250 allowed). Consider refactoring. Open
RSpec.describe Card::Content do
EXAMPLES = {
nests: {
content: "Some Literals: \\[{I'm not| a link]}, and " \
'\\{{This Card|Is not Nestd}}' \
- Create a ticketCreate a ticket
File director_spec.rb
has 302 lines of code (exceeds 250 allowed). Consider refactoring. Open
RSpec.describe "Card::Director" do
STAGE_MAP = { VI: :initialize,
VP: :prepare_to_validate,
VV: :validate,
SP: :prepare_to_store,
- Create a ticketCreate a ticket
Class View
has 23 methods (exceeds 20 allowed). Consider refactoring. Open
class View
module Options
# VooApi methods let developers use view options dynamically.
module VooApi
# There are two primary options hashes:
- Create a ticketCreate a ticket
Method parts_minus
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def parts_minus keys_to_ignore
parts.map do |part|
next if part.empty?
next if part =~ /^_/ # this removes relative parts. why?
next if keys_to_ignore.member? part.to_name.key
- Read upRead up
- Create a ticketCreate a ticket
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 cards_with_disposable_attachments
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def cards_with_disposable_attachments
draft_actions_with_attachment.each do |action|
# we don't want to delete uploads in progress
next unless old_enough?(action.created_at) && (card = action.card)
# we can't delete attachments we don't have write access to
- Read upRead up
- Create a ticketCreate a ticket
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 match_prefices
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def match_prefices prefix_regexp
while match_prefix prefix_regexp
@match, @offset = current_match
# see whether the full chunk actually matches
# (as opposed to bogus prefix)
- Read upRead up
- Create a ticketCreate a ticket
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 perform
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def perform act_id, card, card_attribs, env, auth, method_name
- Create a ticketCreate a ticket
Method initialize
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def initialize format, action, header=true, action_view=:summary, hide_diff=false
- Create a ticketCreate a ticket
Method initialize
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def initialize component, name, html_class, tag_opts={}, &tag_block
- Create a ticketCreate a ticket
Method contextualize_delayed_event
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def contextualize_delayed_event act_id, card, env, auth, &block
- Create a ticketCreate a ticket
Method direct_follower_ids_for_set
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def direct_follower_ids_for_set set_card, ids
set_card.all_user_ids_with_rule_for(:follow).each do |user_id|
next if ids.include?(user_id) || !(option = follow_rule_option user_id)
yield user_id, set_card, option if block_given?
- Read upRead up
- Create a ticketCreate a ticket
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_test_event
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def define_test_event stage, subcard
test_event stage, on: :create do
yield name
subcard "112v" if subcard && name == "11"
end
- Read upRead up
- Create a ticketCreate a ticket
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 card_form_html_opts
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def card_form_html_opts action, opts={}
add_class opts, "card-form"
add_class opts, "slotter" unless opts[:redirect] || opts[:no_slotter]
add_class opts, "autosave" if action == :update
interpret_main_success_opts opts
- Read upRead up
- Create a ticketCreate a ticket
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 each_type_assigning_module_key
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def each_type_assigning_module_key
patterns.each do |p|
next unless p.assigns_type
module_key = p.module_key
- Read upRead up
- Create a ticketCreate a ticket
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 pluck_in_batches
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def pluck_in_batches *columns, batch_size: 1000
batch_start = nil
select_columns, id_index, remove_id = prepare_batch_pluck columns
loop do
- Read upRead up
- Create a ticketCreate a ticket
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 swap_all_subsequences
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def swap_all_subsequences oldseq, newseq
res = []
i = 0
while i <= num_parts - oldseq.num_parts
# for performance reasons: check first character first then the rest
- Read upRead up
- Create a ticketCreate a ticket
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"