coursera-dl/coursera

View on GitHub

Showing 50 of 71 total issues

Function get_modules has 8 arguments (exceeds 4 allowed). Consider refactoring.
Open

    def get_modules(self, class_name,
Severity: Major
Found in coursera/extractors.py - About 1 hr to fix

    Function get_page has 8 arguments (exceeds 4 allowed). Consider refactoring.
    Open

    def get_page(session,
    Severity: Major
    Found in coursera/network.py - About 1 hr to fix

      Function get_credentials has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
      Open

      def get_credentials(username=None, password=None, netrc=None, use_keyring=False):
          """
          Return valid username, password tuple.
      
          Raises CredentialsError if username or password is missing.
      Severity: Minor
      Found in coursera/credentials.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_lecture_filename has 7 arguments (exceeds 4 allowed). Consider refactoring.
      Open

      def get_lecture_filename(combined_section_lectures_nums,
      Severity: Major
      Found in coursera/formatting.py - About 50 mins to fix

        Avoid deeply nested control flow statements.
        Open

                                if download_quizzes:
                                    links = course.extract_links_from_quiz(
                                        lecture.id)
        
        
        Severity: Major
        Found in coursera/extractors.py - About 45 mins to fix

          Avoid deeply nested control flow statements.
          Open

                                  if download_quizzes:
                                      links = course.extract_links_from_programming_immediate_instructions(
                                          lecture.id)
          
          
          Severity: Major
          Found in coursera/extractors.py - About 45 mins to fix

            Avoid deeply nested control flow statements.
            Open

                                    if download_notebooks and not self._notebook_downloaded:
                                        logging.warning(
                                            'According to notebooks platform, content will be downloaded first')
                                        links = course.extract_links_from_notebook(
                                            lecture.id)
            Severity: Major
            Found in coursera/extractors.py - About 45 mins to fix

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

              def get_reply(session, url, post=False, data=None, headers=None, quiet=False):
              Severity: Minor
              Found in coursera/network.py - About 45 mins to fix

                Function _extract_peer_assignment_text has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                Open

                    def _extract_peer_assignment_text(self, element_id):
                        """
                        Extract peer assignment text (instructions).
                
                        @param element_id: Element id to extract peer assignment instructions from.
                Severity: Minor
                Found in coursera/api.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

                Avoid deeply nested control flow statements.
                Open

                                        if language == "all":
                                            download_all_subtitle = True
                                            break
                                        elif language in subtitles_set:
                                            subtitle_set_download.update([language])
                Severity: Major
                Found in coursera/api.py - About 45 mins to fix

                  Avoid deeply nested control flow statements.
                  Open

                                          if download_quizzes:
                                              links = course.extract_links_from_exam(
                                                  lecture.id)
                  
                  
                  Severity: Major
                  Found in coursera/extractors.py - About 45 mins to fix

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

                        def __init__(self,
                    Severity: Minor
                    Found in coursera/workflow.py - About 45 mins to fix

                      Function authenticate_through_netrc has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                      Open

                      def authenticate_through_netrc(path=None):
                          """
                          Return the tuple user / password given a path for the .netrc file.
                      
                          Raises CredentialsError if no valid netrc file is found.
                      Severity: Minor
                      Found in coursera/credentials.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 _get_asset_urls has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                      Open

                          def _get_asset_urls(self, asset_id):
                              """
                              Get list of asset urls and file names. This method may internally
                              use AssetRetriever to extract `asset` element types.
                      
                      
                      Severity: Minor
                      Found in coursera/api.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 post_page_and_reply has 5 arguments (exceeds 4 allowed). Consider refactoring.
                      Open

                      def post_page_and_reply(session, url, data=None, headers=None, **kwargs):
                      Severity: Minor
                      Found in coursera/network.py - About 35 mins to fix

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

                        def _iter_modules(modules, class_name, path, ignored_formats, args):
                        Severity: Minor
                        Found in coursera/workflow.py - About 35 mins to fix

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

                              def __init__(self, session, course_id, course_name,
                          Severity: Minor
                          Found in coursera/api.py - About 35 mins to fix

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

                            def get_cookies_for_class(session, class_name,
                            Severity: Minor
                            Found in coursera/cookies.py - About 35 mins to fix

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

                              def format_combine_number_resource(secnum, lecnum, lecname, title, fmt):
                              Severity: Minor
                              Found in coursera/formatting.py - About 35 mins to fix

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

                                def _walk_modules(modules, class_name, path, ignored_formats, args):
                                Severity: Minor
                                Found in coursera/workflow.py - About 35 mins to fix
                                  Severity
                                  Category
                                  Status
                                  Source
                                  Language