Showing 50 of 71 total issues
Function get_page
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
def get_page(session,
Function get_modules
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
def get_modules(self, class_name,
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.
- 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_lecture_filename
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
def get_lecture_filename(combined_section_lectures_nums,
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):
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])
Avoid deeply nested control flow statements. Open
if download_quizzes:
links = course.extract_links_from_programming_immediate_instructions(
lecture.id)
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.
- 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
Avoid deeply nested control flow statements. Open
if download_quizzes:
links = course.extract_links_from_exam(
lecture.id)
Function __init__
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(self,
Avoid deeply nested control flow statements. Open
if download_quizzes:
links = course.extract_links_from_quiz(
lecture.id)
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.
- 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 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.
- 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
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)
Function get_cookies_for_class
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def get_cookies_for_class(session, class_name,
Function format_combine_number_resource
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def format_combine_number_resource(secnum, lecnum, lecname, title, fmt):
Function __init__
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(self, session, course_id, course_name,
Function _iter_modules
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def _iter_modules(modules, class_name, path, ignored_formats, args):
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):
Function _walk_modules
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def _walk_modules(modules, class_name, path, ignored_formats, args):