CastagnaIT/plugin.video.netflix

View on GitHub

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
Severity: Minor
Found in resources/lib/kodi/library.py - About 55 mins to fix

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)
Severity: Minor
Found in resources/lib/services/nfsession/directorybuilder/dir_builder_items.py - About 55 mins to fix

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)
Severity: Minor
Found in resources/lib/common/cache_utils.py - About 55 mins to fix

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,
Severity: Major
Found in resources/lib/navigation/directory_search.py - About 50 mins to fix

    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,
    Severity: Major
    Found in resources/lib/services/nfsession/directorybuilder/dir_builder_items.py - About 50 mins to fix

      Function cache_output has 7 arguments (exceeds 4 allowed). Consider refactoring.
      Open

      def cache_output(bucket, fixed_identifier=None,
      Severity: Major
      Found in resources/lib/common/cache_utils.py - About 50 mins to fix

        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:
        Severity: Minor
        Found in resources/lib/upgrade_controller.py - About 45 mins to fix

        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):
        Severity: Minor
        Found in resources/lib/common/cache.py - About 45 mins to fix

          Function _get_identifier has 6 arguments (exceeds 4 allowed). Consider refactoring.
          Open

          def _get_identifier(fixed_identifier, identify_from_kwarg_name,
          Severity: Minor
          Found in resources/lib/common/cache_utils.py - About 45 mins to fix

            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):
            Severity: Minor
            Found in resources/lib/services/nfsession/msl/converter.py - About 45 mins to fix

              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):
              Severity: Minor
              Found in resources/lib/kodi/infolabels.py - About 45 mins to fix

                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):
                Severity: Minor
                Found in resources/lib/services/cache_management.py - About 45 mins to fix

                  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
                  Severity: Major
                  Found in resources/lib/utils/cookies.py - About 45 mins to fix

                    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:
                    Severity: Minor
                    Found in resources/lib/kodi/ui/xmldialog_esnwidevine.py - About 45 mins to fix

                    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']:
                    Severity: Minor
                    Found in resources/lib/services/cache_management.py - About 45 mins to fix

                    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):
                    Severity: Minor
                    Found in resources/lib/services/nfsession/directorybuilder/dir_builder_items.py - About 35 mins to fix

                      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):
                      Severity: Minor
                      Found in resources/lib/services/nfsession/directorybuilder/dir_builder.py - About 35 mins to fix

                        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):
                        Severity: Minor
                        Found in resources/lib/kodi/ui/dialogs.py - About 35 mins to fix

                          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):
                          Severity: Minor
                          Found in resources/lib/services/nfsession/msl/converter.py - About 35 mins to fix

                            Function _path_to_videoid has 5 arguments (exceeds 4 allowed). Consider refactoring.
                            Open

                            def _path_to_videoid(kwargs, pathitems_arg, path_offset,
                            Severity: Minor
                            Found in resources/lib/common/videoid.py - About 35 mins to fix
                              Severity
                              Category
                              Status
                              Source
                              Language