Method stream
has a Cognitive Complexity of 51 (exceeds 5 allowed). Consider refactoring. Open
def self.stream
Thread.abort_on_exception = true
auto_reconnect_after = 180
delay_before_reconnect = 70
- 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 stream
has 89 lines of code (exceeds 25 allowed). Consider refactoring. Open
def self.stream
Thread.abort_on_exception = true
auto_reconnect_after = 180
delay_before_reconnect = 70
File channel.rb
has 283 lines of code (exceeds 250 allowed). Consider refactoring. Open
class Channel < ApplicationModel
include Channel::Assets
include Channel::Area::Whatsapp
belongs_to :group, optional: true
Method refresh_xoauth2!
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def refresh_xoauth2!(force: false)
return if options.dig(:auth, :type) != 'XOAUTH2'
return if !force && ApplicationHandleInfo.current == 'application_server'
result = ExternalCredential.refresh_token(options[:auth][:provider], options[:auth])
- 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 fetch
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def fetch(force = false)
adapter = options[:adapter]
adapter_options = options
if options[:inbound] && options[:inbound][:adapter]
adapter = options[:inbound][:adapter]
- 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"