Function analyze_page
has a Cognitive Complexity of 34 (exceeds 10 allowed). Consider refactoring. Open
def analyze_page(self) -> set[tuple[str, str]]:
"""Analyze DiscussionPage."""
max_size = self.get_attr('maxarchivesize')
max_arch_size = str2size(max_size)
if not max_arch_size[0]:
- 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 load_page
has a Cognitive Complexity of 15 (exceeds 10 allowed). Consider refactoring. Open
def load_page(self) -> None:
"""Load the page to be archived and break it up into threads.
.. versionchanged:: 7.6
If `-keep` option is given run through all threads and set
- 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 PYTHON_VERSION < (3, 9):
futures.append(future)
Avoid deeply nested control flow statements. Open
if not exiting.is_set():
continue
Avoid deeply nested control flow statements. Open
if PYTHON_VERSION < (3, 9):
canceled = sum(future.cancel() for future in futures)
else:
executor.shutdown(cancel_futures=True)
Function load_config
has a Cognitive Complexity of 12 (exceeds 10 allowed). Consider refactoring. Open
def load_config(self) -> None:
"""Load and validate archiver template."""
pywikibot.info(
f'Looking for: {{{{{self.tpl.title()}}}}} in {self.page}')
- 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
TODO found Open
# TODO: Make an option so that unstamped (unsigned) posts get
- Exclude checks
TODO found Open
# TODO: handle unsigned
- Exclude checks
TODO found Open
# TODO: handle unsigned or archived by template
- Exclude checks
FIXME found Open
whys.add(why) # FIXME: we don't know if we ever archive anything
- Exclude checks
TODO found Open
# TODO: handle marked with template
- Exclude checks