Showing 19 of 23 total issues
Class Finder
has 37 methods (exceeds 20 allowed). Consider refactoring. Open
class Finder
class WorkitemQuery < Proc; end
class TaskQuery < Proc; end
WhereKeyToMethodMap = {
Class Info
has 35 methods (exceeds 20 allowed). Consider refactoring. Open
class Info < Ruote::Worker::Info
attr_reader :worker
extend Forwardable
extend Enumerable
Class Task
has 33 methods (exceeds 20 allowed). Consider refactoring. Open
class Task
include WorkitemEntityStorage
include Support::WrapperComparison
class AlreadyClaimed < StandardError; end
Class Process
has 27 methods (exceeds 20 allowed). Consider refactoring. Open
class Process
class EntityConflict < StandardError; end
include WorkitemEntityStorage
include Support::WrapperComparison
Method add_orderer
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
def add_orderer(fields, field_type = 'fields')
@orderers << Proc.new { |wi_x, wi_y|
relevant_direction, result = :asc, 0
fields.each do |field, direction|
sets = [wi_x['fields'], wi_y['fields']]
- 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
Class Configuration
has 22 methods (exceeds 20 allowed). Consider refactoring. Open
class Configuration
attr_reader :storage_adapters
class << self
def define_setting(name)
Method create_all_from_directory!
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
def create_all_from_directory!(directory, opts = {})
added_names = []
definition_files = Bumbleworks::Support.all_files(directory)
if definition_files.values.uniq.count != definition_files.count
raise DuplicatesInDirectory, "Definitions directory contains duplicate filenames"
- 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 cancel_all_processes!
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def cancel_all_processes!(options = {})
unless options[:method] == :kill
options[:method] = :cancel
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 save
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
def save
doc = Bumbleworks::Worker.info_document
worker_info_hash = doc['workers'][@worker.id] || {}
Method cancel_process!
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def cancel_process!(wfid, options = {})
unless options[:method] == :kill
options[:method] = :cancel
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 save
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def save
doc = Bumbleworks::Worker.info_document
worker_info_hash = doc['workers'][@worker.id] || {}
- 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 build!
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def build!
initialize_tree_from_definition! unless @tree
if @name = name_from_tree
@forced_name ||= name
raise InvalidTree, "Name does not match name in definition" if @forced_name != @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 where
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def where(filters, group_type = nil)
group_type = :all unless group_type == :any
if group_type != @join
finder = self.class.new(@task_class)
finder.send(:"where_#{group_type}")
- 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 validate!
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def validate!
errors = []
errors << "Name must be specified" unless @name
errors << "Definition or tree must be specified" unless @definition || @tree
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 constantize
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def constantize(name)
name_parts = name.split('::')
name_parts.shift if name_parts.first.empty?
constant = Object
- 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 look_up_configured_path
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def look_up_configured_path(path_type, options = {})
return @cached_paths[path_type] if @cached_paths.has_key?(path_type)
if user_defined_path = user_configured_path(path_type)
if path_resolves?(user_defined_path, :file => options[:file])
return user_defined_path
- 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 find_by_id
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def find_by_id(sid)
workitem = storage_participant[sid] if sid
raise MissingWorkitem unless workitem
new(workitem)
rescue ArgumentError => e
- 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 filtered_task_from_raw_workitem
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def filtered_task_from_raw_workitem(workitem, only_workitem_queries = false)
if only_workitem_queries
if check_queries(workitem, nil)
task = from_workitem(::Ruote::Workitem.new(workitem))
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 call_method
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def call_method(method_name, options = {})
result = if options[:args]
options[:args] = [options[:args]] if options[:args].is_a?(Hash)
entity.send(method_name, *options[:args])
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"