Showing 121 of 147 total issues
Method isWritable
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
void isWritable (SelectionKey k) {
EventableChannel ec = (EventableChannel) k.attachment();
long b = ec.getBinding();
if (ec.isWatchOnly()) {
- 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 bind_connect
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def self.bind_connect bind_addr, bind_port, server, port=nil, handler=nil, *args
Method run_deferred_callbacks
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def self.run_deferred_callbacks
until (@resultqueue ||= []).empty?
result,cback = @resultqueue.pop
cback.call result if cback
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 receive_line
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def receive_line line
@stomp_initialized || init_message_reader
@stomp_message.consume_line(line) {|outcome|
if outcome.first == :sized_text
set_text_mode outcome[1]
- 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_cmd
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def send_cmd cmd, key, flags = 0, exptime = 0, bytes = 0, noreply = false
Method receive_chunk_header
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def receive_chunk_header ln
if ln.length > 0
chunksize = ln.to_i(16)
if chunksize > 0
@conn.set_text_mode(ln.to_i(16))
- 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 handshake_complete?
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def handshake_complete?
if !@handshake_complete && io.respond_to?(:state)
if io.state =~ /^SSLOK/
@handshake_complete = true
EventMachine::event_callback uuid, SslHandshakeCompleted, ""
- 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 sendDatagram
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
void sendDatagram (long sig, byte[] data, int length, String recipAddress, int recipPort);
Method send_datagram
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def send_datagram target, data, datalength, host, port
Method connect
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def self.connect server, port=nil, handler=nil, *args, &blk
Method send_datagram
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def self.send_datagram sig, data, length, address, port
Method sendDatagram
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
public void sendDatagram(long sig, byte[] data, int length, String recipAddress, int recipPort)
Method start_server
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def self.start_server server, port=nil, handler=nil, *args, &block
Method sendDatagram
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
public void sendDatagram (long sig, byte[] data, int length, String recipAddress, int recipPort) {
Method removeUnboundConnections
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
void removeUnboundConnections() {
ListIterator<Long> iter = UnboundConnections.listIterator(0);
while (iter.hasNext()) {
long b = iter.next();
- 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 process_starttls
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def process_starttls
if @@parms[:starttls]
if @state.include?(:starttls)
send_data "503 TLS Already negotiated\r\n"
elsif ! @state.include?(:ehlo)
- 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 checkIO
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
void checkIO() {
long timeout;
if (NewConnections.size() > 0) {
timeout = -1;
- 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 request
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def request args
args[:host_header] = @host_header unless args.has_key?(:host_header)
args[:authorization] = @authorization unless args.has_key?(:authorization)
r = Request.new self, args
if @closed
- 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 addNewConnections
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
void addNewConnections() {
ListIterator<EventableSocketChannel> iter = DetachedConnections.listIterator(0);
while (iter.hasNext()) {
EventableSocketChannel ec = iter.next();
ec.cleanup();
- 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 attach_io
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def EventMachine::attach_io io, watch_mode, handler=nil, *args
klass = klass_from_handler(Connection, handler, *args)
if !watch_mode and klass.public_instance_methods.any?{|m| [:notify_readable, :notify_writable].include? m.to_sym }
raise ArgumentError, "notify_readable/writable with EM.attach is not supported. Use EM.watch(io){ |c| c.notify_readable = true }"
- 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"