wikimedia/mediawiki-extensions-VisualEditor

View on GitHub

Showing 912 of 912 total issues

Function VeUiMWWikitextSurface has 57 lines of code (exceeds 25 allowed). Consider refactoring.
Open

ve.ui.MWWikitextSurface = function VeUiMWWikitextSurface() {
    // Parent constructor
    ve.ui.MWWikitextSurface.super.apply( this, arguments );

    // Initialization
Severity: Major
Found in modules/ve-mw/ui/ve.ui.MWWikitextSurface.js - About 2 hrs to fix

    Function restoreEditSection has 57 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    ve.init.mw.ArticleTarget.prototype.restoreEditSection = function () {
        const section = this.section !== null ? this.section : this.visibleSection;
        const surface = this.getSurface();
        const mode = surface.getMode();
    
    
    Severity: Major
    Found in modules/ve-mw/init/targets/ve.init.mw.ArticleTarget.js - About 2 hrs to fix

      Function wrapLine has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
      Open

      ve.ui.MWWikitextAction.prototype.wrapLine = function ( before, after, placeholder, unwrapOffsetsCallback ) {
          let originalFragment = this.surface.getModel().getFragment( null, false, true /* excludeInsertions */ );
          const selectedNodes = originalFragment.getLeafNodes();
      
          let unwrapped = false;
      Severity: Minor
      Found in modules/ve-mw/ui/actions/ve.ui.MWWikitextAction.js - About 2 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 swapPanel has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
      Open

      ve.ui.MWSaveDialog.prototype.swapPanel = function ( panel, noFocus ) {
          if ( ( [ 'save', 'review', 'preview', 'conflict' ].indexOf( panel ) ) === -1 ) {
              throw new Error( 'Unknown saveDialog panel: ' + panel );
          }
      
      
      Severity: Minor
      Found in modules/ve-mw/ui/dialogs/ve.ui.MWSaveDialog.js - About 2 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 VeUiMWTemplatePage has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
      Open

      ve.ui.MWTemplatePage = function VeUiMWTemplatePage( template, name, config ) {
          const link = template.getTemplateDataQueryTitle();
      
          // Configuration initialization
          config = ve.extendObject( {
      Severity: Minor
      Found in modules/ve-mw/ui/pages/ve.ui.MWTemplatePage.js - About 2 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 onSkinEditSectionLinks has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
      Open

          public function onSkinEditSectionLinks( $skin, $title, $section,
              $tooltip, &$result, $lang
          ) {
              $services = MediaWikiServices::getInstance();
              $userOptionsLookup = $services->getUserOptionsLookup();
      Severity: Minor
      Found in includes/Hooks.php - About 2 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

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

                  items: [
                      new OO.ui.ButtonOptionWidget( { data: 'visual', icon: 'eye', label: mw.msg( 'visualeditor-savedialog-review-visual' ) } ),
                      new OO.ui.ButtonOptionWidget( { data: 'source', icon: 'wikiText', label: mw.msg( 'visualeditor-savedialog-review-wikitext' ) } )
                  ]
      Severity: Major
      Found in modules/ve-mw/preinit/ve.init.mw.DiffPage.init.js and 1 other location - About 2 hrs to fix
      modules/ve-mw/ui/dialogs/ve.ui.MWSaveDialog.js on lines 609..612

      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

      Identical blocks of code found in 2 locations. Consider refactoring.
      Open

          this.metaItemCheckboxes.forEach( ( metaItemCheckbox ) => {
              const isSelected = !!this.getMetaItem( metaItemCheckbox.metaName );
              metaItemCheckbox.fieldLayout.getField()
                  .setSelected( isSelected )
                  .setDisabled( config.isReadOnly );
      Severity: Major
      Found in modules/ve-mw/ui/pages/ve.ui.MWAdvancedSettingsPage.js and 1 other location - About 2 hrs to fix
      modules/ve-mw/ui/pages/ve.ui.MWSettingsPage.js on lines 313..318

      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

      Identical blocks of code found in 2 locations. Consider refactoring.
      Open

          this.metaItemCheckboxes.forEach( ( metaItemCheckbox ) => {
              const isSelected = !!this.getMetaItem( metaItemCheckbox.metaName );
              metaItemCheckbox.fieldLayout.getField()
                  .setSelected( isSelected )
                  .setDisabled( config.isReadOnly );
      Severity: Major
      Found in modules/ve-mw/ui/pages/ve.ui.MWSettingsPage.js and 1 other location - About 2 hrs to fix
      modules/ve-mw/ui/pages/ve.ui.MWAdvancedSettingsPage.js on lines 229..234

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

          if ( captionNode ) {
              caption = converter.getDataFromDomClean( captionNode, { type: 'mwGalleryImageCaption' } );
          } else {
              caption = [
                  { type: 'mwGalleryImageCaption' },
      Severity: Major
      Found in modules/ve-mw/dm/nodes/ve.dm.MWGalleryImageNode.js and 1 other location - About 2 hrs to fix
      modules/ve-mw/dm/nodes/ve.dm.MWBlockImageNode.js on lines 149..158

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

          if ( captionNode ) {
              caption = converter.getDataFromDomClean( captionNode, { type: 'mwImageCaption' } );
          } else {
              caption = [
                  { type: 'mwImageCaption' },
      Severity: Major
      Found in modules/ve-mw/dm/nodes/ve.dm.MWBlockImageNode.js and 1 other location - About 2 hrs to fix
      modules/ve-mw/dm/nodes/ve.dm.MWGalleryImageNode.js on lines 114..123

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

              items: [
                  new OO.ui.ButtonOptionWidget( { data: 'visual', icon: 'eye', label: ve.msg( 'visualeditor-savedialog-review-visual' ) } ),
                  new OO.ui.ButtonOptionWidget( { data: 'source', icon: 'wikiText', label: ve.msg( 'visualeditor-savedialog-review-wikitext' ) } )
              ],
      Severity: Major
      Found in modules/ve-mw/ui/dialogs/ve.ui.MWSaveDialog.js and 1 other location - About 2 hrs to fix
      modules/ve-mw/preinit/ve.init.mw.DiffPage.init.js on lines 135..138

      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

      Function build has 56 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      ve.ui.MWTocWidget.prototype.build = function () {
          const $newTocList = $( '<ul>' ),
              nodes = this.doc.getNodesByType( 'mwHeading', true ),
              surfaceView = this.surface.getView(),
              documentView = surfaceView.getDocument(),
      Severity: Major
      Found in modules/ve-mw/ui/widgets/ve.ui.MWTocWidget.js - About 2 hrs to fix

        Function prepareCacheKey has 55 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        ve.init.mw.ArticleTarget.prototype.prepareCacheKey = function ( doc ) {
            const start = ve.now();
        
            if ( this.getSurface().getMode() === 'source' ) {
                return;
        Severity: Major
        Found in modules/ve-mw/init/targets/ve.init.mw.ArticleTarget.js - About 2 hrs to fix

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

              if ( href ) {
                  // Convert absolute URLs to relative if the href refers to a page on this wiki.
                  // Otherwise Parsoid generates |link= options for copy-pasted images (T193253).
                  const targetData = mw.libs.ve.getTargetDataFromHref( href, converter.getTargetHtmlDocument() );
                  if ( targetData.isInternal ) {
          Severity: Major
          Found in modules/ve-mw/dm/nodes/ve.dm.MWGalleryImageNode.js and 2 other locations - About 2 hrs to fix
          modules/ve-mw/dm/nodes/ve.dm.MWBlockImageNode.js on lines 88..95
          modules/ve-mw/dm/nodes/ve.dm.MWInlineImageNode.js on lines 74..81

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

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

                      Array.prototype.forEach.call( style.attributes, ( attr ) => {
                          if ( attr.name !== 'rel' && attr.name !== 'data-mw-deduplicate' ) {
                              link.setAttribute( attr.name, attr.value );
                          }
                      } );
          Severity: Major
          Found in modules/ve-mw/preinit/ve.utils.parsoid.js and 1 other location - About 2 hrs to fix
          modules/ve-mw/preinit/ve.utils.parsoid.js on lines 110..114

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

          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

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

              if ( href ) {
                  // Convert absolute URLs to relative if the href refers to a page on this wiki.
                  // Otherwise Parsoid generates |link= options for copy-pasted images (T193253).
                  const targetData = mw.libs.ve.getTargetDataFromHref( href, converter.getTargetHtmlDocument() );
                  if ( targetData.isInternal ) {
          Severity: Major
          Found in modules/ve-mw/dm/nodes/ve.dm.MWInlineImageNode.js and 2 other locations - About 2 hrs to fix
          modules/ve-mw/dm/nodes/ve.dm.MWBlockImageNode.js on lines 88..95
          modules/ve-mw/dm/nodes/ve.dm.MWGalleryImageNode.js on lines 139..146

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

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

                  Array.prototype.forEach.call( link.attributes, ( attr ) => {
                      if ( attr.name !== 'rel' && attr.name !== 'href' ) {
                          newStyle.setAttribute( attr.name, attr.value );
                      }
                  } );
          Severity: Major
          Found in modules/ve-mw/preinit/ve.utils.parsoid.js and 1 other location - About 2 hrs to fix
          modules/ve-mw/preinit/ve.utils.parsoid.js on lines 171..175

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

          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

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

              if ( href ) {
                  // Convert absolute URLs to relative if the href refers to a page on this wiki.
                  // Otherwise Parsoid generates |link= options for copy-pasted images (T193253).
                  const targetData = mw.libs.ve.getTargetDataFromHref( href, converter.getTargetHtmlDocument() );
                  if ( targetData.isInternal ) {
          Severity: Major
          Found in modules/ve-mw/dm/nodes/ve.dm.MWBlockImageNode.js and 2 other locations - About 2 hrs to fix
          modules/ve-mw/dm/nodes/ve.dm.MWGalleryImageNode.js on lines 139..146
          modules/ve-mw/dm/nodes/ve.dm.MWInlineImageNode.js on lines 74..81

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

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

          ve.ce.MWBlockImageNode.prototype.getDomPosition = function () {
              // We need to override this because this.$element can have children other than renderings of child
              // CE nodes (specifically, the image itself, this.$a), which throws the calculations out of whack.
              // Luckily, MWBlockImageNode is very simple and can contain at most one other node: its caption,
              // which is always inserted at the end.
          Severity: Major
          Found in modules/ve-mw/ce/nodes/ve.ce.MWBlockImageNode.js and 1 other location - About 2 hrs to fix
          modules/ve-mw/ce/nodes/ve.ce.MWGalleryImageNode.js on lines 127..137

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

          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