asciidisco/plugin.video.netflix

View on GitHub

Showing 673 of 673 total issues

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

def __parse_chunked_msl_response(self, message):
header = message.split('}}')[0] + '}}'
payloads = re.split(',\"signature\":\"[0-9A-Za-z=/+]+\"}', message.split('}}')[1])
payloads = [x + '}' for x in payloads][:-1]
 
 
Severity: Major
Found in resources/lib/MSL.py and 1 other location - About 5 hrs to fix
resources/lib/MSLv2.py on lines 548..555

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

def __parse_chunked_msl_response(self, message):
header = message.split('}}')[0] + '}}'
payloads = re.split(',\"signature\":\"[0-9A-Za-z=/+]+\"}', message.split('}}')[1])
payloads = [x + '}' for x in payloads][:-1]
 
 
Severity: Major
Found in resources/lib/MSLv2.py and 1 other location - About 5 hrs to fix
resources/lib/MSL.py on lines 501..508

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

try:
resp = self.session.post(
url=self.endpoints['manifest'],
data=json.dumps(request, sort_keys=True))
except:
Severity: Major
Found in resources/lib/MSLv2.py and 1 other location - About 5 hrs to fix
resources/lib/MSL.py on lines 648..656

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

try:
resp = self.session.post(
url=self.endpoints['manifest'],
data=json.dumps(request, sort_keys=True))
except:
Severity: Major
Found in resources/lib/MSL.py and 1 other location - About 5 hrs to fix
resources/lib/MSLv2.py on lines 675..683

Cyclomatic complexity is too high in method __tranform_to_dash. (24)
Open

 
 
def __tranform_to_dash(self, manifest):
 
self.nx_common.save_file(
Severity: Minor
Found in resources/lib/MSLv2.py by radon

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

if is_key_request:
header_data['keyrequestdata'] = self.crypto.get_key_request()
else:
if 'usertoken' in self.tokens:
pass
Severity: Major
Found in resources/lib/MSL.py and 1 other location - About 4 hrs to fix
resources/lib/MSLv2.py on lines 616..628

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

if is_key_request:
header_data['keyrequestdata'] = self.crypto.get_key_request()
else:
if 'usertoken' in self.tokens:
pass
Severity: Major
Found in resources/lib/MSLv2.py and 1 other location - About 4 hrs to fix
resources/lib/MSL.py on lines 588..600

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

if resp:
try:
# if the json() does not fail we have an error because
# the manifest response is a chuncked json response
resp.json()
Severity: Major
Found in resources/lib/MSL.py and 1 other location - About 4 hrs to fix
resources/lib/MSLv2.py on lines 235..251

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

if resp:
try:
# if the json() does not fail we have an error because
# the manifest response is a chuncked json response
resp.json()
Severity: Major
Found in resources/lib/MSLv2.py and 1 other location - About 4 hrs to fix
resources/lib/MSL.py on lines 209..225

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

try:
resp = self.session.post(self.endpoints['manifest'], request_data)
except:
resp = None
exc = sys.exc_info()
Severity: Major
Found in resources/lib/MSL.py and 1 other location - About 4 hrs to fix
resources/lib/MSLv2.py on lines 227..233

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

try:
resp = self.session.post(self.endpoints['manifest'], request_data)
except:
resp = None
exc = sys.exc_info()
Severity: Major
Found in resources/lib/MSLv2.py and 1 other location - About 4 hrs to fix
resources/lib/MSL.py on lines 201..207

KodiHelper has 34 functions (exceeds 20 allowed). Consider refactoring.
Open

class KodiHelper(object):
"""
Consumes all the configuration data from Kodi as well as
turns data into lists of folders and videos"""
 
 
Severity: Minor
Found in resources/lib/KodiHelper.py - About 4 hrs to fix

    Function _generate_context_menu_items has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring.
    Open

    def _generate_context_menu_items(self, entry, li):
    """Adds context menue items to a Kodi list item
     
    Parameters
    ----------
    Severity: Minor
    Found in resources/lib/KodiHelper.py - About 4 hrs to fix

    Function build_main_menu_listing has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring.
    Open

    def build_main_menu_listing(self, video_list_ids, user_list_order, actions,
    build_url, widget_display=False):
    """
    Builds the video lists (my list, continue watching, etc.) Kodi screen
     
     
    Severity: Minor
    Found in resources/lib/KodiHelper.py - About 4 hrs to fix

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

    def __save_msl_data(self):
    """
    Saves the keys and tokens in json file
    :return:
    """
    Severity: Major
    Found in resources/lib/MSL.py and 1 other location - About 4 hrs to fix
    resources/lib/MSLv2.py on lines 733..747

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

    def __save_msl_data(self):
    """
    Saves the keys and tokens in json file
    :return:
    """
    Severity: Major
    Found in resources/lib/MSLv2.py and 1 other location - About 4 hrs to fix
    resources/lib/MSL.py on lines 705..719

    Navigation has 33 functions (exceeds 20 allowed). Consider refactoring.
    Open

    class Navigation(object):
    """
    Routes to the correct subfolder,
    dispatches actions & acts as a controller
    for the Kodi view & the Netflix model
    Severity: Minor
    Found in resources/lib/Navigation.py - About 4 hrs to fix

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

      try:
      resp = self.session.post(self.endpoints['license'], request_data)
      except:
      resp = None
      exc = sys.exc_info()
      Severity: Major
      Found in resources/lib/MSLv2.py and 1 other location - About 3 hrs to fix
      resources/lib/MSL.py on lines 253..259

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

      try:
      resp = self.session.post(self.endpoints['license'], request_data)
      except:
      resp = None
      exc = sys.exc_info()
      Severity: Major
      Found in resources/lib/MSL.py and 1 other location - About 3 hrs to fix
      resources/lib/MSLv2.py on lines 282..288

      Cyclomatic complexity is too high in method _generate_context_menu_items. (18)
      Open

      return infos, li_infos
       
      def _generate_context_menu_items(self, entry, li):
      """Adds context menue items to a Kodi list item
       
       
      Severity: Minor
      Found in resources/lib/KodiHelper.py by radon
      Severity
      Category
      Status
      Source
      Language