File httpsequence.py
has 621 lines of code (exceeds 250 allowed). Consider refactoring. Open
import abc
import re
import sys
import gevent
HttpSequence
has 28 functions (exceeds 20 allowed). Consider refactoring. Open
class HttpSequence(BaseSequence):
__metaclass__ = abc.ABCMeta
def __init__(self,
settings=None,
Function var_from_regex
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def var_from_regex(self,
name,
regex,
target='body',
instances='first',
- 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 http_request
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def http_request(self,
url,
method='GET',
is_resource=False,
response_hooks=None,
- 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 __init__
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(self,
Function http_request
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def http_request(self,
Function put
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def put(self,
Function async_http_request
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def async_http_request(self,
Function delete
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def delete(self,
Function get
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def get(self,
Function post
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def post(self,
Function var_from_regex
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def var_from_regex(self,
Function patch
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def patch(self,
Function _request_log_hook
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def _request_log_hook(self, is_async=False, is_resource=False):
def _request_log_hook_gen(response, **kwargs):
# Log request status in inline logger
if is_async:
str_inline_message = \
- 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"