Method handle_control
has 77 lines of code (exceeds 25 allowed). Consider refactoring. Open
def handle_control(pkt)
src_call, dst_call, tstamp, out_seq, inp_seq, itype = pkt.unpack('nnNCCC')
# Scrub the high bits out of the call IDs
src_call ^= 0x8000 if (src_call & 0x8000 != 0)
Method handle_control
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
def handle_control(pkt)
src_call, dst_call, tstamp, out_seq, inp_seq, itype = pkt.unpack('nnNCCC')
# Scrub the high bits out of the call IDs
src_call ^= 0x8000 if (src_call & 0x8000 != 0)
- 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 register
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
def register
self.client.send_regreq(self)
res = wait_for( Constants::IAX_SUBTYPE_REGAUTH, Constants::IAX_SUBTYPE_REGREJ )
return if not res
Method register
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def register
self.client.send_regreq(self)
res = wait_for( Constants::IAX_SUBTYPE_REGAUTH, Constants::IAX_SUBTYPE_REGREJ )
return if not res
- 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 dial
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def dial(number)
self.client.send_new(self, number)
res = wait_for(Constants::IAX_SUBTYPE_AUTHREQ, Constants::IAX_SUBTYPE_ACCEPT)
return if not res
- 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 dial
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
def dial(number)
self.client.send_new(self, number)
res = wait_for(Constants::IAX_SUBTYPE_AUTHREQ, Constants::IAX_SUBTYPE_ACCEPT)
return if not res
Avoid too many return
statements within this method. Open
return if not res
Avoid too many return
statements within this method. Open
return
Method wait_for
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def wait_for(*stypes)
begin
::Timeout.timeout( Constants::IAX_DEFAULT_TIMEOUT ) do
while (res = self.queue.pop )
if stypes.include?(res[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"