wikimedia/pywikibot

View on GitHub

Showing 580 of 580 total issues

File _apisite.py has 2560 lines of code (exceeds 900 allowed). Consider refactoring.
Open

"""Objects representing API interface to MediaWiki site."""
#
# (C) Pywikibot team, 2008-2025
#
# Distributed under the terms of the MIT license.
Severity: Major
Found in pywikibot/site/_apisite.py - About 5 days to fix

    File _generators.py has 2070 lines of code (exceeds 900 allowed). Consider refactoring.
    Open

    """Objects representing API generators to MediaWiki site."""
    #
    # (C) Pywikibot team, 2008-2025
    #
    # Distributed under the terms of the MIT license.
    Severity: Major
    Found in pywikibot/site/_generators.py - About 3 days to fix

      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.
      Severity: Major
      Found in pywikibot/page/_wikibase.py - About 3 days to fix

        File site_generators_tests.py has 1925 lines of code (exceeds 900 allowed). Consider refactoring.
        Open

        #!/usr/bin/env python3
        """Tests for generators of the site module."""
        #
        # (C) Pywikibot team, 2008-2025
        #
        Severity: Major
        Found in tests/site_generators_tests.py - About 3 days to fix

          File _basepage.py has 1885 lines of code (exceeds 900 allowed). Consider refactoring.
          Open

          """Objects representing a base object for a MediaWiki page."""
          #
          # (C) Pywikibot team, 2008-2025
          #
          # Distributed under the terms of the MIT license.
          Severity: Major
          Found in pywikibot/page/_basepage.py - About 3 days to fix

            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
            Severity: Major
            Found in scripts/interwiki.py - About 3 days to fix

              File bot.py has 1768 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:
               
               
              Severity: Major
              Found in pywikibot/bot.py - About 2 days to fix

                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.
                Severity: Major
                Found in pywikibot/date.py - About 2 days to fix

                  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.
                  Severity: Major
                  Found in pywikibot/textlib.py - About 2 days to fix

                    File pagegenerators_tests.py has 1463 lines of code (exceeds 900 allowed). Consider refactoring.
                    Open

                    #!/usr/bin/env python3
                    """Test pagegenerators module."""
                    #
                    # (C) Pywikibot team, 2009-2025
                    #
                    Severity: Major
                    Found in tests/pagegenerators_tests.py - About 1 day to fix

                      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
                      #
                      Severity: Major
                      Found in tests/textlib_tests.py - About 1 day to fix

                        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):
                        Severity: Minor
                        Found in pywikibot/diff.py - About 1 day to fix

                        File category.py has 1371 lines of code (exceeds 900 allowed). Consider refactoring.
                        Open

                        #!/usr/bin/env python3
                        """Script to manage categories.
                         
                        Syntax:
                         
                         
                        Severity: Major
                        Found in scripts/category.py - About 1 day to fix

                          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.
                          Severity: Major
                          Found in scripts/checkimages.py - About 1 day to fix

                            Similar blocks of code found in 3 locations. Consider refactoring.
                            Open

                            class TestPartiallyQualifiedExplicitLinkDifferentFamilyParser(LinkTestCase):
                             
                            """Link tests."""
                             
                            family = 'wikipedia'
                            Severity: Major
                            Found in tests/link_tests.py and 2 other locations - About 1 day to fix
                            tests/link_tests.py on lines 525..552
                            tests/link_tests.py on lines 616..643

                            Similar blocks of code found in 3 locations. Consider refactoring.
                            Open

                            class TestPartiallyQualifiedImplicitLinkDifferentFamilyParser(LinkTestCase):
                             
                            """Test partially qualified links to different family."""
                             
                            family = 'wikipedia'
                            Severity: Major
                            Found in tests/link_tests.py and 2 other locations - About 1 day to fix
                            tests/link_tests.py on lines 311..338
                            tests/link_tests.py on lines 525..552

                            Similar blocks of code found in 3 locations. Consider refactoring.
                            Open

                            class TestFullyQualifiedOneSiteFamilyExplicitLinkParser(LinkTestCase):
                             
                            """Test links to one site target family."""
                             
                            family = 'species'
                            Severity: Major
                            Found in tests/link_tests.py and 2 other locations - About 1 day to fix
                            tests/link_tests.py on lines 311..338
                            tests/link_tests.py on lines 616..643

                            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
                            #
                            Severity: Major
                            Found in tests/wikibase_tests.py - About 1 day to fix

                              File _generators.py has 1186 lines of code (exceeds 900 allowed). Consider refactoring.
                              Open

                              """Page filter generators provided by the pagegenerators module."""
                              #
                              # (C) Pywikibot team, 2008-2025
                              #
                              # Distributed under the terms of the MIT license.
                              Severity: Major
                              Found in pywikibot/pagegenerators/_generators.py - About 1 day to fix

                                File aspects.py has 1172 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.
                                """
                                Severity: Major
                                Found in tests/aspects.py - About 1 day to fix
                                  Severity
                                  Category
                                  Status
                                  Source
                                  Language