Showing 103 of 373 total issues
Function import_library
has a Cognitive Complexity of 14 (exceeds 10 allowed). Consider refactoring. Open
def import_library(self, path):
"""
Imports an already existing exported STRM library into the add-on library database,
allows you to restore an existing library, by avoiding to recreate it from scratch.
This operations also update the missing tv shows seasons and episodes, and automatically
- 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 _create_video_item
has a Cognitive Complexity of 14 (exceeds 10 allowed). Consider refactoring. Open
def _create_video_item(videoid_value, video, video_list, perpetual_range_start, common_data): # pylint: disable=unused-argument
if common_data['is_supplemental_type']:
# 10/10/2022 Broken api? the video trailers are not more identified as supplemental type but as movie type
# as workaround we check the data type
videoid = common.VideoId(supplementalid=videoid_value)
- 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_identifier
has a Cognitive Complexity of 14 (exceeds 10 allowed). Consider refactoring. Open
def _get_identifier(fixed_identifier, identify_from_kwarg_name,
identify_append_from_kwarg_name, identify_fallback_arg_index, args, kwargs):
"""Return the identifier to use with the caching_decorator"""
# LOG.debug('Get_identifier args: {}', args)
# LOG.debug('Get_identifier kwargs: {}', kwargs)
- 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 exec_query
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
def exec_query(row_id, search_type, search_params, search_value, perpetual_range_start, dir_update_listing,
Function build_video_listing
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
def build_video_listing(video_list, menu_data, sub_genre_id=None, pathitems=None, perpetual_range_start=None,
Function cache_output
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
def cache_output(bucket, fixed_identifier=None,
Function _perform_service_changes
has a Cognitive Complexity of 13 (exceeds 10 allowed). Consider refactoring. Open
def _perform_service_changes(previous_ver: CmpVersion, current_ver: CmpVersion):
"""Perform actions for an version bump"""
# Clear cache in any case (prevents problems when netflix change data structures)
G.CACHE.clear()
if not previous_ver:
- 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
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def add(self, bucket, identifier, data, ttl=None, expires=None, delayed_db_op=False):
Function _get_identifier
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def _get_identifier(fixed_identifier, identify_from_kwarg_name,
Function _convert_audio_track
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def _convert_audio_track(index, audio_track, period, default, has_drm_streams, cdn_index):
Function get_info
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def get_info(videoid, item, raw_data, profile_language_code='', delayed_db_op=False, common_data=None):
Function add
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def add(self, bucket, identifier, data, ttl=None, expires=None, delayed_db_op=False):
Avoid deeply nested control flow statements. Open
if to_return is not None:
# if there are multiple cookies that meet passed in criteria
raise Exception(f"There are multiple cookies with name, {name!r}") # pylint: disable=broad-exception-raised
# we will eventually return this as long as no cookie conflict
to_return = cookie.value
Function _save_system_info
has a Cognitive Complexity of 13 (exceeds 10 allowed). Consider refactoring. Open
def _save_system_info():
# Ask to save to a file
filename = 'NFSystemInfo.txt'
path = ui.show_browse_dialog(f'{common.get_local_string(30603)} - {filename}')
if not 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 delete_expired
has a Cognitive Complexity of 13 (exceeds 10 allowed). Consider refactoring. Open
def delete_expired(self):
bucket_names_db = []
timestamp = time()
for bucket in cache_utils.BUCKETS:
if bucket['is_persistent']:
- 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 _create_category_item
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def _create_category_item(list_id, video_list, menu_data, common_data, summary_data):
Function get_video_list_sorted_sp
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def get_video_list_sorted_sp(self, pathitems, menu_data, context_name, context_id, perpetual_range_start):
Function show_yesno_dialog
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def show_yesno_dialog(title, message, yeslabel=None, nolabel=None, default_yes_button=False):
Function _add_period
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def _add_period(mpd_tag, manifest, cdn_index, start_pts, add_pts_to_track_name):
Function _path_to_videoid
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def _path_to_videoid(kwargs, pathitems_arg, path_offset,