Showing 708 of 708 total issues
Function __init__
has 9 arguments (exceeds 7 allowed). Consider refactoring. Open
def __init__(
Avoid deeply nested control flow statements. Open
if data['result'] == 'Warning':
assert ('warnings' in data
and not ignore_all_warnings)
if callable(ignore_warnings):
restart = False
Function preloadpages
has 9 arguments (exceeds 7 allowed). Consider refactoring. Open
def preloadpages(
Function input
has a Cognitive Complexity of 13 (exceeds 10 allowed). Consider refactoring. Open
def input(self, question: str,
password: bool = False,
default: str | None = '',
force: bool = False) -> str:
"""
- 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 hunk.reviewed == Hunk.PENDING:
hunk.reviewed = \
Hunk.APPR if choice == 'a' else Hunk.NOT_APPR
position = find_pending(0, position)
Function get
has a Cognitive Complexity of 13 (exceeds 10 allowed). Consider refactoring. Open
def get(self, force: bool = False) -> dict:
"""
Fetch all entity data and cache it.
:param force: override caching
- 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
for source in val:
assert source.isReference is True
src_data = source.toJSON()
if 'hash' in src_data:
reference.setdefault('hash', src_data['hash'])
Function topics
has 9 arguments (exceeds 7 allowed). Consider refactoring. Open
def topics(self, *,
Function get
has a Cognitive Complexity of 13 (exceeds 10 allowed). Consider refactoring. Open
def get(self, force: bool = False) -> dict:
"""Fetch all MediaInfo entity data and cache it.
.. note:: dicts returned by this method are references to content
of this entity and their modifying may indirectly cause
- 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 hasattr(obj, '__doc__'):
method.__doc__ = obj.__doc__
return method
Avoid deeply nested control flow statements. Open
for ref_propid, reference in ref_grp['snaks'].items():
for ref_index, ref_stat in enumerate(reference):
target_ref_grp = claim.sources[ref_grp_idx]
target_ref_prop = target_ref_grp[ref_propid]
target_ref = target_ref_prop[ref_index]
Avoid deeply nested control flow statements. Open
if option.handled(answer):
answer = option.result(answer)
output_option(option, before_question=False)
handled = option.stop
break
Avoid deeply nested control flow statements. Open
if self.sametitle(key, pagedata['title']):
cache[pagedata['title']] = cache[key]
break
else:
Avoid deeply nested control flow statements. Open
if family == 'wiki':
family = 'wikipedia'
return pywikibot.Site(code, family)
Avoid deeply nested control flow statements. Open
if poll:
# run a poll; not possible in first iteration
assert file_key
req = self.site.simple_request(
action='upload',
Function target_equals
has a Cognitive Complexity of 13 (exceeds 10 allowed). Consider refactoring. Open
def target_equals(self, value) -> bool:
"""
Check whether the Claim's target is equal to specified value.
The function checks for:
- 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 edit_elements
has a Cognitive Complexity of 13 (exceeds 10 allowed). Consider refactoring. Open
def edit_elements(self, data: dict, **kwargs) -> None:
"""
Update form elements.
:param data: Data to be saved
- 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 __next__
has a Cognitive Complexity of 13 (exceeds 10 allowed). Consider refactoring. Open
def __next__(self) -> pywikibot.page.Page:
"""Get next Page."""
while True:
entry = next(self.parser)
if self.skipping:
- 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 login
has a Cognitive Complexity of 13 (exceeds 10 allowed). Consider refactoring. Open
def login(self, retry: bool = False, autocreate: bool = False) -> bool:
"""
Attempt to log into the server.
.. seealso:: :api:`Login`
- 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 data['result'] == 'Continue':
throttle = False
if 'offset' in data:
new_offset = int(data['offset'])
if offset + len(chunk) != new_offset: