wikimedia/pywikibot

View on GitHub
pywikibot/pagegenerators/_generators.py

Summary

Maintainability
F
6 days
Test Coverage

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

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

    Function RecentChangesPageGenerator has a Cognitive Complexity of 14 (exceeds 10 allowed). Consider refactoring.
    Open

    def RecentChangesPageGenerator(
        site: BaseSite | None = None,
        _filter_unique: None | (Callable[[Iterable[pywikibot.Page]],
                                Iterable[pywikibot.Page]]) = None,
        **kwargs: Any
    Severity: Minor
    Found in pywikibot/pagegenerators/_generators.py - About 55 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 __next__ has a Cognitive Complexity of 13 (exceeds 10 allowed). Consider refactoring.
    Open

        def __next__(self) -> pywikibot.page.Page:
            """Get next Page."""
            while True:
                entry = next(self.parser)
                if self.skipping:
    Severity: Minor
    Found in pywikibot/pagegenerators/_generators.py - About 45 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 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

      TODO found
      Open

          # TODO: page generator could be modified to use cmstartsortkey ...

      FIXME found
      Open

                  # FIXME: If we've already fetched content, we should retain it

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

      def AncientPagesPageGenerator(
          total: int = 100,
          site: BaseSite | None = None
      ) -> Generator[pywikibot.page.Page, None, None]:
          """
      Severity: Major
      Found in pywikibot/pagegenerators/_generators.py and 2 other locations - About 3 hrs to fix
      pywikibot/pagegenerators/_generators.py on lines 675..686
      pywikibot/pagegenerators/_generators.py on lines 689..700

      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 80.

      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 3 locations. Consider refactoring.
      Open

      def ShortPagesPageGenerator(total: int = 100,
                                  site: BaseSite | None = None
                                  ) -> Generator[pywikibot.page.Page, None, None]:
          """
          Short page generator.
      Severity: Major
      Found in pywikibot/pagegenerators/_generators.py and 2 other locations - About 3 hrs to fix
      pywikibot/pagegenerators/_generators.py on lines 504..516
      pywikibot/pagegenerators/_generators.py on lines 675..686

      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 80.

      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 3 locations. Consider refactoring.
      Open

      def LongPagesPageGenerator(total: int = 100,
                                 site: BaseSite | None = None
                                 ) -> Generator[pywikibot.page.Page, None, None]:
          """
          Long page generator.
      Severity: Major
      Found in pywikibot/pagegenerators/_generators.py and 2 other locations - About 3 hrs to fix
      pywikibot/pagegenerators/_generators.py on lines 504..516
      pywikibot/pagegenerators/_generators.py on lines 689..700

      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 80.

      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 4 locations. Consider refactoring.
      Open

      def WithoutInterwikiPageGenerator(
          total: int | None = None,
          site: BaseSite | None = None
      ) -> Iterable[pywikibot.page.Page]:
          """Page lacking interwikis generator.
      Severity: Major
      Found in pywikibot/pagegenerators/_generators.py and 3 other locations - About 3 hrs to fix
      pywikibot/pagegenerators/_generators.py on lines 519..530
      pywikibot/pagegenerators/_generators.py on lines 603..614
      pywikibot/pagegenerators/_generators.py on lines 617..628

      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 71.

      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 4 locations. Consider refactoring.
      Open

      def LonelyPagesPageGenerator(
          total: int | None = None,
          site: BaseSite | None = None
      ) -> Iterable[pywikibot.page.Page]:
          """Lonely page generator.
      Severity: Major
      Found in pywikibot/pagegenerators/_generators.py and 3 other locations - About 3 hrs to fix
      pywikibot/pagegenerators/_generators.py on lines 519..530
      pywikibot/pagegenerators/_generators.py on lines 533..544
      pywikibot/pagegenerators/_generators.py on lines 617..628

      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 71.

      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 4 locations. Consider refactoring.
      Open

      def UnusedFilesGenerator(
          total: int | None = None,
          site: BaseSite | None = None
      ) -> Iterable[pywikibot.page.FilePage]:
          """Unused files generator.
      Severity: Major
      Found in pywikibot/pagegenerators/_generators.py and 3 other locations - About 3 hrs to fix
      pywikibot/pagegenerators/_generators.py on lines 533..544
      pywikibot/pagegenerators/_generators.py on lines 603..614
      pywikibot/pagegenerators/_generators.py on lines 617..628

      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 71.

      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 4 locations. Consider refactoring.
      Open

      def UnwatchedPagesPageGenerator(
          total: int | None = None,
          site: BaseSite | None = None
      ) -> Iterable[pywikibot.page.Page]:
          """Unwatched page generator.
      Severity: Major
      Found in pywikibot/pagegenerators/_generators.py and 3 other locations - About 3 hrs to fix
      pywikibot/pagegenerators/_generators.py on lines 519..530
      pywikibot/pagegenerators/_generators.py on lines 533..544
      pywikibot/pagegenerators/_generators.py on lines 603..614

      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 71.

      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 5 locations. Consider refactoring.
      Open

      def UnCategorizedTemplateGenerator(
          total: int = 100,
          site: BaseSite | None = None
      ) -> Iterable[pywikibot.page.Page]:
          """Uncategorized template generator.
      Severity: Major
      Found in pywikibot/pagegenerators/_generators.py and 4 other locations - About 2 hrs to fix
      pywikibot/pagegenerators/_generators.py on lines 561..572
      pywikibot/pagegenerators/_generators.py on lines 575..586
      pywikibot/pagegenerators/_generators.py on lines 647..658
      pywikibot/pagegenerators/_generators.py on lines 661..672

      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 65.

      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 5 locations. Consider refactoring.
      Open

      def DeadendPagesPageGenerator(
          total: int = 100,
          site: BaseSite | None = None
      ) -> Iterable[pywikibot.page.Page]:
          """Dead-end page generator.
      Severity: Major
      Found in pywikibot/pagegenerators/_generators.py and 4 other locations - About 2 hrs to fix
      pywikibot/pagegenerators/_generators.py on lines 561..572
      pywikibot/pagegenerators/_generators.py on lines 575..586
      pywikibot/pagegenerators/_generators.py on lines 589..600
      pywikibot/pagegenerators/_generators.py on lines 647..658

      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 65.

      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 5 locations. Consider refactoring.
      Open

      def UnCategorizedImageGenerator(
          total: int = 100,
          site: BaseSite | None = None
      ) -> Iterable[pywikibot.page.FilePage]:
          """Uncategorized file generator.
      Severity: Major
      Found in pywikibot/pagegenerators/_generators.py and 4 other locations - About 2 hrs to fix
      pywikibot/pagegenerators/_generators.py on lines 575..586
      pywikibot/pagegenerators/_generators.py on lines 589..600
      pywikibot/pagegenerators/_generators.py on lines 647..658
      pywikibot/pagegenerators/_generators.py on lines 661..672

      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 65.

      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 5 locations. Consider refactoring.
      Open

      def WantedPagesPageGenerator(
          total: int = 100,
          site: BaseSite | None = None
      ) -> Iterable[pywikibot.page.Page]:
          """Wanted page generator.
      Severity: Major
      Found in pywikibot/pagegenerators/_generators.py and 4 other locations - About 2 hrs to fix
      pywikibot/pagegenerators/_generators.py on lines 561..572
      pywikibot/pagegenerators/_generators.py on lines 575..586
      pywikibot/pagegenerators/_generators.py on lines 589..600
      pywikibot/pagegenerators/_generators.py on lines 661..672

      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 65.

      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 5 locations. Consider refactoring.
      Open

      def UnCategorizedPageGenerator(
          total: int = 100,
          site: BaseSite | None = None
      ) -> Iterable[pywikibot.page.Page]:
          """Uncategorized page generator.
      Severity: Major
      Found in pywikibot/pagegenerators/_generators.py and 4 other locations - About 2 hrs to fix
      pywikibot/pagegenerators/_generators.py on lines 561..572
      pywikibot/pagegenerators/_generators.py on lines 589..600
      pywikibot/pagegenerators/_generators.py on lines 647..658
      pywikibot/pagegenerators/_generators.py on lines 661..672

      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 65.

      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 3 locations. Consider refactoring.
      Open

      def ImagesPageGenerator(
          pageWithImages: pywikibot.page.Page,  # noqa: N803
          total: int | None = None,
          content: bool = False
      ) -> Iterable[pywikibot.page.Page]:
      Severity: Major
      Found in pywikibot/pagegenerators/_generators.py and 2 other locations - About 1 hr to fix
      pywikibot/pagegenerators/_generators.py on lines 239..245
      pywikibot/pagegenerators/_generators.py on lines 325..340

      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 56.

      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 3 locations. Consider refactoring.
      Open

      def FileLinksGenerator(
          referredFilePage: pywikibot.page.FilePage,  # noqa: N803
          total: int | None = None,
          content: bool = False
      ) -> Iterable[pywikibot.page.Page]:
      Severity: Major
      Found in pywikibot/pagegenerators/_generators.py and 2 other locations - About 1 hr to fix
      pywikibot/pagegenerators/_generators.py on lines 248..254
      pywikibot/pagegenerators/_generators.py on lines 325..340

      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 56.

      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 3 locations. Consider refactoring.
      Open

      def LinkedPageGenerator(
          linkingPage: pywikibot.page.Page,  # noqa: N803
          total: int | None = None,
          content: bool = False
      ) -> Iterable[pywikibot.page.BasePage]:
      Severity: Major
      Found in pywikibot/pagegenerators/_generators.py and 2 other locations - About 1 hr to fix
      pywikibot/pagegenerators/_generators.py on lines 239..245
      pywikibot/pagegenerators/_generators.py on lines 248..254

      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 56.

      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