Updated

app/lib / quiet_logger.rb

A
27 lines of codes
4 methods
4.7 complexity/method
1 churn
18.93 complexity
0 duplications
class QuietLogger
  1. QuietLogger has no descriptive comment
attr_reader :app, :options, :paths def initialize(app, options = {}) @app = app @options = options @paths = Array(options[:paths]) end def call(env) if silence_request?(env) logger.silence { app.call(env) }
  1. QuietLogger#call calls 'app.call(env)' 2 times Locations: 0 1
else app.call(env)
  1. QuietLogger#call calls 'app.call(env)' 2 times Locations: 0 1
end end private def silence_request?(env) paths.any? { |path| path === env['PATH_INFO'] } end def logger
  1. QuietLogger#logger doesn't depend on instance state (maybe move it to another class?)
Rails.logger end end