Showing 15 of 25 total issues
Function parse_service_description
has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring. Open
def parse_service_description(etree):
from functools import partial
from .xmlutils import nstag
tag = partial(nstag, etree)
- 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 locate_by_ssdp
has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring. Open
def locate_by_ssdp(service_types=None, host=None, timeout=5):
from greyupnp.ssdp import search as ssdp_search
if service_types is None:
from pyinthesky import SERVICE_TYPES
- 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 locate_by_resource
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
def locate_by_resource(host, port=None, timeout=5):
from .transport import Transport
t = Transport(host, port, default_timeout=timeout)
# How many services do we need to find?
- 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 bind_service_methods
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
def bind_service_methods(target, services=None, bind_to_class=False):
if services is None:
services = [target]
from pyinthesky import meta
- 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 invoke
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def invoke(self, action_name, *args, **kwargs):
from pyinthesky import minisoap, miniupnp, utils, xmlutils
# Find the action definition and get the argument order.
- 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 treat_attributes
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def treat_attributes(attrdict):
res = {}
for key, value in attrdict.items():
# Drop X_ prefix.
- 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 method_sig_wrapper
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def method_sig_wrapper(target, name, varnames, defaults=None,
make_method=False):
# First of all, defaults will need to be a tuple rather than a
# dictionary.
- 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 create_validator
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def create_validator(objdesc, varname):
args, kw = [], {}
from formencode import validators as validmod
if objdesc.pytype is six.text_type:
- 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 get_recordings
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def get_recordings(self, user_only=True):
# Using Browse('BrowseDirectChildren', ObjectID=0), you can determine the valid
# object ID's to use, which are:
# 3 - "pvr"
- 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 a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def __init__(self, host=None, port=None, root=None, fixed_root=False, default_timeout=10):
if root and host:
raise ValueError('cannot specify root as well as host')
if root and '://' not in root:
err = 'root must include protocol - e.g. "http://host:port/", not "%r"'
- 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 soap_request
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def soap_request(self, location, schema, method, soapbody,
Function simple_elements_dict
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def simple_elements_dict(node):
d = {}
for attrname, attrvalue in node.items():
d[attrname] = attrvalue
for childnode in list(node):
- 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 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(self, host=None, port=None, root=None, fixed_root=False, default_timeout=10):
Function method_sig_wrapper
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def method_sig_wrapper(target, name, varnames, defaults=None,
Avoid too many return
statements within this function. Open
return UPnPError(code, desc)