Class WebRunner
has 32 methods (exceeds 20 allowed). Consider refactoring. Open
class WebRunner
attr_reader :app, :app_name, :filesystem_friendly_app_name,
:rack_handler, :port, :options, :args
PORT = 5678
File web_runner.rb
has 301 lines of code (exceeds 250 allowed). Consider refactoring. Open
require 'open-uri'
require 'logger'
require 'optparse'
require 'fileutils'
require 'rack'
Method setup_rack_handler
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
def setup_rack_handler
# First try to set Rack handler via a special hook we honor
@rack_handler = if @app.respond_to?(:detect_rack_handler)
@app.detect_rack_handler
- 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 12 (exceeds 5 allowed). Consider refactoring. Open
def initialize(*runtime_args)
@options = runtime_args.last.is_a?(Hash) ? runtime_args.pop : {}
self.class.logger.level = options[:debug] ? Logger::DEBUG : Logger::INFO
- 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 start
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def start(path = launch_path)
logger.info "Running with Windows Settings" if WINDOWS
logger.info "Running with JRuby" if JRUBY
logger.info "Starting '#{app_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 find_port
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def find_port
if @port = options[:port]
announce_port_attempted
unless port_open?
- 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"