coursera/extractors.py
Function _parse_on_demand_syllabus
has a Cognitive Complexity of 69 (exceeds 5 allowed). Consider refactoring. Open
Open
def _parse_on_demand_syllabus(self, course_name, page, reverse=False,
unrestricted_filenames=False,
subtitle_language='en',
video_resolution=None,
download_quizzes=False,
- 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 _parse_on_demand_syllabus
has 9 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def _parse_on_demand_syllabus(self, course_name, page, reverse=False,
Function get_modules
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def get_modules(self, class_name,
Avoid deeply nested control flow statements. Open
Open
if download_quizzes:
links = course.extract_links_from_programming_immediate_instructions(
lecture.id)
Avoid deeply nested control flow statements. Open
Open
if download_quizzes:
links = course.extract_links_from_exam(
lecture.id)
Avoid deeply nested control flow statements. Open
Open
if download_quizzes:
links = course.extract_links_from_quiz(
lecture.id)
Avoid deeply nested control flow statements. Open
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)