pywikibot/data/api/_requests.py
File _requests.py
has 1010 lines of code (exceeds 900 allowed). Consider refactoring. Open
Open
"""Objects representing API requests."""
#
# (C) Pywikibot team, 2007-2024
#
# Distributed under the terms of the MIT license.
Function __init__
has a Cognitive Complexity of 18 (exceeds 10 allowed). Consider refactoring. Open
Open
def __init__(self, site=None,
mime: dict | None = None,
throttle: bool = True,
max_retries: int | None = None,
retry_wait: int | None = None,
- 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 __init__
has 8 arguments (exceeds 7 allowed). Consider refactoring. Open
Open
def __init__(self, site=None,
Function clean_kwargs
has a Cognitive Complexity of 11 (exceeds 10 allowed). Consider refactoring. Open
Open
def clean_kwargs(cls, kwargs: dict) -> dict:
"""
Convert keyword arguments into new parameters mode.
If there are no other arguments in kwargs apart from the used arguments
- 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
Open
# TODO: T154011: 'ReadOnlyError' seems replaced by 'readonly'
- Exclude checks
TODO found Open
Open
# TODO: Use ParamInfo request to determine valid parameters
- Exclude checks
TODO found Open
Open
# TODO: what other exceptions can occur here?
- Exclude checks