EventableSocketChannel
has 31 methods (exceeds 20 allowed). Consider refactoring. Open
public class EventableSocketChannel implements EventableChannel {
Selector selector;
SelectionKey channelKey;
SocketChannel channel;
File EventableSocketChannel.java
has 289 lines of code (exceeds 250 allowed). Consider refactoring. Open
/**
* $Id$
*
* Author:: Francis Cianfrocca (gmail: blackhedd)
* Homepage:: http://rubyeventmachine.com
Method writeOutboundData
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
public boolean writeOutboundData() throws IOException {
ByteBuffer[] bufs = new ByteBuffer[64];
int i;
long written, toWrite;
while (!outboundQ.isEmpty()) {
- 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 currentEvents
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
private int currentEvents() {
int events = 0;
if (bWatchOnly)
{
- 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 writeOutboundData
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
public boolean writeOutboundData() throws IOException {
ByteBuffer[] bufs = new ByteBuffer[64];
int i;
long written, toWrite;
while (!outboundQ.isEmpty()) {
Method scheduleOutboundData
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public void scheduleOutboundData (ByteBuffer bb) {
if (!bCloseScheduled && bb.remaining() > 0) {
if (sslEngine != null) {
try {
ByteBuffer b = ByteBuffer.allocate(32*1024); // TODO, preallocate this buffer.
- 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 dispatchInboundData
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public ByteBuffer dispatchInboundData (ByteBuffer bb) throws SSLException {
if (sslEngine != null) {
if (true) throw new RuntimeException ("TLS currently unimplemented");
System.setProperty("javax.net.debug", "all");
ByteBuffer w = ByteBuffer.allocate(32*1024); // TODO, WRONG, preallocate this buffer.
- 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 close
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public void close() {
if (channelKey != null) {
channelKey.cancel();
channelKey = null;
}
- 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"