CastagnaIT/plugin.video.netflix

View on GitHub

Showing 103 of 373 total issues

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

        def get_tvshow_property(self, tvshowid, enum_vid_prop, default_value=None, data_type=None):
Severity: Minor
Found in resources/lib/database/db_shared.py - About 35 mins to fix

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

        def perpetual_path_request_switch_profiles(self, paths, length_params, perpetual_range_start=None,
    Severity: Minor
    Found in resources/lib/services/nfsession/session/path_requests.py - About 35 mins to fix

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

      def _convert_text_track(index, text_track, period, default, cdn_index):
      Severity: Minor
      Found in resources/lib/services/nfsession/msl/converter.py - About 35 mins to fix

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

            def get_video_list_search(self, pathitems, menu_data, search_term, perpetual_range_start, path_params=None):
        Severity: Minor
        Found in resources/lib/services/nfsession/directorybuilder/dir_builder.py - About 35 mins to fix

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

          def _find_audio_stream(manifest, property_name, property_value, channels_list, is_impaired=False):
          Severity: Minor
          Found in resources/lib/services/nfsession/msl/converter.py - About 35 mins to fix

            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 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 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 _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 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 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 _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 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 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 {}
              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 'h264'
                Severity: Major
                Found in resources/lib/services/nfsession/msl/converter.py - About 30 mins to fix

                  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_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 custom_viewmode has a Cognitive Complexity of 11 (exceeds 10 allowed). Consider refactoring.
                  Open

                  def custom_viewmode(content_type):
                      """Decorator that sets a custom viewmode (skin viewtype) if currently in a listing of the plugin"""
                      # pylint: disable=missing-docstring
                      def decorate_viewmode(func):
                          @wraps(func)
                  Severity: Minor
                  Found in resources/lib/navigation/directory_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

                  Severity
                  Category
                  Status
                  Source
                  Language