Showing 45 of 65 total issues
Function videos
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def videos(self, video_ids, multi_channel=False):
"""
Process VideoIDs and return listitems in a generator
:param video_ids: List of all the videos to show.
- 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 unittest_caller
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def unittest_caller(self, *args, **kwargs):
"""
Function to allow callbacks to be easily called from unittests.
Parent argument will be auto instantiated and passed to callback.
This basically acts as a constructor to callback.
- 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 _close
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def _close(self, listitem, isfolder): # type: (xbmcgui.ListItem, bool) -> None
if fanart and "fanart" not in self.raw_dict: # pragma: no branch
self.raw_dict["fanart"] = fanart
if "thumb" not in self.raw_dict: # pragma: no branch
self.raw_dict["thumb"] = icon
- 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 parse_args
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def parse_args(self, redirect=None):
"""Extract arguments given by Kodi"""
_, _, route, raw_params, _ = urlparse.urlsplit(redirect if redirect else sys.argv[0] + sys.argv[2])
self.selector = route if len(route) > 1 else "root"
self.handle = int(sys.argv[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"
Further reading
Function execute
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def execute(self, query, values=(), repeat=False): # type: (str, tuple, bool) -> sqlite3.Cursor
"""Execute SQL Query."""
try:
with self.conn:
# Automatically commits or rolls back on exception
- 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"