Showing 16 of 16 total issues
Class Task
has 32 methods (exceeds 20 allowed). Consider refactoring. Open
class Task
include Tumugi::Mixin::Parameterizable
include Tumugi::Mixin::Listable
include Tumugi::Mixin::TaskHelper
include Tumugi::Mixin::HumanReadable
Class TaskDefinition
has 24 methods (exceeds 20 allowed). Consider refactoring. Open
class TaskDefinition
include Tumugi::Mixin::Listable
include Tumugi::Mixin::TaskHelper
def self.define(id, opts={}, &block)
Method dequeue_task
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
def dequeue_task
loop do
task = @mutex.synchronize {
logger.trace { "task_queue_dump: #{@queue.map(&:id)}" } unless @queue.empty?
@queue.shift
- 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 execute
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def execute(dag, options={})
out = options[:out]
if out
ext = File.extname(options[:out])
format = ext[1..-1] if ext.start_with?('.')
- 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 execute
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def execute
pool = Concurrent::ThreadPoolExecutor.new(
min_threads: @worker_num,
max_threads: @worker_num
)
- 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 section
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def section(name, &block)
if block_given?
raise Tumugi::ConfigError.new('You cannot change section') if frozen?
@section_procs[name] ||= block
return 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 execute
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
def execute
pool = Concurrent::ThreadPoolExecutor.new(
min_threads: @worker_num,
max_threads: @worker_num
)
Method execute
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
def execute(dag, options={})
out = options[:out]
if out
ext = File.extname(options[:out])
format = ext[1..-1] if ext.start_with?('.')
Method mkdir
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def mkdir(path, parents: true, raise_if_exist: false)
if File.exist?(path)
if raise_if_exist
raise FileAlreadyExistError.new("Path #{path} is already exist")
elsif !directory?(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 trigger!
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
def trigger!(event)
@lock.synchronize do
now = Time.now
@_elapsed_times[tries] ||= { start: now }
Method show
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def show(dag)
headings = ['Task', 'Requires', 'Parameters', 'State', 'Elapsed']
Terminal::Table.new title: "Workflow Result", headings: headings do |t|
dag.tsort.map.with_index do |task, index|
proxy = task.class.merged_parameter_proxy
- 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 search
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def search(type)
path = "#{@search_prefix}#{type}"
# prefer LOAD_PATH than gems
[@paths, $LOAD_PATH].each do |paths|
- 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_requires_method
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def define_requires_method(task_class)
td = self
task_class.class_eval do
define_method(:requires) do
reqs = td.required_tasks
- 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 setup_logger
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def setup_logger(command, options)
log_format = (options[:log_format] || :text).to_sym
if command == :run && !options[:out].nil?
logger.init(output: options[:out], format: log_format)
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"
Further reading
Method json_formatter
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def json_formatter
Proc.new { |level, datetime, program_name, msg|
hash = { time: datetime, level: level, message: msg }
hash[:program_name] = program_name unless program_name.nil?
hash[:workflow] = workflow_id unless workflow_id.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 load_config
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def load_config(options)
config_file = options[:config]
if config_file && !File.exist?(config_file)
raise Tumugi::TumugiError, "Config file '#{config_file}' does not exist"
- 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"