wikimedia/mediawiki-core

View on GitHub

Showing 11,545 of 11,545 total issues

Function _create has 194 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    _create: function() {
        // Some browsers only repeat keydown events, not keypress events,
        // so we use the suppressKeyPress flag to determine if we've already
        // handled the keydown event. #7269
        // Unfortunately the code for & in keypress is the same as the up arrow,
Severity: Major
Found in resources/lib/jquery.ui/jquery.ui.autocomplete.js - About 7 hrs to fix

    Method splitTitleString has 194 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public function splitTitleString( $text, $defaultNamespace = NS_MAIN ) {
            $dbkey = str_replace( ' ', '_', $text );
    
            # Initialisation
            $parts = [
    Severity: Major
    Found in includes/title/MediaWikiTitleCodec.php - About 7 hrs to fix

      Function addToSidebarPlain has a Cognitive Complexity of 50 (exceeds 5 allowed). Consider refactoring.
      Open

          public function addToSidebarPlain( &$bar, $text ) {
              $lines = explode( "\n", $text );
      
              $heading = '';
              $config = $this->getConfig();
      Severity: Minor
      Found in includes/skins/Skin.php - About 7 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 expandAttributes has a Cognitive Complexity of 50 (exceeds 5 allowed). Consider refactoring.
      Open

          public static function expandAttributes( array $attribs ) {
              $ret = '';
              foreach ( $attribs as $key => $value ) {
                  // Support intuitive [ 'checked' => true/false ] form
                  if ( $value === false || $value === null ) {
      Severity: Minor
      Found in includes/Html/Html.php - About 7 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 getFinalParamDescription has a Cognitive Complexity of 50 (exceeds 5 allowed). Consider refactoring.
      Open

          public function getFinalParamDescription() {
              $prefix = $this->getModulePrefix();
              $name = $this->getModuleName();
              $path = $this->getModulePath();
      
      
      Severity: Minor
      Found in includes/api/ApiBase.php - About 7 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 maybeAlterFormDefaults has a Cognitive Complexity of 50 (exceeds 5 allowed). Consider refactoring.
      Open

          protected function maybeAlterFormDefaults( &$fields ) {
              // This will be overwritten by request data
              $fields['Target']['default'] = (string)$this->target;
      
              if ( $this->target ) {
      Severity: Minor
      Found in includes/specials/SpecialBlock.php - About 7 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 showForm has a Cognitive Complexity of 50 (exceeds 5 allowed). Consider refactoring.
      Open

          private function showForm( ?StatusValue $status = null ) {
              $this->getSkin()->setRelevantTitle( $this->oldTitle );
      
              $out = $this->getOutput();
              $out->setPageTitleMsg( $this->msg( 'move-page' )->plaintextParams( $this->oldTitle->getPrefixedText() ) );
      Severity: Minor
      Found in includes/specials/SpecialMovePage.php - About 7 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

      File DeleteAction.php has 489 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      <?php
      /**
       * This program is free software; you can redistribute it and/or modify
       * it under the terms of the GNU General Public License as published by
       * the Free Software Foundation; either version 2 of the License, or
      Severity: Minor
      Found in includes/actions/DeleteAction.php - About 7 hrs to fix

        Method expand has 193 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public static function expand(
                // Fundamental options
                Parser $parser,
                string $id,
                // Context passed over from the parser
        Severity: Major
        Found in includes/parser/CoreMagicVariables.php - About 7 hrs to fix

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

          jQuery(function($){
              $.datepicker.regional['uk'] = {
                  closeText: 'Закрити',
                  prevText: '&#x3C;',
                  nextText: '&#x3E;',
          Severity: Major
          Found in resources/lib/jquery.ui/i18n/jquery.ui.datepicker-uk.js and 3 other locations - About 7 hrs to fix
          resources/lib/jquery.ui/i18n/jquery.ui.datepicker-ar.js on lines 4..23
          resources/lib/jquery.ui/i18n/jquery.ui.datepicker-fa.js on lines 4..59
          resources/lib/jquery.ui/i18n/jquery.ui.datepicker-sl.js on lines 4..24

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

          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

          jQuery(function($){
              $.datepicker.regional['ar'] = {
                  closeText: 'إغلاق',
                  prevText: '&#x3C;السابق',
                  nextText: 'التالي&#x3E;',
          Severity: Major
          Found in resources/lib/jquery.ui/i18n/jquery.ui.datepicker-ar.js and 3 other locations - About 7 hrs to fix
          resources/lib/jquery.ui/i18n/jquery.ui.datepicker-fa.js on lines 4..59
          resources/lib/jquery.ui/i18n/jquery.ui.datepicker-sl.js on lines 4..24
          resources/lib/jquery.ui/i18n/jquery.ui.datepicker-uk.js on lines 4..24

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

          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

              function getEraName() {
                  var i,
                      l,
                      val,
                      eras = this.localeData().eras();
          Severity: Major
          Found in resources/lib/moment/moment.js and 2 other locations - About 7 hrs to fix
          resources/lib/moment/moment.js on lines 4422..4440
          resources/lib/moment/moment.js on lines 4442..4460

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

          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

          jQuery(function($) {
              $.datepicker.regional['fa'] = {
                  closeText: 'بستن',
                  prevText: '&#x3C;قبلی',
                  nextText: 'بعدی&#x3E;',
          Severity: Major
          Found in resources/lib/jquery.ui/i18n/jquery.ui.datepicker-fa.js and 3 other locations - About 7 hrs to fix
          resources/lib/jquery.ui/i18n/jquery.ui.datepicker-ar.js on lines 4..23
          resources/lib/jquery.ui/i18n/jquery.ui.datepicker-sl.js on lines 4..24
          resources/lib/jquery.ui/i18n/jquery.ui.datepicker-uk.js on lines 4..24

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

          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

              function getEraAbbr() {
                  var i,
                      l,
                      val,
                      eras = this.localeData().eras();
          Severity: Major
          Found in resources/lib/moment/moment.js and 2 other locations - About 7 hrs to fix
          resources/lib/moment/moment.js on lines 4402..4420
          resources/lib/moment/moment.js on lines 4422..4440

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

          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

          jQuery(function($){
              $.datepicker.regional['sl'] = {
                  closeText: 'Zapri',
                  prevText: '&#x3C;Prejšnji',
                  nextText: 'Naslednji&#x3E;',
          Severity: Major
          Found in resources/lib/jquery.ui/i18n/jquery.ui.datepicker-sl.js and 3 other locations - About 7 hrs to fix
          resources/lib/jquery.ui/i18n/jquery.ui.datepicker-ar.js on lines 4..23
          resources/lib/jquery.ui/i18n/jquery.ui.datepicker-fa.js on lines 4..59
          resources/lib/jquery.ui/i18n/jquery.ui.datepicker-uk.js on lines 4..24

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

          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

              function getEraNarrow() {
                  var i,
                      l,
                      val,
                      eras = this.localeData().eras();
          Severity: Major
          Found in resources/lib/moment/moment.js and 2 other locations - About 7 hrs to fix
          resources/lib/moment/moment.js on lines 4402..4420
          resources/lib/moment/moment.js on lines 4442..4460

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

          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

          Method highlightText has 192 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              public function highlightText(
                  $text,
                  $terms,
                  $contextlines = self::DEFAULT_CONTEXT_LINES,
                  $contextchars = self::DEFAULT_CONTEXT_CHARS
          Severity: Major
          Found in includes/search/SearchHighlighter.php - About 7 hrs to fix

            WatchedItemStore has 54 functions (exceeds 20 allowed). Consider refactoring.
            Open

            class WatchedItemStore implements WatchedItemStoreInterface {
            
                /**
                 * @internal For use by ServiceWiring
                 */
            Severity: Major
            Found in includes/watchlist/WatchedItemStore.php - About 7 hrs to fix

              DerivedPageDataUpdater has 54 functions (exceeds 20 allowed). Consider refactoring.
              Open

              class DerivedPageDataUpdater implements LoggerAwareInterface, PreparedUpdate {
              
                  /**
                   * @var UserIdentity|null
                   */
              Severity: Major
              Found in includes/Storage/DerivedPageDataUpdater.php - About 7 hrs to fix

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

                jQuery(function($){
                    $.datepicker.regional['en-AU'] = {
                        closeText: 'Done',
                        prevText: 'Prev',
                        nextText: 'Next',
                Severity: Major
                Found in resources/lib/jquery.ui/i18n/jquery.ui.datepicker-en-AU.js and 59 other locations - About 7 hrs to fix
                resources/lib/jquery.ui/i18n/jquery.ui.datepicker-af.js on lines 3..23
                resources/lib/jquery.ui/i18n/jquery.ui.datepicker-ar-DZ.js on lines 4..23
                resources/lib/jquery.ui/i18n/jquery.ui.datepicker-az.js on lines 3..23
                resources/lib/jquery.ui/i18n/jquery.ui.datepicker-bs.js on lines 3..23
                resources/lib/jquery.ui/i18n/jquery.ui.datepicker-ca.js on lines 3..23
                resources/lib/jquery.ui/i18n/jquery.ui.datepicker-cs.js on lines 3..23
                resources/lib/jquery.ui/i18n/jquery.ui.datepicker-cy-GB.js on lines 3..23
                resources/lib/jquery.ui/i18n/jquery.ui.datepicker-da.js on lines 3..23
                resources/lib/jquery.ui/i18n/jquery.ui.datepicker-de.js on lines 3..23
                resources/lib/jquery.ui/i18n/jquery.ui.datepicker-el.js on lines 3..23
                resources/lib/jquery.ui/i18n/jquery.ui.datepicker-en-GB.js on lines 3..23
                resources/lib/jquery.ui/i18n/jquery.ui.datepicker-en-NZ.js on lines 3..23
                resources/lib/jquery.ui/i18n/jquery.ui.datepicker-eo.js on lines 3..23
                resources/lib/jquery.ui/i18n/jquery.ui.datepicker-es.js on lines 3..23
                resources/lib/jquery.ui/i18n/jquery.ui.datepicker-et.js on lines 3..23
                resources/lib/jquery.ui/i18n/jquery.ui.datepicker-eu.js on lines 3..23
                resources/lib/jquery.ui/i18n/jquery.ui.datepicker-fi.js on lines 3..23
                resources/lib/jquery.ui/i18n/jquery.ui.datepicker-fo.js on lines 3..23
                resources/lib/jquery.ui/i18n/jquery.ui.datepicker-fr-CH.js on lines 3..23
                resources/lib/jquery.ui/i18n/jquery.ui.datepicker-fr.js on lines 5..25
                resources/lib/jquery.ui/i18n/jquery.ui.datepicker-gl.js on lines 3..23
                resources/lib/jquery.ui/i18n/jquery.ui.datepicker-he.js on lines 3..23
                resources/lib/jquery.ui/i18n/jquery.ui.datepicker-hi.js on lines 3..23
                resources/lib/jquery.ui/i18n/jquery.ui.datepicker-hr.js on lines 3..23
                resources/lib/jquery.ui/i18n/jquery.ui.datepicker-hu.js on lines 3..23
                resources/lib/jquery.ui/i18n/jquery.ui.datepicker-hy.js on lines 3..23
                resources/lib/jquery.ui/i18n/jquery.ui.datepicker-id.js on lines 3..23
                resources/lib/jquery.ui/i18n/jquery.ui.datepicker-is.js on lines 3..23
                resources/lib/jquery.ui/i18n/jquery.ui.datepicker-it.js on lines 3..23
                resources/lib/jquery.ui/i18n/jquery.ui.datepicker-ja.js on lines 3..23
                resources/lib/jquery.ui/i18n/jquery.ui.datepicker-ka.js on lines 3..21
                resources/lib/jquery.ui/i18n/jquery.ui.datepicker-kk.js on lines 3..23
                resources/lib/jquery.ui/i18n/jquery.ui.datepicker-km.js on lines 3..23
                resources/lib/jquery.ui/i18n/jquery.ui.datepicker-ko.js on lines 3..23
                resources/lib/jquery.ui/i18n/jquery.ui.datepicker-lb.js on lines 3..23
                resources/lib/jquery.ui/i18n/jquery.ui.datepicker-lt.js on lines 3..23
                resources/lib/jquery.ui/i18n/jquery.ui.datepicker-lv.js on lines 3..23
                resources/lib/jquery.ui/i18n/jquery.ui.datepicker-mk.js on lines 3..23
                resources/lib/jquery.ui/i18n/jquery.ui.datepicker-ml.js on lines 3..23
                resources/lib/jquery.ui/i18n/jquery.ui.datepicker-ms.js on lines 3..23
                resources/lib/jquery.ui/i18n/jquery.ui.datepicker-nl-BE.js on lines 3..23
                resources/lib/jquery.ui/i18n/jquery.ui.datepicker-no.js on lines 4..23
                resources/lib/jquery.ui/i18n/jquery.ui.datepicker-pl.js on lines 3..23
                resources/lib/jquery.ui/i18n/jquery.ui.datepicker-pt-BR.js on lines 3..23
                resources/lib/jquery.ui/i18n/jquery.ui.datepicker-rm.js on lines 3..21
                resources/lib/jquery.ui/i18n/jquery.ui.datepicker-ru.js on lines 3..23
                resources/lib/jquery.ui/i18n/jquery.ui.datepicker-sk.js on lines 3..23
                resources/lib/jquery.ui/i18n/jquery.ui.datepicker-sq.js on lines 3..23
                resources/lib/jquery.ui/i18n/jquery.ui.datepicker-sr-SR.js on lines 3..23
                resources/lib/jquery.ui/i18n/jquery.ui.datepicker-sr.js on lines 3..23
                resources/lib/jquery.ui/i18n/jquery.ui.datepicker-sv.js on lines 3..23
                resources/lib/jquery.ui/i18n/jquery.ui.datepicker-ta.js on lines 3..23
                resources/lib/jquery.ui/i18n/jquery.ui.datepicker-th.js on lines 3..23
                resources/lib/jquery.ui/i18n/jquery.ui.datepicker-tj.js on lines 3..23
                resources/lib/jquery.ui/i18n/jquery.ui.datepicker-tr.js on lines 3..23
                resources/lib/jquery.ui/i18n/jquery.ui.datepicker-vi.js on lines 3..23
                resources/lib/jquery.ui/i18n/jquery.ui.datepicker-zh-CN.js on lines 3..23
                resources/lib/jquery.ui/i18n/jquery.ui.datepicker-zh-HK.js on lines 3..23
                resources/lib/jquery.ui/i18n/jquery.ui.datepicker-zh-TW.js on lines 3..23

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

                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

                Severity
                Category
                Status
                Source
                Language