Class Schedule
has 55 methods (exceeds 20 allowed). Consider refactoring. Open
class Schedule < Rest::Resource
attr_reader :dirty, :json
SCHEDULE_TEMPLATE = {
:schedule => {
File schedule.rb
has 351 lines of code (exceeds 250 allowed). Consider refactoring. Open
require_relative '../rest/resource'
require_relative '../mixins/rest_resource'
require_relative '../helpers/global_helpers'
require_relative 'execution'
Method create
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
def create(process_id, trigger, executable, options = {})
c, project = GoodData.get_client_and_project(options)
fail 'Process ID has to be provided' if process_id.blank?
- 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 create
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
def create(process_id, trigger, executable, options = {})
c, project = GoodData.get_client_and_project(options)
fail 'Process ID has to be provided' if process_id.blank?
Method save
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def save
fail 'A timezone has to be provided' if timezone.blank?
fail 'Schedule type has to be provided' if schedule_type.blank?
rewrite_deprecated_params
if @dirty
- 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 executions
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def executions
return nil unless @json
url = @json['schedule']['links']['executions']
Enumerator.new do |y|
loop do
- 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"