Showing 1,401 of 1,401 total issues
Class Base
has 22 methods (exceeds 20 allowed). Consider refactoring. Open
class Base
# Class name to be logged
attr_accessor :name, :filter, :log_hooks
include Sapience::LogMethods
Method has too many lines. [15/10] Open
def handle_raise
begin
yield
rescue StandardError => e
if e.class.name =~ %r{NotFound}
- Read upRead up
- Exclude checks
This cop checks if the length of a method exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable.
Method has too many lines. [15/10] Open
def params # rubocop:disable AbcSize
{
method: request.request_method,
request_path: request.path,
format: request_format(request.env),
- Read upRead up
- Exclude checks
This cop checks if the length of a method exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable.
Method has too many lines. [14/10] Open
def extract_formatter(formatter, &block)
if formatter.is_a?(Symbol) || formatter.is_a?(String)
Sapience.constantize_symbol(formatter, "Sapience::Formatters").new
elsif formatter.is_a?(Hash) && !formatter.empty?
fmt, options = formatter.first
- Read upRead up
- Exclude checks
This cop checks if the length of a method exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable.
Method has too many lines. [14/10] Open
def log(log, message = nil, progname = nil, &block)
# Compatibility with ::Logger
return add(log, message, progname, &block) unless log.is_a?(Sapience::Log)
if @@appender_thread
@@appender_thread << lambda do
- Read upRead up
- Exclude checks
This cop checks if the length of a method exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable.
Method has too many lines. [14/10] Open
def call(log, _logger) # rubocop:disable AbcSize, PerceivedComplexity, CyclomaticComplexity
# Date & time
message = time_format.nil? ? "" : "#{format_time(log.time)} "
# Log level and process info
- Read upRead up
- Exclude checks
This cop checks if the length of a method exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable.
Method has too many lines. [13/10] Open
def started_request_message(request) # rubocop:disable AbcSize
{
message: "Started #{request.request_method} #{request.filtered_path}",
method: request.request_method,
path: request.filtered_path,
- Read upRead up
- Exclude checks
This cop checks if the length of a method exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable.
Method has too many lines. [13/10] Open
def call!(env)
@env = env
before
handle_raise do
- Read upRead up
- Exclude checks
This cop checks if the length of a method exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable.
Method has too many lines. [13/10] Open
def request(payload) # rubocop:disable AbcSize
{
method: payload[:method].upcase,
request_path: request_path(payload),
format: format(payload),
- Read upRead up
- Exclude checks
This cop checks if the length of a method exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable.
Method has too many lines. [13/10] Open
def self.flush # rubocop:disable AbcSize
return unless appender_thread
appender_thread << lambda do
Sapience.appenders.each do |appender|
next unless appender.valid?
- Read upRead up
- Exclude checks
This cop checks if the length of a method exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable.
Method has too many lines. [12/10] Open
def change
create_table :posts do |t|
t.string :title
t.string :body
t.belongs_to :author, foreign_key: {
- Read upRead up
- Exclude checks
This cop checks if the length of a method exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable.
Method has too many lines. [12/10] Open
def record(event) # rubocop:disable AbcSize, CyclomaticComplexity, PerceivedComplexity
return unless record?
payload = event.payload
name = payload[:name]
- Read upRead up
- Exclude checks
This cop checks if the length of a method exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable.
Method has too many lines. [12/10] Open
def self.included(base)
base.class_eval do
# Map :unknown to :error
alias_method :unknown, :error # :nodoc:
alias_method :unknown?, :error? # :nodoc:
- Read upRead up
- Exclude checks
This cop checks if the length of a method exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable.
Method has too many lines. [12/10] Open
def _deep_transform_keyz_in_object!(object, &block)
case object
when Hash
object.keys.each do |key|
value = object.delete(key)
- Read upRead up
- Exclude checks
This cop checks if the length of a method exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable.
Method has too many lines. [12/10] Open
def self.environment
@@environment ||=
ENV.fetch(SAPIENCE_ENV) do
ENV.fetch(RAILS_ENV) do
ENV.fetch(RACK_ENV) do
- Read upRead up
- Exclude checks
This cop checks if the length of a method exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable.
Method has too many lines. [12/10] Open
def self.close
return unless appender_thread
appender_thread << lambda do
Sapience.appenders.each do |appender|
next unless appender.valid?
- Read upRead up
- Exclude checks
This cop checks if the length of a method exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable.
Method has too many lines. [12/10] Open
def initialize(klass, level = nil, filter = nil, log_hooks = [])
# Support filtering all messages to this logger using a Regular Expression
# or Proc
fail ArgumentError, ":filter must be a Regexp or Proc" unless filter.nil? || filter.is_a?(Regexp) || filter.is_a?(Proc)
- Read upRead up
- Exclude checks
This cop checks if the length of a method exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable.
Method has too many lines. [11/10] Open
def stop_child # rubocop:disable AbcSize
puts "Trying to stop #{start_command}, pid: #{worker_pid}"
# send TERM and wait for exit
Process.kill("TERM", worker_pid)
- Read upRead up
- Exclude checks
This cop checks if the length of a method exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable.
Method has too many lines. [11/10] Open
def exception(payload)
if payload[:exception]
exception, message = payload[:exception]
message ||= exception.message
status = ActionDispatch::ExceptionWrapper.status_code_for_exception(exception)
- Read upRead up
- Exclude checks
This cop checks if the length of a method exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable.
Method has too many lines. [11/10] Open
def level_to_index(level)
return if level.nil?
case level
when Symbol
- Read upRead up
- Exclude checks
This cop checks if the length of a method exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable.