Showing 15 of 15 total issues
Class Configuration
has 36 methods (exceeds 20 allowed). Consider refactoring. Open
class Configuration
def user_identifier
@user_identifier ||= :id
end
Class Base
has 27 methods (exceeds 20 allowed). Consider refactoring. Open
class Base
include Logging
def self.accepts?(env)
Class Synchronization
has 23 methods (exceeds 20 allowed). Consider refactoring. Open
class Synchronization
def self.all_users
singleton.all_users
end
Class BaseController
has 23 methods (exceeds 20 allowed). Consider refactoring. Open
class BaseController
# We need process_action to be in a module loaded before AbstractController::Callbacks
# to get inheritance properly
module Metal
Method synchronize!
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
def synchronize!
unless @synchronizing
@server_token = generate_server_token
register_server(@server_token)
- 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 filter_channel
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def filter_channel(event)
actions = []
actions << Fiber.new do
begin
log_event(event) do
- 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 10 (exceeds 5 allowed). Consider refactoring. Open
def initialize(event_name, options={})
case event_name
when String
namespace = event_name.split('.')
@name = namespace.pop.to_sym
- 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 schedule_dequeue
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def schedule_dequeue
return unless @body_callback
EM.next_tick do
next unless c = @queue.shift
@body_callback.call(c)
- 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 synchronize!
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
def synchronize!
unless @synchronizing
@server_token = generate_server_token
register_server(@server_token)
Method actual_for_spec_message
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def self.actual_for_spec_message(event, success)
if event.triggered?
if success.nil?
"triggered message #{actual_data_for_spec_message(event.data)}"
else
- 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 each
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def each(&block)
if WebsocketRails.synchronize?
users_hash = Synchronization.all_users || return
users_hash.each do |identifier, user_json|
connection = remote_connection_from_json(identifier, user_json)
- 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 new_from_json
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def self.new_from_json(encoded_data, connection)
case encoded_data
when String
event_name, data = JSON.parse encoded_data
- 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 routes_for
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def routes_for(event, event_namespace=nil, &block)
# Grab the first level namespace from the namespace array
# and remove it from the copy.
event_namespace = copy_event_namespace( event, event_namespace ) || return
- 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 verify_route
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def self.verify_route(event, target, non_exclusive)
raise ArgumentError, 'event must be of type SpecHelperEvent' unless event.is_a? WebsocketRails::SpecHelperEvent
target_class, target_method = WebsocketRails::TargetValidator.validate_target target
- 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 dispatch
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def dispatch(event)
return if event.is_invalid?
if event.is_channel?
filter_channel(event)
- 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"