Showing 153 of 245 total issues
File protocol.py
has 1036 lines of code (exceeds 250 allowed). Consider refactoring. Open
#
# Copyright (C) 2010-2017 Samuel Abels
# The MIT License (MIT)
#
# Permission is hereby granted, free of charge, to any person obtaining
File telnetlib.py
has 621 lines of code (exceeds 250 allowed). Consider refactoring. Open
#
# Copyright (C) 2010-2017 Samuel Abels
# The MIT License (MIT)
#
# Permission is hereby granted, free of charge, to any person obtaining
File queue.py
has 601 lines of code (exceeds 250 allowed). Consider refactoring. Open
#
# Copyright (C) 2010-2017 Samuel Abels
# The MIT License (MIT)
#
# Permission is hereby granted, free of charge, to any person obtaining
File account.py
has 589 lines of code (exceeds 250 allowed). Consider refactoring. Open
#
# Copyright (C) 2010-2017 Samuel Abels
# The MIT License (MIT)
#
# Permission is hereby granted, free of charge, to any person obtaining
Protocol
has 60 functions (exceeds 20 allowed). Consider refactoring. Open
class Protocol(object):
"""
This is the base class for all protocols; it defines the common portions
of the API.
Function process_rawq
has a Cognitive Complexity of 47 (exceeds 5 allowed). Consider refactoring. Open
def process_rawq(self):
"""Transfer from raw queue to cooked queue.
Set self.eof when connection is closed. Don't block unless in
the midst of an IAC sequence.
- 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
Function _waitfor
has a Cognitive Complexity of 45 (exceeds 5 allowed). Consider refactoring. Open
def _waitfor(self, relist, timeout=None, flush=False, cleanup=None):
re = None
relist = relist[:]
indices = list(range(len(relist)))
search_window_size = 150
- 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
Function value
has a Cognitive Complexity of 41 (exceeds 5 allowed). Consider refactoring. Open
def value(self, context):
# Special behavior where we only have one term.
if self.op is None:
return self.lft.value(context)
elif self.op == 'not':
- 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
File mail.py
has 374 lines of code (exceeds 250 allowed). Consider refactoring. Open
#
# Copyright (C) 2010-2017 Samuel Abels
# The MIT License (MIT)
#
# Permission is hereby granted, free of charge, to any person obtaining
Function _app_authenticate
has a Cognitive Complexity of 33 (exceeds 5 allowed). Consider refactoring. Open
def _app_authenticate(self,
account,
password,
flush=True,
bailout=False):
- 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
File ssh2.py
has 352 lines of code (exceeds 250 allowed). Consider refactoring. Open
#
# Copyright (C) 2010-2017 Samuel Abels
# The MIT License (MIT)
#
# Permission is hereby granted, free of charge, to any person obtaining
File crypt.py
has 346 lines of code (exceeds 250 allowed). Consider refactoring. Open
#
# Copyright (C) 2010-2017 Samuel Abels
# The MIT License (MIT)
#
# Permission is hereby granted, free of charge, to any person obtaining
Function __init__
has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring. Open
def __init__(self, lexer, parser, parent, *args, **kwargs):
Scope.__init__(self, 'Template', lexer, parser, parent, **kwargs)
lexer.set_grammar(grammar_c)
# print("Opening Scope:", lexer.token())
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
Function _open_posix_shell
has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring. Open
def _open_posix_shell(self,
channel,
key_handlers,
handle_window_size):
# We need to make sure to use an unbuffered stdin, else multi-byte
- 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
Queue
has 31 functions (exceeds 20 allowed). Consider refactoring. Open
class Queue(object):
"""
Manages hosts/tasks, accounts, connections, and threads.
"""
File host.py
has 325 lines of code (exceeds 250 allowed). Consider refactoring. Open
#
# Copyright (C) 2010-2017 Samuel Abels
# The MIT License (MIT)
#
# Permission is hereby granted, free of charge, to any person obtaining
Function __init__
has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring. Open
def __init__(self, lexer, parser, parent):
Scope.__init__(self, 'Code', lexer, parser, parent)
lexer.set_grammar(grammar_c)
while True:
lexer.skip(['whitespace', 'newline'])
- 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
Telnet
has 28 functions (exceeds 20 allowed). Consider refactoring. Open
class Telnet(object):
"""Telnet interface class.
An instance of this class represents a connection to a telnet
Pipeline
has 28 functions (exceeds 20 allowed). Consider refactoring. Open
class Pipeline(object):
"""
A collection that is similar to Python's Queue object, except
it also tracks items that are currently sleeping or in progress.
SSH2
has 28 functions (exceeds 20 allowed). Consider refactoring. Open
class SSH2(Protocol):
"""
The secure shell protocol version 2 adapter, based on Paramiko.
"""