Showing 27 of 88 total issues
Function run_custom
has a Cognitive Complexity of 67 (exceeds 5 allowed). Consider refactoring. Open
def run_custom(self, params):
if 'action' in params:
icon = os.path.join(self.addon.getAddonInfo('path'), 'icon.png')
if params['action'] == sosac.LIBRARY_ACTION_REMOVE_SUBSCRIPTION:
subs = self.get_subs()
- 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_item
has a Cognitive Complexity of 45 (exceeds 5 allowed). Consider refactoring. Open
def add_item(self, params):
error = False
if not 'refresh' in params:
params['refresh'] = str(self.getSetting("refresh_time"))
sub = {'name': params['name'], 'refresh': params[
- 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 sosac.py
has 434 lines of code (exceeds 250 allowed). Consider refactoring. Open
# -*- coding: UTF-8 -*-
# /*
# * Copyright (C) 2015 Libor Zoubek + jondas
# *
# *
Function evalSchedules
has a Cognitive Complexity of 34 (exceeds 5 allowed). Consider refactoring. Open
def evalSchedules(self):
if not self.scanRunning() and not self.isPlaying():
notified = False
util.info("SOSAC Loading subscriptions")
subs = self.get_subs()
- 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_videos
has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring. Open
def list_videos(self, url, filter=None, order_by=0, library=False):
result = []
data = util.request(url)
json_video_array = json.loads(data)
for video in json_video_array:
- 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 sutils.py
has 336 lines of code (exceeds 250 allowed). Consider refactoring. Open
import util
import xbmcprovider
import xbmcutil
import xbmcvfs
import xbmcgui
SosacContentProvider
has 30 functions (exceeds 20 allowed). Consider refactoring. Open
class SosacContentProvider(ContentProvider):
ISO_639_1_CZECH = None
par = None
def __init__(self, username=None, password=None, filter=None, reverse_eps=False,
Function list_episodes
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
def list_episodes(self, url):
result = []
data = util.request(url)
json_series = json.loads(data)
for series in json_series:
- 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_series_letter
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
def list_series_letter(self, url, load_subs=True):
result = []
data = util.request(url)
json_list = json.loads(data)
subs = self.get_subscriptions() if load_subs else {}
- 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_item_to_library
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def add_item_to_library(self, item_path, item_url):
error = False
new = False
if item_path:
item_path = xbmc.translatePath(item_path)
- 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
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def list(self, url, filter=None):
util.info("Examining url " + url)
list_result = None
if FILTER_URL_PARAM in url:
- 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
Avoid deeply nested control flow statements. Open
if self.dialog.iscanceled():
return
if 'progress' in show:
Avoid deeply nested control flow statements. Open
if self.dialog.iscanceled():
return
if 'progress' in video:
Avoid deeply nested control flow statements. Open
if 'progress' in video:
self.dialog.update(video['progress'])
else:
item = video['menu'][sosac.LIBRARY_MENU_ITEM_ADD]
item["update"] = True
Avoid deeply nested control flow statements. Open
if 'progress' in video:
self.dialog.update(video['progress'])
else:
item = video['menu'][sosac.LIBRARY_MENU_ITEM_ADD]
item["update"] = True
Avoid deeply nested control flow statements. Open
if 'progress' in show:
self.dialog.update(show['progress'])
else:
item = show['menu'][sosac.LIBRARY_MENU_ITEM_ADD]
item["update"] = True
Avoid deeply nested control flow statements. Open
if next_check < time.time():
if not notified:
self.showNotification(
'Subscription', 'Chcecking')
notified = True
Avoid deeply nested control flow statements. Open
if self.dialog.iscanceled():
return
if 'progress' in video:
Function __init__
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(self, username=None, password=None, filter=None, reverse_eps=False,
Function http_error_302
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def http_error_302(self, req, fp, code, msg, headers):