wikimedia/mediawiki-extensions-VisualEditor

View on GitHub

Showing 912 of 912 total issues

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

ve.ce.MWGalleryImageNode.prototype.getDomPosition = function () {
    // We need to override this because this.$element can have children other than renderings of child
    // CE nodes (specifically, the image, this.$thumbDiv), which throws the calculations out of whack.
    // Luckily, MWGalleryImageNode 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.MWGalleryImageNode.js and 1 other location - About 2 hrs to fix
modules/ve-mw/ce/nodes/ve.ce.MWBlockImageNode.js on lines 289..299

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

File ve.init.mw.CollabTarget.init.js has 258 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/*!
 * VisualEditor MediaWiki CollabTarget init.
 *
 * @copyright See AUTHORS.txt
 * @license The MIT License (MIT); see LICENSE.txt
Severity: Minor
Found in modules/ve-mw-collab/ve.init.mw.CollabTarget.init.js - About 2 hrs to fix

    File ve.init.mw.MobileArticleTarget.js has 257 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    /*!
     * VisualEditor MediaWiki Initialization MobileArticleTarget class.
     *
     * @copyright See AUTHORS.txt
     * @license The MIT License (MIT); see LICENSE.txt
    Severity: Minor
    Found in modules/ve-mw/init/targets/ve.init.mw.MobileArticleTarget.js - About 2 hrs to fix

      Function getSetupProcess has 54 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      ve.ui.MWTemplateDialog.prototype.getSetupProcess = function ( data ) {
          data = data || {};
          return ve.ui.MWTemplateDialog.super.prototype.getSetupProcess.call( this, data )
              .next( () => {
                  let promise;
      Severity: Major
      Found in modules/ve-mw/ui/dialogs/ve.ui.MWTemplateDialog.js - About 2 hrs to fix

        Function VeUiMWMediaInfoFieldWidget has 54 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        ve.ui.MWMediaInfoFieldWidget = function VeUiMWMediaInfoFieldWidget( content, config ) {
            // Configuration initialization
            config = config || {};
        
            // Parent constructor
        Severity: Major
        Found in modules/ve-mw/ui/widgets/ve.ui.MWMediaInfoFieldWidget.js - About 2 hrs to fix

          Function onReviewModeButtonSelectSelect has 54 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              function onReviewModeButtonSelectSelect( item ) {
                  let oldPageName, newPageName;
                  if ( mw.config.get( 'wgCanonicalSpecialPageName' ) !== 'ComparePages' ) {
                      oldPageName = newPageName = mw.config.get( 'wgRelevantPageName' );
                  } else {
          Severity: Major
          Found in modules/ve-mw/preinit/ve.init.mw.DiffPage.init.js - About 2 hrs to fix

            Function parseMetadata has 53 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            ve.init.mw.ArticleTarget.prototype.parseMetadata = function ( response ) {
                const data = response ? ( response.visualeditor || response.visualeditoredit ) : null;
            
                if ( !data ) {
                    this.loadFail( 've-api', { errors: [ {
            Severity: Major
            Found in modules/ve-mw/init/targets/ve.init.mw.ArticleTarget.js - About 2 hrs to fix

              Function VeInitMwArticleTarget has 53 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              ve.init.mw.ArticleTarget = function VeInitMwArticleTarget( config ) {
                  config = config || {};
                  config.toolbarConfig = ve.extendObject( {
                      shadow: true,
                      actions: true,
              Severity: Major
              Found in modules/ve-mw/init/targets/ve.init.mw.ArticleTarget.js - About 2 hrs to fix

                Function queryCategoryStatus has 53 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                ve.ui.MWCategoryWidget.prototype.queryCategoryStatus = function ( categoryNames ) {
                    // Get rid of any we already know the hidden status of, or have an entry
                    // if normalizedTitles (i.e. have been fetched before)
                    const categoryNamesToQuery = categoryNames.filter( ( name ) => {
                        if ( this.normalizedTitles[ name ] ) {
                Severity: Major
                Found in modules/ve-mw/ui/widgets/ve.ui.MWCategoryWidget.js - About 2 hrs to fix

                  Function create has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
                  Open

                  ve.ui.MWWikitextDataTransferHandlerFactory.prototype.create = function () {
                      // Parent method
                      const handler = ve.ui.MWWikitextDataTransferHandlerFactory.super.prototype.create.apply( this, arguments ),
                          resolve = handler.resolve.bind( handler );
                  
                  
                  Severity: Minor
                  Found in modules/ve-mw/ui/ve.ui.MWWikitextDataTransferHandlerFactory.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 build has a Cognitive Complexity of 16 (exceeds 5 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: Minor
                  Found in modules/ve-mw/ui/widgets/ve.ui.MWTocWidget.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 addExactMatch has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
                  Open

                  ve.ui.MWTemplateTitleInputWidget.prototype.addExactMatch = function ( response ) {
                      const query = this.getQueryValue(),
                          title = mw.Title.newFromText( query, this.namespace );
                      // No point in trying anything when the title is invalid
                      if ( !title ) {
                  Severity: Minor
                  Found in modules/ve-mw/ui/widgets/ve.ui.MWTemplateTitleInputWidget.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 save has 52 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  ve.init.mw.ArticleTarget.prototype.save = function ( doc, options ) {
                      // Prevent duplicate requests
                      if ( this.saving ) {
                          return this.saving;
                      }
                  Severity: Major
                  Found in modules/ve-mw/init/targets/ve.init.mw.ArticleTarget.js - About 2 hrs to fix

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

                    ve.dm.MWAlienInlineExtensionNode = function VeDmMWAlienInlineExtensionNode() {
                        // Parent constructor
                        ve.dm.MWAlienInlineExtensionNode.super.apply( this, arguments );
                    
                        // Mixin constructors
                    Severity: Major
                    Found in modules/ve-mw/dm/nodes/ve.dm.MWAlienInlineExtensionNode.js and 11 other locations - About 2 hrs to fix
                    modules/ve-mw/ce/nodes/ve.ce.MWAlienBlockExtensionNode.js on lines 20..26
                    modules/ve-mw/ce/nodes/ve.ce.MWImageCaptionNode.js on lines 19..25
                    modules/ve-mw/dm/nodes/ve.dm.MWAlienBlockExtensionNode.js on lines 20..26
                    modules/ve-mw/dm/nodes/ve.dm.MWGalleryNode.js on lines 18..24
                    modules/ve-mw/dm/nodes/ve.dm.MWInlineImageNode.js on lines 18..24
                    modules/ve-mw/dm/nodes/ve.dm.MWLanguageVariantNode.js on lines 19..25
                    modules/ve-mw/dm/nodes/ve.dm.MWMagicLinkNode.js on lines 18..24
                    modules/ve-mw/dm/nodes/ve.dm.MWNumberedExternalLinkNode.js on lines 18..24
                    modules/ve-mw/dm/nodes/ve.dm.MWTableNode.js on lines 19..25
                    modules/ve-mw/ui/dialogs/ve.ui.MWExtensionDialog.js on lines 19..25
                    modules/ve-mw/ui/inspectors/ve.ui.MWExtensionInspector.js on lines 19..25

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

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

                    ve.dm.MWLanguageVariantNode = function VeDmMWLanguageVariantNode() {
                        // Parent constructor
                        ve.dm.MWLanguageVariantNode.super.apply( this, arguments );
                    
                        // Mixin constructors
                    Severity: Major
                    Found in modules/ve-mw/dm/nodes/ve.dm.MWLanguageVariantNode.js and 11 other locations - About 2 hrs to fix
                    modules/ve-mw/ce/nodes/ve.ce.MWAlienBlockExtensionNode.js on lines 20..26
                    modules/ve-mw/ce/nodes/ve.ce.MWImageCaptionNode.js on lines 19..25
                    modules/ve-mw/dm/nodes/ve.dm.MWAlienBlockExtensionNode.js on lines 20..26
                    modules/ve-mw/dm/nodes/ve.dm.MWAlienInlineExtensionNode.js on lines 19..25
                    modules/ve-mw/dm/nodes/ve.dm.MWGalleryNode.js on lines 18..24
                    modules/ve-mw/dm/nodes/ve.dm.MWInlineImageNode.js on lines 18..24
                    modules/ve-mw/dm/nodes/ve.dm.MWMagicLinkNode.js on lines 18..24
                    modules/ve-mw/dm/nodes/ve.dm.MWNumberedExternalLinkNode.js on lines 18..24
                    modules/ve-mw/dm/nodes/ve.dm.MWTableNode.js on lines 19..25
                    modules/ve-mw/ui/dialogs/ve.ui.MWExtensionDialog.js on lines 19..25
                    modules/ve-mw/ui/inspectors/ve.ui.MWExtensionInspector.js on lines 19..25

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

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

                    ve.dm.MWAlienBlockExtensionNode = function VeDmMWAlienBlockExtensionNode() {
                        // Parent constructor
                        ve.dm.MWAlienBlockExtensionNode.super.apply( this, arguments );
                    
                        // Mixin constructors
                    Severity: Major
                    Found in modules/ve-mw/dm/nodes/ve.dm.MWAlienBlockExtensionNode.js and 11 other locations - About 2 hrs to fix
                    modules/ve-mw/ce/nodes/ve.ce.MWAlienBlockExtensionNode.js on lines 20..26
                    modules/ve-mw/ce/nodes/ve.ce.MWImageCaptionNode.js on lines 19..25
                    modules/ve-mw/dm/nodes/ve.dm.MWAlienInlineExtensionNode.js on lines 19..25
                    modules/ve-mw/dm/nodes/ve.dm.MWGalleryNode.js on lines 18..24
                    modules/ve-mw/dm/nodes/ve.dm.MWInlineImageNode.js on lines 18..24
                    modules/ve-mw/dm/nodes/ve.dm.MWLanguageVariantNode.js on lines 19..25
                    modules/ve-mw/dm/nodes/ve.dm.MWMagicLinkNode.js on lines 18..24
                    modules/ve-mw/dm/nodes/ve.dm.MWNumberedExternalLinkNode.js on lines 18..24
                    modules/ve-mw/dm/nodes/ve.dm.MWTableNode.js on lines 19..25
                    modules/ve-mw/ui/dialogs/ve.ui.MWExtensionDialog.js on lines 19..25
                    modules/ve-mw/ui/inspectors/ve.ui.MWExtensionInspector.js on lines 19..25

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

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

                    ve.ui.MWExtensionDialog = function VeUiMWExtensionDialog() {
                        // Parent constructor
                        ve.ui.MWExtensionDialog.super.apply( this, arguments );
                    
                        // Mixin constructors
                    Severity: Major
                    Found in modules/ve-mw/ui/dialogs/ve.ui.MWExtensionDialog.js and 11 other locations - About 2 hrs to fix
                    modules/ve-mw/ce/nodes/ve.ce.MWAlienBlockExtensionNode.js on lines 20..26
                    modules/ve-mw/ce/nodes/ve.ce.MWImageCaptionNode.js on lines 19..25
                    modules/ve-mw/dm/nodes/ve.dm.MWAlienBlockExtensionNode.js on lines 20..26
                    modules/ve-mw/dm/nodes/ve.dm.MWAlienInlineExtensionNode.js on lines 19..25
                    modules/ve-mw/dm/nodes/ve.dm.MWGalleryNode.js on lines 18..24
                    modules/ve-mw/dm/nodes/ve.dm.MWInlineImageNode.js on lines 18..24
                    modules/ve-mw/dm/nodes/ve.dm.MWLanguageVariantNode.js on lines 19..25
                    modules/ve-mw/dm/nodes/ve.dm.MWMagicLinkNode.js on lines 18..24
                    modules/ve-mw/dm/nodes/ve.dm.MWNumberedExternalLinkNode.js on lines 18..24
                    modules/ve-mw/dm/nodes/ve.dm.MWTableNode.js on lines 19..25
                    modules/ve-mw/ui/inspectors/ve.ui.MWExtensionInspector.js on lines 19..25

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

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

                    ve.dm.MWTableNode = function VeDmMWTableNode() {
                        // Parent constructor
                        ve.dm.MWTableNode.super.apply( this, arguments );
                    
                        // Mixin constructors
                    Severity: Major
                    Found in modules/ve-mw/dm/nodes/ve.dm.MWTableNode.js and 11 other locations - About 2 hrs to fix
                    modules/ve-mw/ce/nodes/ve.ce.MWAlienBlockExtensionNode.js on lines 20..26
                    modules/ve-mw/ce/nodes/ve.ce.MWImageCaptionNode.js on lines 19..25
                    modules/ve-mw/dm/nodes/ve.dm.MWAlienBlockExtensionNode.js on lines 20..26
                    modules/ve-mw/dm/nodes/ve.dm.MWAlienInlineExtensionNode.js on lines 19..25
                    modules/ve-mw/dm/nodes/ve.dm.MWGalleryNode.js on lines 18..24
                    modules/ve-mw/dm/nodes/ve.dm.MWInlineImageNode.js on lines 18..24
                    modules/ve-mw/dm/nodes/ve.dm.MWLanguageVariantNode.js on lines 19..25
                    modules/ve-mw/dm/nodes/ve.dm.MWMagicLinkNode.js on lines 18..24
                    modules/ve-mw/dm/nodes/ve.dm.MWNumberedExternalLinkNode.js on lines 18..24
                    modules/ve-mw/ui/dialogs/ve.ui.MWExtensionDialog.js on lines 19..25
                    modules/ve-mw/ui/inspectors/ve.ui.MWExtensionInspector.js on lines 19..25

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

                    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

                        saveTeardown: function () {
                            const done = arguments[ arguments.length - 1 ],
                                surface = ve.init.target.surface;
                            surface.dialogs.currentWindow.close().closed.then( done );
                        },
                    Severity: Major
                    Found in build/screenshots-client/userGuide.js and 1 other location - About 2 hrs to fix
                    build/screenshots-client/userGuide.js on lines 178..182

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

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

                    ve.dm.MWInlineImageNode = function VeDmMWInlineImageNode() {
                        // Parent constructor
                        ve.dm.MWInlineImageNode.super.apply( this, arguments );
                    
                        // Mixin constructors
                    Severity: Major
                    Found in modules/ve-mw/dm/nodes/ve.dm.MWInlineImageNode.js and 11 other locations - About 2 hrs to fix
                    modules/ve-mw/ce/nodes/ve.ce.MWAlienBlockExtensionNode.js on lines 20..26
                    modules/ve-mw/ce/nodes/ve.ce.MWImageCaptionNode.js on lines 19..25
                    modules/ve-mw/dm/nodes/ve.dm.MWAlienBlockExtensionNode.js on lines 20..26
                    modules/ve-mw/dm/nodes/ve.dm.MWAlienInlineExtensionNode.js on lines 19..25
                    modules/ve-mw/dm/nodes/ve.dm.MWGalleryNode.js on lines 18..24
                    modules/ve-mw/dm/nodes/ve.dm.MWLanguageVariantNode.js on lines 19..25
                    modules/ve-mw/dm/nodes/ve.dm.MWMagicLinkNode.js on lines 18..24
                    modules/ve-mw/dm/nodes/ve.dm.MWNumberedExternalLinkNode.js on lines 18..24
                    modules/ve-mw/dm/nodes/ve.dm.MWTableNode.js on lines 19..25
                    modules/ve-mw/ui/dialogs/ve.ui.MWExtensionDialog.js on lines 19..25
                    modules/ve-mw/ui/inspectors/ve.ui.MWExtensionInspector.js on lines 19..25

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

                    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