Showing 23 of 23 total issues
Method extended
has 93 lines of code (exceeds 25 allowed). Consider refactoring. Open
def self.extended(base)
base.class_eval do
send(:include, ExceptionNotifier::BacktraceCleaner)
# Append application view path to the ExceptionNotifier lookup context.
Method initialize
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
def initialize(app, options = {})
@app = app
ExceptionNotifier.tap do |en|
en.ignored_exceptions = options.delete(:ignore_exceptions) if options.key?(:ignore_exceptions)
- 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 compose_subject
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def compose_subject
subject = @options[:email_prefix].to_s.dup
subject << "(#{@options[:accumulated_errors_count]} times)" if @options[:accumulated_errors_count].to_i > 1
subject << "#{@kontroller.controller_name}##{@kontroller.action_name}" if include_controller?
subject << " (#{@exception.class})"
- 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 initialize
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
def initialize(app, options = {})
@app = app
ExceptionNotifier.tap do |en|
en.ignored_exceptions = options.delete(:ignore_exceptions) if options.key?(:ignore_exceptions)
Method call
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
def call(exception, options = {})
env = options[:env]
options = options.reverse_merge(@default_options)
url = options.delete(:url)
Method initialize
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def initialize(options)
super
begin
api_token = options.delete(:api_token)
room_name = options.delete(:room_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 notify_exception
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def notify_exception(exception, options = {}, &block)
return false if ignored_exception?(options[:ignore_exceptions], exception)
return false if ignored?(exception, options)
if error_grouping
- 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
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
def call(exception, options = {})
@options = options.merge(@default_options)
@exception = exception
@backtrace = exception.backtrace ? clean_backtrace(exception) : nil
Method information_from_options
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def information_from_options(exception_class, options)
errors_count = options[:accumulated_errors_count].to_i
measure_word = if errors_count > 1
errors_count
- 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
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def call(exception, options = {})
@options = options.merge(@default_options)
@exception = exception
@backtrace = exception.backtrace ? clean_backtrace(exception) : 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 call
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def call(env)
_, headers, = response = @app.call(env)
if !@ignore_cascade_pass && headers['X-Cascade'] == 'pass'
msg = "This exception means that the preceding Rack middleware set the 'X-Cascade' header to 'pass' -- 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 build_message
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def build_message(exception, options)
exception_name = accumulated_exception_name(exception, options)
if options[:env].nil?
text = "#{exception_name} occured in background\n"
- 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 compose_email
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def compose_email
set_data_variables
subject = compose_subject
name = @env.nil? ? 'background_exception_notification' : 'exception_notification'
exception_recipients = maybe_call(@options[:exception_recipients])
- 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 data_for_exception_notifier
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def data_for_exception_notifier(exception = nil)
data = {}
data[:error_class] = exception.class.name if exception
data[:error_message] = exception.message if exception
- 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 exception_notification
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def exception_notification(env, exception, options = {}, default_options = {})
load_custom_views
@env = env
@exception = exception
- 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_custom_views
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def load_custom_views
return unless defined?(Rails) && Rails.respond_to?(:root)
prepend_view_path Rails.root.nil? ? 'app/views' : "#{Rails.root}/app/views"
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
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def call(exception, options = {})
env = options[:env]
options = options.reverse_merge(@default_options)
url = options.delete(:url)
- 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 notifier_ignored?
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def notifier_ignored?(exception, options, notifier:)
return false unless @@by_notifier_ignores.key?(notifier)
condition = @@by_notifier_ignores[notifier]
condition.call(exception, options)
- 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 parse_options
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def parse_options(options)
nick = options.fetch(:nick, 'ExceptionNotifierBot')
password = options[:password] ? ":#{options[:password]}" : nil
domain = options.fetch(:domain, nil)
port = options[:port] ? ":#{options[:port]}" : 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 initialize
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def initialize(options)
super
raise ArgumentError, "You must provide 'region' option" unless options[:region]
raise ArgumentError, "You must provide 'access_key_id' option" unless options[:access_key_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"