wikimedia/pywikibot

View on GitHub

Showing 286 of 616 total issues

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

    def change_category(self, old_cat, new_cat,
Severity: Major
Found in pywikibot/page/_basepage.py - About 35 mins to fix

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

        def getReferences(self,
    Severity: Major
    Found in pywikibot/page/_basepage.py - About 35 mins to fix

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

          def download(self,
      Severity: Major
      Found in pywikibot/page/_filepage.py - About 35 mins to fix

        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

                                      Severity
                                      Category
                                      Status
                                      Source
                                      Language