asciidisco/plugin.video.netflix

View on GitHub

Showing 673 of 673 total issues

Cyclomatic complexity is too high in method do_GET. (12)
Open

# pylint: disable=invalid-name
def do_GET(self):
"""Loads the XML manifest for the requested resource"""
url = urlparse(self.path)
params = parse_qs(url.query)

Identical blocks of code found in 2 locations. Consider refactoring.
Open

if plaintext.get('compressionalgo') == 'GZIP':
decoded_data = base64.standard_b64decode(data)
data = zlib.decompress(decoded_data, 16 + zlib.MAX_WBITS)
else:
data = base64.standard_b64decode(data)
Severity: Major
Found in resources/lib/MSLv2.py and 1 other location - About 2 hrs to fix
resources/lib/MSL.py on lines 294..298

Identical blocks of code found in 2 locations. Consider refactoring.
Open

if plaintext.get('compressionalgo') == 'GZIP':
decoded_data = base64.standard_b64decode(data)
data = zlib.decompress(decoded_data, 16 + zlib.MAX_WBITS)
else:
data = base64.standard_b64decode(data)
Severity: Major
Found in resources/lib/MSL.py and 1 other location - About 2 hrs to fix
resources/lib/MSLv2.py on lines 325..329

Identical blocks of code found in 2 locations. Consider refactoring.
Open

self.nx_common.log(msg='Expiration time: Key:' + str(valid_until) + ', Now:' + str(present) + ', Diff:' + str(difference.total_seconds()))
Severity: Major
Found in resources/lib/MSLv2.py and 1 other location - About 2 hrs to fix
resources/lib/MSL.py on lines 694..694

Identical blocks of code found in 2 locations. Consider refactoring.
Open

self.nx_common.log(msg='Expiration time: Key:' + str(valid_until) + ', Now:' + str(present) + ', Diff:' + str(difference.total_seconds()))
Severity: Major
Found in resources/lib/MSL.py and 1 other location - About 2 hrs to fix
resources/lib/MSLv2.py on lines 722..722

Similar blocks of code found in 2 locations. Consider refactoring.
Open

@log
def remove_from_list(self, video_id):
"""Remove an item from 'My List' & refresh the view
 
Parameters
Severity: Major
Found in resources/lib/Navigation.py and 1 other location - About 2 hrs to fix
resources/lib/Navigation.py on lines 640..654

Similar blocks of code found in 2 locations. Consider refactoring.
Open

@log
def add_to_list(self, video_id):
"""Add an item to 'My List' & refresh the view
 
Parameters
Severity: Major
Found in resources/lib/Navigation.py and 1 other location - About 2 hrs to fix
resources/lib/Navigation.py on lines 624..638

Cyclomatic complexity is too high in method play_item. (11)
Open

return True
 
def play_item(self, video_id, start_offset=-1, infoLabels={}, tvshow_video_id=None, timeline_markers={}):
"""Plays a video
 
 
Severity: Minor
Found in resources/lib/KodiHelper.py by radon

Cyclomatic complexity is too high in method is_logged_in. (11)
Open

return NetflixSession.__recursive_dict(search, dict[search[index]], index + 1)
 
def is_logged_in(self, account):
"""
Determines if a user is already logged in (with a valid cookie)
Severity: Minor
Found in resources/lib/NetflixSession.py by radon

Cyclomatic complexity is too high in method get_show_content_by_id. (11)
Open

return '-1', ''
 
def get_show_content_by_id(self, showid, showseason, showepisode):
showseason = int(showseason)
showepisode = int(showepisode)
Severity: Minor
Found in resources/lib/KodiHelper.py by radon

Similar blocks of code found in 3 locations. Consider refactoring.
Open

if 'creators' in entry_keys and len(entry['creators']) > 0:
infos.update({'writer': entry['creators'][0]})
Severity: Major
Found in resources/lib/KodiHelper.py and 2 other locations - About 2 hrs to fix
resources/lib/KodiHelper.py on lines 1140..1141
resources/lib/KodiHelper.py on lines 1142..1143

Similar blocks of code found in 3 locations. Consider refactoring.
Open

if 'genres' in entry_keys and len(entry['genres']) > 0:
infos.update({'genre': entry['genres'][0]})
Severity: Major
Found in resources/lib/KodiHelper.py and 2 other locations - About 2 hrs to fix
resources/lib/KodiHelper.py on lines 1138..1139
resources/lib/KodiHelper.py on lines 1140..1141

Similar blocks of code found in 3 locations. Consider refactoring.
Open

if 'directors' in entry_keys and len(entry['directors']) > 0:
infos.update({'director': entry['directors'][0]})
Severity: Major
Found in resources/lib/KodiHelper.py and 2 other locations - About 2 hrs to fix
resources/lib/KodiHelper.py on lines 1138..1139
resources/lib/KodiHelper.py on lines 1142..1143

Cyclomatic complexity is too high in method check_folder_path. (10)
Open

@staticmethod
def check_folder_path(path):
"""
Check if folderpath ends with path delimator
If not correct it (makes sure xbmcvfs.exists is working correct)
Severity: Minor
Found in resources/lib/NetflixCommon.py by radon

Cyclomatic complexity is too high in method before_routing_action. (10)
Open

return (True, False)[params.get('pin') == 'True']
 
@log
def before_routing_action(self, params):
"""Executes actions before the actual routing takes place:
Severity: Minor
Found in resources/lib/Navigation.py by radon

Cyclomatic complexity is too high in method extract_inline_netflix_page_data. (10)
Open

return json.loads(json_str, encoding='utf-8', strict=False)
 
def extract_inline_netflix_page_data(self, content='', items=None):
"""Extract the essential data from the page contents
The contents of the parsable tags looks something like this:
Severity: Minor
Found in resources/lib/NetflixSession.py by radon

Cyclomatic complexity is too high in method add_show. (9)
Open

progress.close()
 
def add_show(self, netflix_id, title, alt_title, episodes, build_url,
in_background=False):
"""Adds a show to the local db, generates & persists the strm files
Severity: Minor
Found in resources/lib/Library.py by radon

Cyclomatic complexity is too high in method show_video_list. (9)
Open

return False
 
def show_video_list(self, video_list_id, type, start=0,
widget_display=False):
"""List shows/movies based on the given video list id
Severity: Minor
Found in resources/lib/Navigation.py by radon

Cyclomatic complexity is too high in method updatedb_from_exported. (9)
Open

return int(year)
 
def updatedb_from_exported(self):
"""Adds movies and shows from exported media to the local db
 
 
Severity: Minor
Found in resources/lib/Library.py by radon

Function do_GET has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
Open

def do_GET(self):
"""Loads the XML manifest for the requested resource"""
url = urlparse(self.path)
params = parse_qs(url.query)
if 'id' not in params:
Severity: Minor
Found in resources/lib/MSLHttpRequestHandler.py - About 2 hrs to fix
Severity
Category
Status
Source
Language