wikimedia/pywikibot

View on GitHub

Showing 737 of 737 total issues

Function _parse has a Cognitive Complexity of 11 (exceeds 10 allowed). Consider refactoring.
Open

    def _parse(self, version_str: str) -> None:
        version_match = MediaWikiVersion.MEDIAWIKI_VERSION.fullmatch(
            version_str)

        if not version_match:
Severity: Minor
Found in pywikibot/tools/__init__.py - About 25 mins to fix

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 _extract_results has a Cognitive Complexity of 11 (exceeds 10 allowed). Consider refactoring.
Open

    def _extract_results(self, resultdata):
        """Extract results from resultdata."""
        for item in resultdata:
            result = self.result(item)
            if self._namespaces and not self._check_result_namespace(result):
Severity: Minor
Found in pywikibot/data/api/_generators.py - About 25 mins to fix

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: decide if/how to enable/disable this feature.
Severity: Minor
Found in scripts/category.py by fixme

TODO found
Open

                # TODO: handle unsigned or archived by template
Severity: Minor
Found in scripts/archivebot.py by fixme

TODO found
Open

    # TODO: use options instead following variables:
Severity: Minor
Found in scripts/category.py by fixme

TODO found
Open

        # TODO: should be move to assemble()
Severity: Minor
Found in scripts/interwiki.py by fixme

TODO found
Open

    TODO: move to textlib
Severity: Minor
Found in scripts/weblinkchecker.py by fixme

TODO found
Open

        # TODO: enhance and use textlib.MultiTemplateMatchBuilder
Severity: Minor
Found in scripts/checkimages.py by fixme

TODO found
Open

                # TODO: consider removing this: a different image of the same
Severity: Minor
Found in scripts/imagetransfer.py by fixme

TODO found
Open

                    # TODO: allow these cases to be propagated!
Severity: Minor
Found in scripts/interwiki.py by fixme

FIXME found
Open

            whys.add(why)  # FIXME: we don't know if we ever archive anything
Severity: Minor
Found in scripts/archivebot.py by fixme

TODO found
Open

                        # TODO: Check whether pages aren't vandalized
Severity: Minor
Found in scripts/redirect.py by fixme

FIXME found
Open

            # FIXME: What errors are we catching here?
Severity: Minor
Found in scripts/interwiki.py by fixme

TODO found
Open

            # TODO: allow answer to repeat previous or go back after a mistake
Severity: Minor
Found in scripts/interwiki.py by fixme

FIXME found
Open

                    break  # FIXME: doesn't work. edits twice!
Severity: Minor
Found in scripts/redirect.py by fixme

FIXME found
Open

            # FIXME: Implement this
Severity: Minor
Found in scripts/newitem.py by fixme

TODO found
Open

            # TODO: handle unsigned
Severity: Minor
Found in scripts/archivebot.py by fixme

TODO found
Open

            # TODO: Make an option so that unstamped (unsigned) posts get
Severity: Minor
Found in scripts/archivebot.py by fixme

FIXME found
Open

            'csvEncoding': 'Windows-1252',  # FIXME: Encoding hell
Severity: Minor
Found in scripts/data_ingestion.py by fixme

TODO found
Open

        # TODO: break this function up into subroutines!
Severity: Minor
Found in scripts/solve_disambiguation.py by fixme
Severity
Category
Status
Source
Language