CastagnaIT/plugin.video.netflix

View on GitHub

Showing 241 of 373 total issues

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

    def _add_missing_items(self, tasks, season, videoid, metadata, nfo_settings):
Severity: Minor
Found in resources/lib/kodi/library_tasks.py - About 35 mins to fix

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

        def _update_library(self, videoids_tasks, exp_tvshows_videoids_values, show_prg_dialog, show_nfo_dialog,
    Severity: Minor
    Found in resources/lib/kodi/library.py - About 35 mins to fix

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

          def get_video_list_sorted(self, pathitems, menu_data, sub_genre_id, perpetual_range_start, is_dynamic_id):
      Severity: Minor
      Found in resources/lib/services/nfsession/directorybuilder/dir_builder.py - About 35 mins to fix

        Function _initialize_connection has a Cognitive Complexity of 12 (exceeds 10 allowed). Consider refactoring.
        Open

            def _initialize_connection(self):
                try:
                    LOG.debug('Trying connection to the MySQL database {}', self.database)
                    self.conn = mysql.connector.connect(**self.config)
                    if self.conn.is_connected():
        Severity: Minor
        Found in resources/lib/database/db_base_mysql.py - About 35 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 clear has a Cognitive Complexity of 12 (exceeds 10 allowed). Consider refactoring.
        Open

            def clear(self, buckets=None, clear_database=True):
                """
                Clear the cache
        
                :param buckets: list of buckets to clear, if not specified clear all the cache
        Severity: Minor
        Found in resources/lib/services/cache_management.py - About 35 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 handle_connection has a Cognitive Complexity of 12 (exceeds 10 allowed). Consider refactoring.
        Open

        def handle_connection(func):
            """
            A decorator that handle the connection status with the database
            """
            @wraps(func)
        Severity: Minor
        Found in resources/lib/database/db_base_sqlite.py - About 35 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 parse_profiles has a Cognitive Complexity of 12 (exceeds 10 allowed). Consider refactoring.
        Open

        def parse_profiles(data):
            """Parse profile information from Netflix response"""
            profiles_list = jgraph_get_list('profilesList', data)
            try:
                if not profiles_list:
        Severity: Minor
        Found in resources/lib/utils/website.py - About 35 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_items_previous_next_page has a Cognitive Complexity of 12 (exceeds 10 allowed). Consider refactoring.
        Open

        def add_items_previous_next_page(directory_items, pathitems, perpetual_range_selector, sub_genre_id=None,
                                         path_params=None):
            if pathitems and perpetual_range_selector:
                if 'previous_start' in perpetual_range_selector:
                    params = {'perpetual_range_start': perpetual_range_selector.get('previous_start'),
        Severity: Minor
        Found in resources/lib/services/nfsession/directorybuilder/dir_builder_utils.py - About 35 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 search_add has a Cognitive Complexity of 12 (exceeds 10 allowed). Consider refactoring.
        Open

        def search_add():
            """Perform actions to add and execute a new research"""
            # Ask to user the type of research
            search_types_desc = [SEARCH_TYPES_DESC.get(stype, 'Unknown') for stype in SEARCH_TYPES]
            type_index = ui.show_dlg_select(common.get_local_string(30401), search_types_desc)
        Severity: Minor
        Found in resources/lib/navigation/directory_search.py - About 35 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 cache_output has a Cognitive Complexity of 12 (exceeds 10 allowed). Consider refactoring.
        Open

        def cache_output(bucket, fixed_identifier=None,
                         identify_from_kwarg_name='videoid',
                         identify_append_from_kwarg_name=None,
                         identify_fallback_arg_index=0,
                         ttl=None,
        Severity: Minor
        Found in resources/lib/common/cache_utils.py - About 35 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 _verify_session_cookies has a Cognitive Complexity of 12 (exceeds 10 allowed). Consider refactoring.
        Open

            def _verify_session_cookies(self):
                """Verify that the session cookies have not expired"""
                if not self.session.cookies:
                    return False
                for cookie_name in LOGIN_COOKIES:
        Severity: Minor
        Found in resources/lib/services/nfsession/session/cookie.py - About 35 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 route_search_nav has a Cognitive Complexity of 12 (exceeds 10 allowed). Consider refactoring.
        Open

        def route_search_nav(pathitems, perpetual_range_start, dir_update_listing, params):
            if 'query' in params:
                path = 'query'
            else:
                path = pathitems[2] if len(pathitems) > 2 else 'list'
        Severity: Minor
        Found in resources/lib/navigation/directory_search.py - About 35 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

        Avoid too many return statements within this function.
        Open

                    return {}
        Severity: Major
        Found in resources/lib/services/playback/action_controller.py - About 30 mins to fix

          Avoid too many return statements within this function.
          Open

              return base.replace('%PL%', '(X11; Linux x86_64)')
          Severity: Major
          Found in resources/lib/common/device_utils.py - About 30 mins to fix

            Avoid too many return statements within this function.
            Open

                return 'h264'
            Severity: Major
            Found in resources/lib/services/nfsession/msl/converter.py - About 30 mins to fix

              Function _create_export_new_episodes_jobs has a Cognitive Complexity of 11 (exceeds 10 allowed). Consider refactoring.
              Open

                  def _create_export_new_episodes_jobs(self, videoid, metadata, nfo_settings=None):
                      """Create jobs data to export missing seasons and episodes"""
                      tasks = []
                      if metadata and 'seasons' in metadata[0]:
                          for season in metadata[0]['seasons']:
              Severity: Minor
              Found in resources/lib/kodi/library_tasks.py - About 25 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_manifest has a Cognitive Complexity of 11 (exceeds 10 allowed). Consider refactoring.
              Open

                  def get_manifest(self, viewable_id, challenge, sid):
                      """
                      Get the manifests for the given viewable_id and returns a mpd-XML-Manifest
              
                      :param viewable_id: The id of of the viewable
              Severity: Minor
              Found in resources/lib/services/nfsession/msl/msl_handler.py - About 25 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 auto_update_library has a Cognitive Complexity of 11 (exceeds 10 allowed). Consider refactoring.
              Open

                  def auto_update_library(self, sync_with_mylist, show_prg_dialog=True, show_nfo_dialog=False, clear_on_cancel=False,
                                          update_profiles=False):
                      """
                      Perform an auto update of the exported items in to Kodi library.
                      - The main purpose is check if there are new seasons/episodes.
              Severity: Minor
              Found in resources/lib/kodi/library.py - About 25 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_system_platform has a Cognitive Complexity of 11 (exceeds 10 allowed). Consider refactoring.
              Open

              def get_system_platform():
                  if not hasattr(get_system_platform, 'cached'):
                      platform = "unknown"
                      if xbmc.getCondVisibility('system.platform.linux') and not xbmc.getCondVisibility('system.platform.android'):
                          platform = "linux"
              Severity: Minor
              Found in resources/lib/common/device_utils.py - About 25 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_preferred_subtitle_language has a Cognitive Complexity of 11 (exceeds 10 allowed). Consider refactoring.
              Open

                  def _get_preferred_subtitle_language(self):
                      """
                      Get the language code of the preferred subtitle as set in Kodi Player setting
                      :return: The language code (as ISO with 2 letters) or 'None' if disabled
                      """
              Severity: Minor
              Found in resources/lib/services/playback/am_stream_continuity.py - About 25 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

              Severity
              Category
              Status
              Source
              Language