wikimedia/pywikibot

View on GitHub

Showing 708 of 708 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 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 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 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 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 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 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 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 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 __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 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 __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 normalizeData has a Cognitive Complexity of 12 (exceeds 10 allowed). Consider refactoring.
                          Open

                              def normalizeData(cls, data: dict) -> dict:
                                  """Helper function to expand data into the Wikibase API structure.
                          
                                  .. versionchanged:: 7.7
                                     raises TypeError if *data* value is not a list.
                          Severity: Minor
                          Found in pywikibot/page/_collections.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 check_soft_redirect has a Cognitive Complexity of 12 (exceeds 10 allowed). Consider refactoring.
                          Open

                              def check_soft_redirect(self) -> None:
                                  """Check for soft-redirected categories."""
                                  cat = self.current_page
                                  i18n_param = {'oldcat': cat.title(as_link=True, textlink=True)}
                          
                          
                          Severity: Minor
                          Found in scripts/category_redirect.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 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 test_edit_claims has a Cognitive Complexity of 12 (exceeds 10 allowed). Consider refactoring.
                          Open

                              def test_edit_claims(self):
                                  """Test addClaim and removeClaim editing."""
                                  wikidata_site = pywikibot.Site('beta', 'wikidata')
                          
                                  # Create claim
                          Severity: Minor
                          Found in tests/file_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 __init__ has a Cognitive Complexity of 12 (exceeds 10 allowed). Consider refactoring.
                          Open

                              def __init__(self, **kwargs) -> None:
                                  """Initializer."""
                                  super().__init__(**kwargs)
                                  if self.opt.delay < 0:
                                      d = min(15, max(5, int(self.opt.hours * 60)))
                          Severity: Minor
                          Found in scripts/clean_sandbox.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 get_chunk_size has a Cognitive Complexity of 12 (exceeds 10 allowed). Consider refactoring.
                          Open

                          def get_chunk_size(match) -> int:
                              """Get chunk size."""
                              if not match:
                                  pywikibot.error('Chunk size parameter is not valid.')
                                  chunk_size = 0
                          Severity: Minor
                          Found in scripts/upload.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 _test_logevent has a Cognitive Complexity of 12 (exceeds 10 allowed). Consider refactoring.
                          Open

                              def _test_logevent(self, logtype):
                                  """Test a single logtype entry."""
                                  logentry = self._get_logentry(logtype)
                                  self.assertIn(logtype, logentry.__class__.__name__.lower())
                                  self.assertEqual(logentry._expected_type, logtype)
                          Severity: Minor
                          Found in tests/logentries_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

                          Severity
                          Category
                          Status
                          Source
                          Language