Showing 286 of 616 total issues
File _apisite.py
has 2564 lines of code (exceeds 900 allowed). Consider refactoring. Open
"""Objects representing API interface to MediaWiki site."""
#
# (C) Pywikibot team, 2008-2024
#
# Distributed under the terms of the MIT license.
File _generators.py
has 2044 lines of code (exceeds 900 allowed). Consider refactoring. Open
"""Objects representing API generators to MediaWiki site."""
#
# (C) Pywikibot team, 2008-2024
#
# Distributed under the terms of the MIT license.
File _wikibase.py
has 1970 lines of code (exceeds 900 allowed). Consider refactoring. Open
"""Objects representing various types of Wikibase pages and structures.
This module also includes objects:
* Claim: an instance of a semantic assertion.
File site_generators_tests.py
has 1927 lines of code (exceeds 900 allowed). Consider refactoring. Open
#!/usr/bin/env python3
"""Tests for generators of the site module."""
#
# (C) Pywikibot team, 2008-2024
#
File _basepage.py
has 1879 lines of code (exceeds 900 allowed). Consider refactoring. Open
"""Objects representing a base object for a MediaWiki page."""
#
# (C) Pywikibot team, 2008-2024
#
# Distributed under the terms of the MIT license.
File interwiki.py
has 1860 lines of code (exceeds 900 allowed). Consider refactoring. Open
#!/usr/bin/env python3
"""Script to check language links for general pages.
Uses existing translations of a page, plus hints from the command line,
to download the equivalent pages from other languages. All of such pages
File bot.py
has 1760 lines of code (exceeds 900 allowed). Consider refactoring. Open
"""User-interface related functions for building bots.
This module supports several different bot classes which could be used in
conjunction. Each bot should subclass at least one of these four classes:
File date.py
has 1681 lines of code (exceeds 900 allowed). Consider refactoring. Open
"""Date data and manipulation module."""
#
# (C) Pywikibot team, 2003-2024
#
# Distributed under the terms of the MIT license.
File textlib.py
has 1636 lines of code (exceeds 900 allowed). Consider refactoring. Open
"""Functions for manipulating wiki-text."""
#
# (C) Pywikibot team, 2008-2024
#
# Distributed under the terms of the MIT license.
File pagegenerators_tests.py
has 1469 lines of code (exceeds 900 allowed). Consider refactoring. Open
#!/usr/bin/env python3
"""Test pagegenerators module."""
#
# (C) Pywikibot team, 2009-2024
#
File textlib_tests.py
has 1407 lines of code (exceeds 900 allowed). Consider refactoring. Open
#!/usr/bin/env python3
"""Test textlib module."""
#
# (C) Pywikibot team, 2011-2024
#
Function review_hunks
has a Cognitive Complexity of 90 (exceeds 10 allowed). Consider refactoring. Open
def review_hunks(self) -> None:
"""Review hunks."""
def find_pending(start: int, end: int) -> int | None:
step = -1 if start > end else +1
for pending in range(start, end, step):
- 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
File category.py
has 1363 lines of code (exceeds 900 allowed). Consider refactoring. Open
#!/usr/bin/env python3
"""Script to manage categories.
Syntax:
File checkimages.py
has 1350 lines of code (exceeds 900 allowed). Consider refactoring. Open
#!/usr/bin/env python3
"""Script to check recently uploaded files.
This script checks if a file description is present and if there are
other problems in the image's description.
File wikibase_tests.py
has 1208 lines of code (exceeds 900 allowed). Consider refactoring. Open
#!/usr/bin/env python3
"""Tests for the Wikidata parts of the page module."""
#
# (C) Pywikibot team, 2008-2024
#
File create_isbn_edition.py
has 1169 lines of code (exceeds 900 allowed). Consider refactoring. Open
#!/usr/bin/env python3
r"""Pywikibot client to load ISBN linked data into Wikidata.
Pywikibot script to get ISBN data from a digital library, and create or
amend the related Wikidata item for edition (with the
File aspects.py
has 1160 lines of code (exceeds 900 allowed). Consider refactoring. Open
"""Test aspects to allow fine grained control over what tests are executed.
Several parts of the test infrastructure are implemented as mixins,
such as API result caching and excessive test durations.
"""
Function main
has a Cognitive Complexity of 56 (exceeds 10 allowed). Consider refactoring. Open
def main(*args: str) -> None:
"""Process command line arguments and invoke bot.
If args is an empty list, sys.argv is used.
- 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
File _generators.py
has 1138 lines of code (exceeds 900 allowed). Consider refactoring. Open
"""Page filter generators provided by the pagegenerators module."""
#
# (C) Pywikibot team, 2008-2024
#
# Distributed under the terms of the MIT license.
Function main
has a Cognitive Complexity of 51 (exceeds 10 allowed). Consider refactoring. Open
def main(*args: str) -> None:
"""Process command line arguments and invoke bot.
If args is an empty list, sys.argv is used.
- 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"