Method push_incoming_call
has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring. Open
def push_incoming_call(log)
return if log.destroyed?
return if @params[:event] != 'newCall'
return if @params[:direction] != 'in'
- 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 push_incoming_call
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
def push_incoming_call(log)
return if log.destroyed?
return if @params[:event] != 'newCall'
return if @params[:direction] != 'in'
Method push_open_ticket_screen
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
def push_open_ticket_screen(log)
return if log.destroyed?
return if @params[:event] != 'answer'
return if @params[:direction] != 'in'
Method caller_id_rewrite
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
def caller_id_rewrite(params)
return nil if params['direction'] != 'out'
return nil if params['event'] != 'newCall'
config_outbound = @config[:outbound]
Method caller_id_rewrite
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def caller_id_rewrite(params)
return nil if params['direction'] != 'out'
return nil if params['event'] != 'newCall'
config_outbound = @config[:outbound]
- 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 push_open_ticket_screen
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def push_open_ticket_screen(log)
return if log.destroyed?
return if @params[:event] != 'answer'
return if @params[:direction] != 'in'
- 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 process
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def process
# validate directions
result = direction_check
return result if result.present?
- 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
Avoid too many return
statements within this method. Open
return if !user.permissions?('cti.agent')
Avoid too many return
statements within this method. Open
return
Avoid too many return
statements within this method. Open
return {
action: 'set_caller_id',
params: {
from_caller_id: default_caller_id,
to_caller_id: params[:to],
Method push_open_ticket_screen_recipient
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def push_open_ticket_screen_recipient
# try to find answering which answered call
user = 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 reject_check
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def reject_check
return nil if @params['direction'] != 'in'
return nil if @params['event'] != 'newCall'
config_inbound = @config[:inbound] || {}
- 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"