wikimedia/pywikibot

View on GitHub

Showing 616 of 616 total issues

Function report has 8 arguments (exceeds 7 allowed). Consider refactoring.
Open

    def report(
Severity: Major
Found in scripts/checkimages.py - About 35 mins to fix

    Function authorship has 8 arguments (exceeds 7 allowed). Consider refactoring.
    Open

        def authorship(
    Severity: Major
    Found in pywikibot/page/_toolforge.py - About 35 mins to fix

      Function LogeventsPageGenerator has 8 arguments (exceeds 7 allowed). Consider refactoring.
      Open

      def LogeventsPageGenerator(logtype: str | None = None,
      Severity: Major
      Found in pywikibot/pagegenerators/_generators.py - About 35 mins to fix

        Function __init__ has 8 arguments (exceeds 7 allowed). Consider refactoring.
        Open

            def __init__(self, option: str, shortcut: str, text: str, context: int,
        Severity: Major
        Found in pywikibot/bot_choice.py - About 35 mins to fix

          Function twtranslate has 8 arguments (exceeds 7 allowed). Consider refactoring.
          Open

          def twtranslate(
          Severity: Major
          Found in pywikibot/i18n.py - About 35 mins to fix

            Function redirect_func has 8 arguments (exceeds 7 allowed). Consider refactoring.
            Open

            def redirect_func(target, *,
            Severity: Major
            Found in pywikibot/tools/_deprecate.py - About 35 mins to fix

              Function add_deprecated_attr has 8 arguments (exceeds 7 allowed). Consider refactoring.
              Open

                  def add_deprecated_attr(self, name: str, replacement: Any = None, *,
              Severity: Major
              Found in pywikibot/tools/_deprecate.py - About 35 mins to fix

                Function AllpagesPageGenerator has 8 arguments (exceeds 7 allowed). Consider refactoring.
                Open

                def AllpagesPageGenerator(
                Severity: Major
                Found in pywikibot/pagegenerators/_generators.py - About 35 mins to fix

                  Function deleterevs has 8 arguments (exceeds 7 allowed). Consider refactoring.
                  Open

                      def deleterevs(
                  Severity: Major
                  Found in pywikibot/site/_apisite.py - About 35 mins to fix

                    Function PrefixingPageGenerator has 8 arguments (exceeds 7 allowed). Consider refactoring.
                    Open

                    def PrefixingPageGenerator(
                    Severity: Major
                    Found in pywikibot/pagegenerators/_generators.py - About 35 mins to fix

                      Function submit has 8 arguments (exceeds 7 allowed). Consider refactoring.
                      Open

                          def submit(self, request, result, data_result: str | None,
                      Severity: Major
                      Found in pywikibot/site/_upload.py - About 35 mins to fix

                        Function fromTimestamp has 8 arguments (exceeds 7 allowed). Consider refactoring.
                        Open

                            def fromTimestamp(cls,
                        Severity: Major
                        Found in pywikibot/_wbtypes.py - About 35 mins to fix

                          Function blocks has 8 arguments (exceeds 7 allowed). Consider refactoring.
                          Open

                              def blocks(
                          Severity: Major
                          Found in pywikibot/site/_generators.py - About 35 mins to fix

                            Function deletedrevs has 8 arguments (exceeds 7 allowed). Consider refactoring.
                            Open

                                def deletedrevs(
                            Severity: Major
                            Found in pywikibot/site/_generators.py - About 35 mins to fix

                              Function __init__ has 8 arguments (exceeds 7 allowed). Consider refactoring.
                              Open

                                  def __init__(self, site=None,
                              Severity: Major
                              Found in pywikibot/data/api/_requests.py - About 35 mins to fix

                                Function findAlternatives has a Cognitive Complexity of 12 (exceeds 10 allowed). Consider refactoring.
                                Open

                                    def findAlternatives(self, page) -> bool:
                                        """Append link target to a list of alternative links.
                                
                                        Overrides the BaseDisambigBot method.
                                
                                
                                Severity: Minor
                                Found in scripts/misspelling.py - About 35 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 parse_site has a Cognitive Complexity of 12 (exceeds 10 allowed). Consider refactoring.
                                Open

                                    def parse_site(self) -> tuple:
                                        """Parse only enough text to determine which site the link points to.
                                
                                        This method does not parse anything after the first ":"; links
                                        with multiple interwiki prefixes (such as "wikt:fr:Parlais") need
                                Severity: Minor
                                Found in pywikibot/page/_links.py - About 35 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 __new__ has a Cognitive Complexity of 12 (exceeds 10 allowed). Consider refactoring.
                                Open

                                    def __new__(cls, name, bases, dct):
                                        """Create the new class."""
                                        def test_method(site, package):
                                
                                            def test_template(self):
                                Severity: Minor
                                Found in tests/l10n_tests.py - About 35 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 apply_replacements has a Cognitive Complexity of 12 (exceeds 10 allowed). Consider refactoring.
                                Open

                                    def apply_replacements(self, original_text, applied, page) -> str:
                                        """Apply all replacements to the given text."""
                                        new_text = original_text
                                        exceptions = _get_text_exceptions(self.exceptions)
                                        skipped_containers = set()
                                Severity: Minor
                                Found in scripts/replace.py - About 35 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 isTitleExcepted has a Cognitive Complexity of 12 (exceeds 10 allowed). Consider refactoring.
                                Open

                                    def isTitleExcepted(self, title) -> bool:
                                        """Return True if one of the exceptions applies for the given title."""
                                        if 'title' in self.exceptions:
                                            for exc in self.exceptions['title']:
                                                if exc.search(title):
                                Severity: Minor
                                Found in scripts/replace.py - About 35 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

                                Severity
                                Category
                                Status
                                Source
                                Language