wikimedia/pywikibot

View on GitHub
pywikibot/site/_generators.py

Summary

Maintainability
F
1 wk
Test Coverage

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

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

    Function preloadpages has a Cognitive Complexity of 41 (exceeds 10 allowed). Consider refactoring.
    Open

        def preloadpages(
            self,
            pagelist: Iterable[pywikibot.Page],
            *,
            groupsize: int | None = None,
    Severity: Minor
    Found in pywikibot/site/_generators.py - About 5 hrs 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 loadrevisions has a Cognitive Complexity of 37 (exceeds 10 allowed). Consider refactoring.
    Open

        def loadrevisions(
            self,
            page: pywikibot.Page,
            *,
            content: bool = False,
    Severity: Minor
    Found in pywikibot/site/_generators.py - About 4 hrs 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 categorymembers has a Cognitive Complexity of 30 (exceeds 10 allowed). Consider refactoring.
    Open

        def categorymembers(
            self,
            category: pywikibot.Category,
            *,
            namespaces: NamespaceArgType = None,
    Severity: Minor
    Found in pywikibot/site/_generators.py - About 3 hrs 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 recentchanges has 17 arguments (exceeds 7 allowed). Consider refactoring.
    Open

        def recentchanges(
    Severity: Major
    Found in pywikibot/site/_generators.py - About 1 hr to fix

      Function alllinks has a Cognitive Complexity of 19 (exceeds 10 allowed). Consider refactoring.
      Open

          def alllinks(
              self,
              start: str = '',
              prefix: str = '',
              namespace: SingleNamespaceType = 0,
      Severity: Minor
      Found in pywikibot/site/_generators.py - About 1 hr 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 allpages has a Cognitive Complexity of 18 (exceeds 10 allowed). Consider refactoring.
      Open

          def allpages(
              self,
              start: str = '!',
              prefix: str = '',
              namespace: SingleNamespaceType = 0,
      Severity: Minor
      Found in pywikibot/site/_generators.py - About 1 hr 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 allpages has 13 arguments (exceeds 7 allowed). Consider refactoring.
      Open

          def allpages(
      Severity: Major
      Found in pywikibot/site/_generators.py - About 1 hr to fix

        Function categorymembers has 12 arguments (exceeds 7 allowed). Consider refactoring.
        Open

            def categorymembers(
        Severity: Major
        Found in pywikibot/site/_generators.py - About 1 hr to fix

          Function newpages has 12 arguments (exceeds 7 allowed). Consider refactoring.
          Open

              def newpages(
          Severity: Major
          Found in pywikibot/site/_generators.py - About 1 hr to fix

            Function pagelanglinks has a Cognitive Complexity of 15 (exceeds 10 allowed). Consider refactoring.
            Open

                def pagelanglinks(
                    self,
                    page: pywikibot.Page,
                    *,
                    total: int | None = None,
            Severity: Minor
            Found in pywikibot/site/_generators.py - About 1 hr 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 logevents has 10 arguments (exceeds 7 allowed). Consider refactoring.
            Open

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

              Function usercontribs has 10 arguments (exceeds 7 allowed). Consider refactoring.
              Open

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

                Function allimages has 10 arguments (exceeds 7 allowed). Consider refactoring.
                Open

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

                  Function preloadpages has 9 arguments (exceeds 7 allowed). Consider refactoring.
                  Open

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

                    Function pagereferences has 9 arguments (exceeds 7 allowed). Consider refactoring.
                    Open

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

                      Avoid deeply nested control flow statements.
                      Open

                                                  if self.sametitle(key, pagedata['title']):
                                                      cache[pagedata['title']] = cache[key]
                                                      break
                                              else:
                      Severity: Major
                      Found in pywikibot/site/_generators.py - About 45 mins to fix

                        Function watchlist_revs has 9 arguments (exceeds 7 allowed). Consider refactoring.
                        Open

                            def watchlist_revs(
                        Severity: Major
                        Found in pywikibot/site/_generators.py - About 45 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 pagebacklinks has a Cognitive Complexity of 12 (exceeds 10 allowed). Consider refactoring.
                              Open

                                  def pagebacklinks(
                                      self,
                                      page: pywikibot.Page,
                                      *,
                                      follow_redirects: bool = False,
                              Severity: Minor
                              Found in pywikibot/site/_generators.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 load_pages_from_pageids has a Cognitive Complexity of 11 (exceeds 10 allowed). Consider refactoring.
                              Open

                                  def load_pages_from_pageids(
                                      self,
                                      pageids: str | Iterable[int | str],
                                  ) -> Generator[pywikibot.Page, None, None]:
                                      """
                              Severity: Minor
                              Found in pywikibot/site/_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

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

                                  def blocks(
                                      self,
                                      starttime: pywikibot.time.Timestamp | None = None,
                                      endtime: pywikibot.time.Timestamp | None = None,
                                      reverse: bool = False,
                              Severity: Minor
                              Found in pywikibot/site/_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: QueryGenerator should detect when the number of
                              Severity: Minor
                              Found in pywikibot/site/_generators.py by fixme

                              TODO found
                              Open

                                      # TODO: update docstring
                              Severity: Minor
                              Found in pywikibot/site/_generators.py by fixme

                              TODO found
                              Open

                                      # TODO: allow users to ask for "patrol" as well?
                              Severity: Minor
                              Found in pywikibot/site/_generators.py by fixme

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

                                          if not self.sametitle(pagedata['title'],
                                                                page.title(with_section=False)):
                                              raise InconsistentTitleError(page, pagedata['title'])
                              Severity: Major
                              Found in pywikibot/site/_generators.py and 2 other locations - About 45 mins to fix
                              pywikibot/site/_apisite.py on lines 1437..1439
                              pywikibot/site/_extensions.py on lines 237..239

                              Duplicated Code

                              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                              Tuning

                              This issue has a mass of 43.

                              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                              Refactorings

                              Further Reading

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

                                  def withoutinterwiki(
                                      self,
                                      total: int | None = None,
                                  ) -> Iterable[pywikibot.Page]:
                                      """Yield Pages without language links from Special:Withoutinterwiki.
                              Severity: Major
                              Found in pywikibot/site/_generators.py and 16 other locations - About 30 mins to fix
                              pywikibot/site/_generators.py on lines 2098..2106
                              pywikibot/site/_generators.py on lines 2123..2131
                              pywikibot/site/_generators.py on lines 2133..2141
                              pywikibot/site/_generators.py on lines 2143..2151
                              pywikibot/site/_generators.py on lines 2153..2161
                              pywikibot/site/_generators.py on lines 2163..2171
                              pywikibot/site/_generators.py on lines 2173..2181
                              pywikibot/site/_generators.py on lines 2183..2191
                              pywikibot/site/_generators.py on lines 2193..2201
                              pywikibot/site/_generators.py on lines 2206..2214
                              pywikibot/site/_generators.py on lines 2216..2224
                              pywikibot/site/_generators.py on lines 2226..2234
                              pywikibot/site/_generators.py on lines 2236..2244
                              pywikibot/site/_generators.py on lines 2256..2264
                              pywikibot/site/_generators.py on lines 2266..2274
                              pywikibot/site/_generators.py on lines 2276..2284

                              Duplicated Code

                              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                              Tuning

                              This issue has a mass of 40.

                              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                              Refactorings

                              Further Reading

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

                                  def lonelypages(
                                      self,
                                      total: int | None = None,
                                  ) -> Iterable[pywikibot.Page]:
                                      """Yield Pages retrieved from Special:Lonelypages.
                              Severity: Major
                              Found in pywikibot/site/_generators.py and 16 other locations - About 30 mins to fix
                              pywikibot/site/_generators.py on lines 2098..2106
                              pywikibot/site/_generators.py on lines 2133..2141
                              pywikibot/site/_generators.py on lines 2143..2151
                              pywikibot/site/_generators.py on lines 2153..2161
                              pywikibot/site/_generators.py on lines 2163..2171
                              pywikibot/site/_generators.py on lines 2173..2181
                              pywikibot/site/_generators.py on lines 2183..2191
                              pywikibot/site/_generators.py on lines 2193..2201
                              pywikibot/site/_generators.py on lines 2206..2214
                              pywikibot/site/_generators.py on lines 2216..2224
                              pywikibot/site/_generators.py on lines 2226..2234
                              pywikibot/site/_generators.py on lines 2236..2244
                              pywikibot/site/_generators.py on lines 2246..2254
                              pywikibot/site/_generators.py on lines 2256..2264
                              pywikibot/site/_generators.py on lines 2266..2274
                              pywikibot/site/_generators.py on lines 2276..2284

                              Duplicated Code

                              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                              Tuning

                              This issue has a mass of 40.

                              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                              Refactorings

                              Further Reading

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

                                  def redirectpages(
                                      self,
                                      total: int | None = None,
                                  ) -> Iterable[pywikibot.Page]:
                                      """Yield redirect pages from Special:ListRedirects.
                              Severity: Major
                              Found in pywikibot/site/_generators.py and 16 other locations - About 30 mins to fix
                              pywikibot/site/_generators.py on lines 2098..2106
                              pywikibot/site/_generators.py on lines 2123..2131
                              pywikibot/site/_generators.py on lines 2133..2141
                              pywikibot/site/_generators.py on lines 2143..2151
                              pywikibot/site/_generators.py on lines 2153..2161
                              pywikibot/site/_generators.py on lines 2163..2171
                              pywikibot/site/_generators.py on lines 2173..2181
                              pywikibot/site/_generators.py on lines 2183..2191
                              pywikibot/site/_generators.py on lines 2193..2201
                              pywikibot/site/_generators.py on lines 2206..2214
                              pywikibot/site/_generators.py on lines 2216..2224
                              pywikibot/site/_generators.py on lines 2226..2234
                              pywikibot/site/_generators.py on lines 2236..2244
                              pywikibot/site/_generators.py on lines 2246..2254
                              pywikibot/site/_generators.py on lines 2256..2264
                              pywikibot/site/_generators.py on lines 2266..2274

                              Duplicated Code

                              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                              Tuning

                              This issue has a mass of 40.

                              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                              Refactorings

                              Further Reading

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

                                  def wantedpages(
                                      self,
                                      total: int | None = None,
                                  ) -> Iterable[pywikibot.Page]:
                                      """Yield Pages from Special:Wantedpages.
                              Severity: Major
                              Found in pywikibot/site/_generators.py and 16 other locations - About 30 mins to fix
                              pywikibot/site/_generators.py on lines 2098..2106
                              pywikibot/site/_generators.py on lines 2123..2131
                              pywikibot/site/_generators.py on lines 2133..2141
                              pywikibot/site/_generators.py on lines 2153..2161
                              pywikibot/site/_generators.py on lines 2163..2171
                              pywikibot/site/_generators.py on lines 2173..2181
                              pywikibot/site/_generators.py on lines 2183..2191
                              pywikibot/site/_generators.py on lines 2193..2201
                              pywikibot/site/_generators.py on lines 2206..2214
                              pywikibot/site/_generators.py on lines 2216..2224
                              pywikibot/site/_generators.py on lines 2226..2234
                              pywikibot/site/_generators.py on lines 2236..2244
                              pywikibot/site/_generators.py on lines 2246..2254
                              pywikibot/site/_generators.py on lines 2256..2264
                              pywikibot/site/_generators.py on lines 2266..2274
                              pywikibot/site/_generators.py on lines 2276..2284

                              Duplicated Code

                              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                              Tuning

                              This issue has a mass of 40.

                              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                              Refactorings

                              Further Reading

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

                                  def unusedcategories(
                                      self,
                                      total: int | None = None,
                                  ) -> Iterable[pywikibot.Page]:
                                      """Yield Category objects from Special:Unusedcategories.
                              Severity: Major
                              Found in pywikibot/site/_generators.py and 16 other locations - About 30 mins to fix
                              pywikibot/site/_generators.py on lines 2098..2106
                              pywikibot/site/_generators.py on lines 2123..2131
                              pywikibot/site/_generators.py on lines 2133..2141
                              pywikibot/site/_generators.py on lines 2143..2151
                              pywikibot/site/_generators.py on lines 2153..2161
                              pywikibot/site/_generators.py on lines 2163..2171
                              pywikibot/site/_generators.py on lines 2173..2181
                              pywikibot/site/_generators.py on lines 2183..2191
                              pywikibot/site/_generators.py on lines 2193..2201
                              pywikibot/site/_generators.py on lines 2206..2214
                              pywikibot/site/_generators.py on lines 2216..2224
                              pywikibot/site/_generators.py on lines 2236..2244
                              pywikibot/site/_generators.py on lines 2246..2254
                              pywikibot/site/_generators.py on lines 2256..2264
                              pywikibot/site/_generators.py on lines 2266..2274
                              pywikibot/site/_generators.py on lines 2276..2284

                              Duplicated Code

                              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                              Tuning

                              This issue has a mass of 40.

                              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                              Refactorings

                              Further Reading

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

                                  def broken_redirects(
                                      self,
                                      total: int | None = None,
                                  ) -> Iterable[pywikibot.Page]:
                                      """Yield Pages with broken redirects from Special:BrokenRedirects.
                              Severity: Major
                              Found in pywikibot/site/_generators.py and 16 other locations - About 30 mins to fix
                              pywikibot/site/_generators.py on lines 2098..2106
                              pywikibot/site/_generators.py on lines 2123..2131
                              pywikibot/site/_generators.py on lines 2133..2141
                              pywikibot/site/_generators.py on lines 2143..2151
                              pywikibot/site/_generators.py on lines 2153..2161
                              pywikibot/site/_generators.py on lines 2163..2171
                              pywikibot/site/_generators.py on lines 2173..2181
                              pywikibot/site/_generators.py on lines 2183..2191
                              pywikibot/site/_generators.py on lines 2193..2201
                              pywikibot/site/_generators.py on lines 2206..2214
                              pywikibot/site/_generators.py on lines 2216..2224
                              pywikibot/site/_generators.py on lines 2226..2234
                              pywikibot/site/_generators.py on lines 2236..2244
                              pywikibot/site/_generators.py on lines 2246..2254
                              pywikibot/site/_generators.py on lines 2266..2274
                              pywikibot/site/_generators.py on lines 2276..2284

                              Duplicated Code

                              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                              Tuning

                              This issue has a mass of 40.

                              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                              Refactorings

                              Further Reading

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

                                  def unwatchedpages(
                                      self,
                                      total: int | None = None,
                                  ) -> Iterable[pywikibot.Page]:
                                      """Yield Pages from Special:Unwatchedpages (requires Admin privileges).
                              Severity: Major
                              Found in pywikibot/site/_generators.py and 16 other locations - About 30 mins to fix
                              pywikibot/site/_generators.py on lines 2098..2106
                              pywikibot/site/_generators.py on lines 2123..2131
                              pywikibot/site/_generators.py on lines 2143..2151
                              pywikibot/site/_generators.py on lines 2153..2161
                              pywikibot/site/_generators.py on lines 2163..2171
                              pywikibot/site/_generators.py on lines 2173..2181
                              pywikibot/site/_generators.py on lines 2183..2191
                              pywikibot/site/_generators.py on lines 2193..2201
                              pywikibot/site/_generators.py on lines 2206..2214
                              pywikibot/site/_generators.py on lines 2216..2224
                              pywikibot/site/_generators.py on lines 2226..2234
                              pywikibot/site/_generators.py on lines 2236..2244
                              pywikibot/site/_generators.py on lines 2246..2254
                              pywikibot/site/_generators.py on lines 2256..2264
                              pywikibot/site/_generators.py on lines 2266..2274
                              pywikibot/site/_generators.py on lines 2276..2284

                              Duplicated Code

                              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                              Tuning

                              This issue has a mass of 40.

                              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                              Refactorings

                              Further Reading

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

                                  def uncategorizedpages(
                                      self,
                                      total: int | None = None,
                                  ) -> Iterable[pywikibot.Page]:
                                      """Yield Pages from Special:Uncategorizedpages.
                              Severity: Major
                              Found in pywikibot/site/_generators.py and 16 other locations - About 30 mins to fix
                              pywikibot/site/_generators.py on lines 2098..2106
                              pywikibot/site/_generators.py on lines 2123..2131
                              pywikibot/site/_generators.py on lines 2133..2141
                              pywikibot/site/_generators.py on lines 2143..2151
                              pywikibot/site/_generators.py on lines 2153..2161
                              pywikibot/site/_generators.py on lines 2163..2171
                              pywikibot/site/_generators.py on lines 2173..2181
                              pywikibot/site/_generators.py on lines 2183..2191
                              pywikibot/site/_generators.py on lines 2193..2201
                              pywikibot/site/_generators.py on lines 2216..2224
                              pywikibot/site/_generators.py on lines 2226..2234
                              pywikibot/site/_generators.py on lines 2236..2244
                              pywikibot/site/_generators.py on lines 2246..2254
                              pywikibot/site/_generators.py on lines 2256..2264
                              pywikibot/site/_generators.py on lines 2266..2274
                              pywikibot/site/_generators.py on lines 2276..2284

                              Duplicated Code

                              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                              Tuning

                              This issue has a mass of 40.

                              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                              Refactorings

                              Further Reading

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

                                  def deadendpages(
                                      self,
                                      total: int | None = None,
                                  ) -> Iterable[pywikibot.Page]:
                                      """Yield Page objects retrieved from Special:Deadendpages.
                              Severity: Major
                              Found in pywikibot/site/_generators.py and 16 other locations - About 30 mins to fix
                              pywikibot/site/_generators.py on lines 2123..2131
                              pywikibot/site/_generators.py on lines 2133..2141
                              pywikibot/site/_generators.py on lines 2143..2151
                              pywikibot/site/_generators.py on lines 2153..2161
                              pywikibot/site/_generators.py on lines 2163..2171
                              pywikibot/site/_generators.py on lines 2173..2181
                              pywikibot/site/_generators.py on lines 2183..2191
                              pywikibot/site/_generators.py on lines 2193..2201
                              pywikibot/site/_generators.py on lines 2206..2214
                              pywikibot/site/_generators.py on lines 2216..2224
                              pywikibot/site/_generators.py on lines 2226..2234
                              pywikibot/site/_generators.py on lines 2236..2244
                              pywikibot/site/_generators.py on lines 2246..2254
                              pywikibot/site/_generators.py on lines 2256..2264
                              pywikibot/site/_generators.py on lines 2266..2274
                              pywikibot/site/_generators.py on lines 2276..2284

                              Duplicated Code

                              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                              Tuning

                              This issue has a mass of 40.

                              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                              Refactorings

                              Further Reading

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

                                  def wantedcategories(
                                      self,
                                      total: int | None = None,
                                  ) -> Iterable[pywikibot.Page]:
                                      """Yield Pages from Special:Wantedcategories.
                              Severity: Major
                              Found in pywikibot/site/_generators.py and 16 other locations - About 30 mins to fix
                              pywikibot/site/_generators.py on lines 2098..2106
                              pywikibot/site/_generators.py on lines 2123..2131
                              pywikibot/site/_generators.py on lines 2133..2141
                              pywikibot/site/_generators.py on lines 2143..2151
                              pywikibot/site/_generators.py on lines 2153..2161
                              pywikibot/site/_generators.py on lines 2163..2171
                              pywikibot/site/_generators.py on lines 2183..2191
                              pywikibot/site/_generators.py on lines 2193..2201
                              pywikibot/site/_generators.py on lines 2206..2214
                              pywikibot/site/_generators.py on lines 2216..2224
                              pywikibot/site/_generators.py on lines 2226..2234
                              pywikibot/site/_generators.py on lines 2236..2244
                              pywikibot/site/_generators.py on lines 2246..2254
                              pywikibot/site/_generators.py on lines 2256..2264
                              pywikibot/site/_generators.py on lines 2266..2274
                              pywikibot/site/_generators.py on lines 2276..2284

                              Duplicated Code

                              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                              Tuning

                              This issue has a mass of 40.

                              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                              Refactorings

                              Further Reading

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

                                  def uncategorizedimages(
                                      self,
                                      total: int | None = None,
                                  ) -> Iterable[pywikibot.Page]:
                                      """Yield FilePages from Special:Uncategorizedimages.
                              Severity: Major
                              Found in pywikibot/site/_generators.py and 16 other locations - About 30 mins to fix
                              pywikibot/site/_generators.py on lines 2098..2106
                              pywikibot/site/_generators.py on lines 2123..2131
                              pywikibot/site/_generators.py on lines 2133..2141
                              pywikibot/site/_generators.py on lines 2143..2151
                              pywikibot/site/_generators.py on lines 2153..2161
                              pywikibot/site/_generators.py on lines 2163..2171
                              pywikibot/site/_generators.py on lines 2173..2181
                              pywikibot/site/_generators.py on lines 2183..2191
                              pywikibot/site/_generators.py on lines 2206..2214
                              pywikibot/site/_generators.py on lines 2216..2224
                              pywikibot/site/_generators.py on lines 2226..2234
                              pywikibot/site/_generators.py on lines 2236..2244
                              pywikibot/site/_generators.py on lines 2246..2254
                              pywikibot/site/_generators.py on lines 2256..2264
                              pywikibot/site/_generators.py on lines 2266..2274
                              pywikibot/site/_generators.py on lines 2276..2284

                              Duplicated Code

                              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                              Tuning

                              This issue has a mass of 40.

                              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                              Refactorings

                              Further Reading

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

                                  def uncategorizedtemplates(
                                      self,
                                      total: int | None = None,
                                  ) -> Iterable[pywikibot.Page]:
                                      """Yield Pages from Special:Uncategorizedtemplates.
                              Severity: Major
                              Found in pywikibot/site/_generators.py and 16 other locations - About 30 mins to fix
                              pywikibot/site/_generators.py on lines 2098..2106
                              pywikibot/site/_generators.py on lines 2123..2131
                              pywikibot/site/_generators.py on lines 2133..2141
                              pywikibot/site/_generators.py on lines 2143..2151
                              pywikibot/site/_generators.py on lines 2153..2161
                              pywikibot/site/_generators.py on lines 2163..2171
                              pywikibot/site/_generators.py on lines 2173..2181
                              pywikibot/site/_generators.py on lines 2183..2191
                              pywikibot/site/_generators.py on lines 2193..2201
                              pywikibot/site/_generators.py on lines 2206..2214
                              pywikibot/site/_generators.py on lines 2226..2234
                              pywikibot/site/_generators.py on lines 2236..2244
                              pywikibot/site/_generators.py on lines 2246..2254
                              pywikibot/site/_generators.py on lines 2256..2264
                              pywikibot/site/_generators.py on lines 2266..2274
                              pywikibot/site/_generators.py on lines 2276..2284

                              Duplicated Code

                              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                              Tuning

                              This issue has a mass of 40.

                              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                              Refactorings

                              Further Reading

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

                                  def wantedfiles(
                                      self,
                                      total: int | None = None,
                                  ) -> Iterable[pywikibot.Page]:
                                      """Yield Pages from Special:Wantedfiles.
                              Severity: Major
                              Found in pywikibot/site/_generators.py and 16 other locations - About 30 mins to fix
                              pywikibot/site/_generators.py on lines 2098..2106
                              pywikibot/site/_generators.py on lines 2123..2131
                              pywikibot/site/_generators.py on lines 2133..2141
                              pywikibot/site/_generators.py on lines 2143..2151
                              pywikibot/site/_generators.py on lines 2163..2171
                              pywikibot/site/_generators.py on lines 2173..2181
                              pywikibot/site/_generators.py on lines 2183..2191
                              pywikibot/site/_generators.py on lines 2193..2201
                              pywikibot/site/_generators.py on lines 2206..2214
                              pywikibot/site/_generators.py on lines 2216..2224
                              pywikibot/site/_generators.py on lines 2226..2234
                              pywikibot/site/_generators.py on lines 2236..2244
                              pywikibot/site/_generators.py on lines 2246..2254
                              pywikibot/site/_generators.py on lines 2256..2264
                              pywikibot/site/_generators.py on lines 2266..2274
                              pywikibot/site/_generators.py on lines 2276..2284

                              Duplicated Code

                              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                              Tuning

                              This issue has a mass of 40.

                              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                              Refactorings

                              Further Reading

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

                                  def wantedtemplates(
                                      self,
                                      total: int | None = None,
                                  ) -> Iterable[pywikibot.Page]:
                                      """Yield Pages from Special:Wantedtemplates.
                              Severity: Major
                              Found in pywikibot/site/_generators.py and 16 other locations - About 30 mins to fix
                              pywikibot/site/_generators.py on lines 2098..2106
                              pywikibot/site/_generators.py on lines 2123..2131
                              pywikibot/site/_generators.py on lines 2133..2141
                              pywikibot/site/_generators.py on lines 2143..2151
                              pywikibot/site/_generators.py on lines 2153..2161
                              pywikibot/site/_generators.py on lines 2173..2181
                              pywikibot/site/_generators.py on lines 2183..2191
                              pywikibot/site/_generators.py on lines 2193..2201
                              pywikibot/site/_generators.py on lines 2206..2214
                              pywikibot/site/_generators.py on lines 2216..2224
                              pywikibot/site/_generators.py on lines 2226..2234
                              pywikibot/site/_generators.py on lines 2236..2244
                              pywikibot/site/_generators.py on lines 2246..2254
                              pywikibot/site/_generators.py on lines 2256..2264
                              pywikibot/site/_generators.py on lines 2266..2274
                              pywikibot/site/_generators.py on lines 2276..2284

                              Duplicated Code

                              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                              Tuning

                              This issue has a mass of 40.

                              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                              Refactorings

                              Further Reading

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

                                  def unusedfiles(
                                      self,
                                      total: int | None = None,
                                  ) -> Iterable[pywikibot.Page]:
                                      """Yield FilePage objects from Special:Unusedimages.
                              Severity: Major
                              Found in pywikibot/site/_generators.py and 16 other locations - About 30 mins to fix
                              pywikibot/site/_generators.py on lines 2098..2106
                              pywikibot/site/_generators.py on lines 2123..2131
                              pywikibot/site/_generators.py on lines 2133..2141
                              pywikibot/site/_generators.py on lines 2143..2151
                              pywikibot/site/_generators.py on lines 2153..2161
                              pywikibot/site/_generators.py on lines 2163..2171
                              pywikibot/site/_generators.py on lines 2173..2181
                              pywikibot/site/_generators.py on lines 2183..2191
                              pywikibot/site/_generators.py on lines 2193..2201
                              pywikibot/site/_generators.py on lines 2206..2214
                              pywikibot/site/_generators.py on lines 2216..2224
                              pywikibot/site/_generators.py on lines 2226..2234
                              pywikibot/site/_generators.py on lines 2246..2254
                              pywikibot/site/_generators.py on lines 2256..2264
                              pywikibot/site/_generators.py on lines 2266..2274
                              pywikibot/site/_generators.py on lines 2276..2284

                              Duplicated Code

                              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                              Tuning

                              This issue has a mass of 40.

                              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                              Refactorings

                              Further Reading

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

                                  def uncategorizedcategories(
                                      self,
                                      total: int | None = None,
                                  ) -> Iterable[pywikibot.Page]:
                                      """Yield Categories from Special:Uncategorizedcategories.
                              Severity: Major
                              Found in pywikibot/site/_generators.py and 16 other locations - About 30 mins to fix
                              pywikibot/site/_generators.py on lines 2098..2106
                              pywikibot/site/_generators.py on lines 2123..2131
                              pywikibot/site/_generators.py on lines 2133..2141
                              pywikibot/site/_generators.py on lines 2143..2151
                              pywikibot/site/_generators.py on lines 2153..2161
                              pywikibot/site/_generators.py on lines 2163..2171
                              pywikibot/site/_generators.py on lines 2173..2181
                              pywikibot/site/_generators.py on lines 2193..2201
                              pywikibot/site/_generators.py on lines 2206..2214
                              pywikibot/site/_generators.py on lines 2216..2224
                              pywikibot/site/_generators.py on lines 2226..2234
                              pywikibot/site/_generators.py on lines 2236..2244
                              pywikibot/site/_generators.py on lines 2246..2254
                              pywikibot/site/_generators.py on lines 2256..2264
                              pywikibot/site/_generators.py on lines 2266..2274
                              pywikibot/site/_generators.py on lines 2276..2284

                              Duplicated Code

                              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                              Tuning

                              This issue has a mass of 40.

                              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                              Refactorings

                              Further Reading

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

                                  def double_redirects(
                                      self,
                                      total: int | None = None,
                                  ) -> Iterable[pywikibot.Page]:
                                      """Yield Pages with double redirects from Special:DoubleRedirects.
                              Severity: Major
                              Found in pywikibot/site/_generators.py and 16 other locations - About 30 mins to fix
                              pywikibot/site/_generators.py on lines 2098..2106
                              pywikibot/site/_generators.py on lines 2123..2131
                              pywikibot/site/_generators.py on lines 2133..2141
                              pywikibot/site/_generators.py on lines 2143..2151
                              pywikibot/site/_generators.py on lines 2153..2161
                              pywikibot/site/_generators.py on lines 2163..2171
                              pywikibot/site/_generators.py on lines 2173..2181
                              pywikibot/site/_generators.py on lines 2183..2191
                              pywikibot/site/_generators.py on lines 2193..2201
                              pywikibot/site/_generators.py on lines 2206..2214
                              pywikibot/site/_generators.py on lines 2216..2224
                              pywikibot/site/_generators.py on lines 2226..2234
                              pywikibot/site/_generators.py on lines 2236..2244
                              pywikibot/site/_generators.py on lines 2246..2254
                              pywikibot/site/_generators.py on lines 2256..2264
                              pywikibot/site/_generators.py on lines 2276..2284

                              Duplicated Code

                              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                              Tuning

                              This issue has a mass of 40.

                              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                              Refactorings

                              Further Reading

                              There are no issues that match your filters.

                              Category
                              Status