Showing 108 of 143 total issues
Method call
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def call(ex, context, sidekiq_config = nil)
return unless Sentry.initialized?
context_filter = Sentry::Sidekiq::ContextFilter.new(context)
- 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 retry_limit
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def retry_limit(context, sidekiq_config)
limit = context.dig(:job, "retry")
case limit
when Integer
- 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 detect_release
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def detect_release
return unless sending_allowed?
@release ||= ReleaseDetector.detect_release(project_root: project_root, running_on_heroku: running_on_heroku?)
- 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 capture_exception
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def capture_exception(exception, **options, &block)
if RUBY_PLATFORM == "java"
check_argument_type!(exception, ::Exception, ::Java::JavaLang::Throwable)
else
check_argument_type!(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 init
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def init(&block)
config = Configuration.new
yield(config) if block_given?
config.detect_release
apply_patches(config)
- 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 send_event
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def send_event(event, hint = nil)
return false unless configuration.sending_allowed?(event)
event = configuration.before_send.call(event, hint) if configuration.before_send
if event.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 compute_filename
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def compute_filename
return if abs_path.nil?
prefix =
if under_project_root? && in_app
- 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 is_rate_limited?
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def is_rate_limited?(data_category)
# check category-specific limit
category_delay = @rate_limits[data_category]
# check universal limit if not category limit
universal_delay = @rate_limits[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 register_patch
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def register_patch(key, patch = nil, target = nil, &block)
if patch && block
raise ArgumentError.new("Please provide either a patch and its target OR a block, but not both")
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 parse_span_description
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def parse_span_description(otel_span)
op = otel_span.name
description = otel_span.name
if (http_method = otel_span.attributes[SEMANTIC_CONVENTIONS::HTTP_METHOD])
- 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 finish
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def finish(hub: nil, end_timestamp: nil)
if hub
log_warn(
<<~MSG
Specifying a different hub in `Transaction#finish` will be deprecated in version 5.0.
- 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 add
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def add(name, started, _finished, _unique_id, data)
Method add
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def add(name, started, _finished, _unique_id, data)
Method initialize
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def initialize(file, number, method, module_name, in_app_pattern)
Method add
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def add(name, started, _finished, _unique_id, data)
Method new_job
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def new_job(name, interval_type, config, schedule, options)
Method from_exception
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def self.from_exception(exc, options = {}, &block)
exception_context = if exc.instance_variable_defined?(:@__raven_context)
exc.instance_variable_get(:@__raven_context)
elsif exc.respond_to?(:raven_context)
exc.raven_context
- 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 send_event
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def send_event(auth_header, data, options = {})
unless configuration.sending_allowed?
configuration.logger.debug("Event not sent: #{configuration.error_messages}")
return
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 rack_env=
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def rack_env=(env)
unless request || env.empty?
add_request_interface(env)
if @send_default_pii
- 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 valid?
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def valid?
return true if %w(server host path public_key project_id).all? { |k| public_send(k) }
if server
%w(server host path public_key project_id).map do |key|
- 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"