Showing 104 of 363 total issues
File main.py
has 439 lines of code (exceeds 250 allowed). Consider refactoring. Open
'''
qobuz.node.inode.main
~~~~~~~~~~~~~~~~~~~~~
:part_of: kodi-qobuz
INode
has 46 functions (exceeds 20 allowed). Consider refactoring. Open
class INode(object):
'''Our base node, every node must inherit or mimic is behaviour
Calling build_down on a node start the build process
- pre_build_down: Retrieve data (disk, internet...) and store
File main.py
has 419 lines of code (exceeds 250 allowed). Consider refactoring. Open
'''
qobuz.node.playlist
~~~~~~~~~~~~~~~~~~
:part_of: kodi-qobuz
RawApi
has 41 functions (exceeds 20 allowed). Consider refactoring. Open
class RawApi(object):
def __init__(self):
self.appid = '285473059' # XBMC
self.version = '0.2'
self.baseUrl = 'http://www.qobuz.com/api.json'
File favorite.py
has 352 lines of code (exceeds 250 allowed). Consider refactoring. Open
'''
qobuz.node.favorite
~~~~~~~~~~~~~~~~~~~
:part_of: kodi-qobuz
Node_playlist
has 33 functions (exceeds 20 allowed). Consider refactoring. Open
class Node_playlist(INode):
def __init__(self, parent=None, parameters=None, data=None):
parameters = {} if parameters is None else parameters
super(Node_playlist, self).__init__(
parent=parent, parameters=parameters, data=data)
File raw.py
has 323 lines of code (exceeds 250 allowed). Consider refactoring. Open
'''
qobuz.api.raw
~~~~~~~~~~~~~
Our base api, all method are mapped like in <endpoint>_<method>
Node_track
has 29 functions (exceeds 20 allowed). Consider refactoring. Open
class Node_track(INode):
def __init__(self, parent=None, parameters=None, data=None):
parameters = {} if parameters is None else parameters
super(Node_track, self).__init__(parent=parent,
parameters=parameters,
Function cached
has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring. Open
def cached(self, f, *a, **ka):
"""Decorator
All positional and named parameters are used to make the key
"""
that = self
- 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 list_albums
has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring. Open
def list_albums(self, qnt, qid):
''' List albums givent a node type and a node id
'''
album_ids = {}
nodes = []
- 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
Node_favorite
has 25 functions (exceeds 20 allowed). Consider refactoring. Open
class Node_favorite(INode):
def __init__(self, parent=None, parameters=None, data=None):
parameters = {} if parameters is None else parameters
super(Node_favorite, self).__init__(
parent=parent, parameters=parameters, data=data)
Function list_image
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
def list_image(data, desired_size='xlarge'):
all_size = [desired_size]
_ = [all_size.append(s) for s in ['xlarge', 'large', 'small', 'thumbnail']]
result = []
- 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 main.py
has 262 lines of code (exceeds 250 allowed). Consider refactoring. Open
'''
qobuz.node.track.main
~~~~~~~~~~~~~~~~~~~~~
:part_of: kodi-qobuz
Function make_url
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
def make_url(self, **ka):
'''Generate URL to navigate between nodes
Nodes with custom parameters must override this method
@todo: Ugly need rewrite =]
'''
- 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 stream_format
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
def stream_format(self, track=None):
if self.is_free_account():
return audio_format['mp3']
stream_type = config.app.registry.get('streamtype')
if track is not 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 get_image_from_storage
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
def get_image_from_storage(self):
desired_size = config.app.registry.get('image_default_size',
default=None)
images = []
if self.nid is not 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 get
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
def get(self, *a, **ka):
"""Wrapper that cache query to our raw api. We are enforcing format
because cache entry key are made based on *a and **ka parameters.
('artist/get' and '/artist/get' will generate different key)
Path are mapped to raw api and raise InvalidQuery on error
- 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 _api_request
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
def _api_request(self, params, uri, **opt):
'''Qobuz API HTTP get request
Arguments:
params: parameters dictionary
uri : service/method
- 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 __getattr__
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def __getattr__(self, attr):
if attr.startswith('get_') and hasattr(self, 'propsMap'):
key = attr[4:]
if key in self.propsMap:
prop = self.propsMap.get(key)
- 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 _add_tracks
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def _add_tracks(cls, playlist_id, nodes):
if len(nodes) < 1:
logger.warn('Empty list...')
return False
step = 50
- 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"