wikimedia/mediawiki-extensions-VisualEditor

View on GitHub

Showing 912 of 912 total issues

Consider simplifying this complex logical expression.
Open

    if ( mode === 'traditional' || mode === 'nolines' || mode === 'slideshow' ) {
        const imagePadding = ( mode === 'traditional' ? 30 : 0 );
        innerDivWidth = parseInt( galleryMwAttrs.widths || defaults.imageWidth ) + imagePadding;
        innerDivHeight = parseInt( galleryMwAttrs.heights || defaults.imageHeight ) + imagePadding;
        if ( mode === 'traditional' ) {
Severity: Major
Found in modules/ve-mw/ce/nodes/ve.ce.MWGalleryImageNode.js - About 40 mins to fix

    Consider simplifying this complex logical expression.
    Open

                if (
                    // Modified click (e.g. ctrl+click)
                    !init.isUnmodifiedLeftClick( e ) ||
                    // Not an edit action
                    !( linkUrl.searchParams.has( 'action' ) || linkUrl.searchParams.has( 'veaction' ) ) ||
    Severity: Major
    Found in modules/ve-mw/preinit/ve.init.mw.DesktopArticleTarget.init.js - About 40 mins to fix

      Consider simplifying this complex logical expression.
      Open

              if (
                  $config->get( 'VisualEditorUseSingleEditTab' ) &&
                  wfTimestampNow() < $config->get( 'VisualEditorSingleEditTabSwitchTimeEnd' ) &&
                  $user->isNamed() &&
                  self::enabledForUser( $user ) &&
      Severity: Major
      Found in includes/Hooks.php - About 40 mins to fix

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

        ve.ui.MWCategoriesDialogTool = function VeUiMWCategoriesDialogTool() {
            ve.ui.MWCategoriesDialogTool.super.apply( this, arguments );
        };
        Severity: Major
        Found in modules/ve-mw/ui/tools/ve.ui.MWMetaDialogTool.js and 12 other locations - About 40 mins to fix
        editcheck/modules/EditCheckDialog.js on lines 117..119
        modules/ve-mw/ui/tools/ve.ui.MWFormatTool.js on lines 35..37
        modules/ve-mw/ui/tools/ve.ui.MWFormatTool.js on lines 53..55
        modules/ve-mw/ui/tools/ve.ui.MWFormatTool.js on lines 71..73
        modules/ve-mw/ui/tools/ve.ui.MWFormatTool.js on lines 89..91
        modules/ve-mw/ui/tools/ve.ui.MWFormatTool.js on lines 107..109
        modules/ve-mw/ui/tools/ve.ui.MWFormatTool.js on lines 136..138
        modules/ve-mw/ui/tools/ve.ui.MWMetaDialogTool.js on lines 37..39
        modules/ve-mw/ui/tools/ve.ui.MWMetaDialogTool.js on lines 95..97
        modules/ve-mw/ui/tools/ve.ui.MWMetaDialogTool.js on lines 124..126
        modules/ve-mw/ui/tools/ve.ui.MWMetaDialogTool.js on lines 153..155
        modules/ve-mw/ui/tools/ve.ui.MWMetaDialogTool.js on lines 182..184

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

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

        ve.ui.MWHeading3FormatTool = function VeUiMWHeading3FormatTool() {
            ve.ui.MWHeading3FormatTool.super.apply( this, arguments );
        };
        Severity: Major
        Found in modules/ve-mw/ui/tools/ve.ui.MWFormatTool.js and 12 other locations - About 40 mins to fix
        editcheck/modules/EditCheckDialog.js on lines 117..119
        modules/ve-mw/ui/tools/ve.ui.MWFormatTool.js on lines 35..37
        modules/ve-mw/ui/tools/ve.ui.MWFormatTool.js on lines 71..73
        modules/ve-mw/ui/tools/ve.ui.MWFormatTool.js on lines 89..91
        modules/ve-mw/ui/tools/ve.ui.MWFormatTool.js on lines 107..109
        modules/ve-mw/ui/tools/ve.ui.MWFormatTool.js on lines 136..138
        modules/ve-mw/ui/tools/ve.ui.MWMetaDialogTool.js on lines 37..39
        modules/ve-mw/ui/tools/ve.ui.MWMetaDialogTool.js on lines 66..68
        modules/ve-mw/ui/tools/ve.ui.MWMetaDialogTool.js on lines 95..97
        modules/ve-mw/ui/tools/ve.ui.MWMetaDialogTool.js on lines 124..126
        modules/ve-mw/ui/tools/ve.ui.MWMetaDialogTool.js on lines 153..155
        modules/ve-mw/ui/tools/ve.ui.MWMetaDialogTool.js on lines 182..184

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

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

        ve.ui.MWPageSettingsDialogTool = function VeUiMWPageSettingsDialogTool() {
            ve.ui.MWPageSettingsDialogTool.super.apply( this, arguments );
        };
        Severity: Major
        Found in modules/ve-mw/ui/tools/ve.ui.MWMetaDialogTool.js and 12 other locations - About 40 mins to fix
        editcheck/modules/EditCheckDialog.js on lines 117..119
        modules/ve-mw/ui/tools/ve.ui.MWFormatTool.js on lines 35..37
        modules/ve-mw/ui/tools/ve.ui.MWFormatTool.js on lines 53..55
        modules/ve-mw/ui/tools/ve.ui.MWFormatTool.js on lines 71..73
        modules/ve-mw/ui/tools/ve.ui.MWFormatTool.js on lines 89..91
        modules/ve-mw/ui/tools/ve.ui.MWFormatTool.js on lines 107..109
        modules/ve-mw/ui/tools/ve.ui.MWFormatTool.js on lines 136..138
        modules/ve-mw/ui/tools/ve.ui.MWMetaDialogTool.js on lines 37..39
        modules/ve-mw/ui/tools/ve.ui.MWMetaDialogTool.js on lines 66..68
        modules/ve-mw/ui/tools/ve.ui.MWMetaDialogTool.js on lines 124..126
        modules/ve-mw/ui/tools/ve.ui.MWMetaDialogTool.js on lines 153..155
        modules/ve-mw/ui/tools/ve.ui.MWMetaDialogTool.js on lines 182..184

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

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

        ve.ui.MWAdvancedPageSettingsDialogTool = function VeUiMWAdvancedPageSettingsDialogTool() {
            ve.ui.MWAdvancedPageSettingsDialogTool.super.apply( this, arguments );
        };
        Severity: Major
        Found in modules/ve-mw/ui/tools/ve.ui.MWMetaDialogTool.js and 12 other locations - About 40 mins to fix
        editcheck/modules/EditCheckDialog.js on lines 117..119
        modules/ve-mw/ui/tools/ve.ui.MWFormatTool.js on lines 35..37
        modules/ve-mw/ui/tools/ve.ui.MWFormatTool.js on lines 53..55
        modules/ve-mw/ui/tools/ve.ui.MWFormatTool.js on lines 71..73
        modules/ve-mw/ui/tools/ve.ui.MWFormatTool.js on lines 89..91
        modules/ve-mw/ui/tools/ve.ui.MWFormatTool.js on lines 107..109
        modules/ve-mw/ui/tools/ve.ui.MWFormatTool.js on lines 136..138
        modules/ve-mw/ui/tools/ve.ui.MWMetaDialogTool.js on lines 37..39
        modules/ve-mw/ui/tools/ve.ui.MWMetaDialogTool.js on lines 66..68
        modules/ve-mw/ui/tools/ve.ui.MWMetaDialogTool.js on lines 95..97
        modules/ve-mw/ui/tools/ve.ui.MWMetaDialogTool.js on lines 153..155
        modules/ve-mw/ui/tools/ve.ui.MWMetaDialogTool.js on lines 182..184

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

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

        ve.ui.MWPreformattedFormatTool = function VeUiMWPreformattedFormatTool() {
            ve.ui.MWPreformattedFormatTool.super.apply( this, arguments );
        };
        Severity: Major
        Found in modules/ve-mw/ui/tools/ve.ui.MWFormatTool.js and 12 other locations - About 40 mins to fix
        editcheck/modules/EditCheckDialog.js on lines 117..119
        modules/ve-mw/ui/tools/ve.ui.MWFormatTool.js on lines 35..37
        modules/ve-mw/ui/tools/ve.ui.MWFormatTool.js on lines 53..55
        modules/ve-mw/ui/tools/ve.ui.MWFormatTool.js on lines 71..73
        modules/ve-mw/ui/tools/ve.ui.MWFormatTool.js on lines 89..91
        modules/ve-mw/ui/tools/ve.ui.MWFormatTool.js on lines 107..109
        modules/ve-mw/ui/tools/ve.ui.MWMetaDialogTool.js on lines 37..39
        modules/ve-mw/ui/tools/ve.ui.MWMetaDialogTool.js on lines 66..68
        modules/ve-mw/ui/tools/ve.ui.MWMetaDialogTool.js on lines 95..97
        modules/ve-mw/ui/tools/ve.ui.MWMetaDialogTool.js on lines 124..126
        modules/ve-mw/ui/tools/ve.ui.MWMetaDialogTool.js on lines 153..155
        modules/ve-mw/ui/tools/ve.ui.MWMetaDialogTool.js on lines 182..184

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

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

        ve.ui.MWLanguagesDialogTool = function VeUiMWLanguagesDialogTool() {
            ve.ui.MWLanguagesDialogTool.super.apply( this, arguments );
        };
        Severity: Major
        Found in modules/ve-mw/ui/tools/ve.ui.MWMetaDialogTool.js and 12 other locations - About 40 mins to fix
        editcheck/modules/EditCheckDialog.js on lines 117..119
        modules/ve-mw/ui/tools/ve.ui.MWFormatTool.js on lines 35..37
        modules/ve-mw/ui/tools/ve.ui.MWFormatTool.js on lines 53..55
        modules/ve-mw/ui/tools/ve.ui.MWFormatTool.js on lines 71..73
        modules/ve-mw/ui/tools/ve.ui.MWFormatTool.js on lines 89..91
        modules/ve-mw/ui/tools/ve.ui.MWFormatTool.js on lines 107..109
        modules/ve-mw/ui/tools/ve.ui.MWFormatTool.js on lines 136..138
        modules/ve-mw/ui/tools/ve.ui.MWMetaDialogTool.js on lines 37..39
        modules/ve-mw/ui/tools/ve.ui.MWMetaDialogTool.js on lines 66..68
        modules/ve-mw/ui/tools/ve.ui.MWMetaDialogTool.js on lines 95..97
        modules/ve-mw/ui/tools/ve.ui.MWMetaDialogTool.js on lines 124..126
        modules/ve-mw/ui/tools/ve.ui.MWMetaDialogTool.js on lines 182..184

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

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

        ve.ui.MWMetaDialogTool = function VeUiMWMetaDialogTool() {
            ve.ui.MWMetaDialogTool.super.apply( this, arguments );
        };
        Severity: Major
        Found in modules/ve-mw/ui/tools/ve.ui.MWMetaDialogTool.js and 12 other locations - About 40 mins to fix
        editcheck/modules/EditCheckDialog.js on lines 117..119
        modules/ve-mw/ui/tools/ve.ui.MWFormatTool.js on lines 35..37
        modules/ve-mw/ui/tools/ve.ui.MWFormatTool.js on lines 53..55
        modules/ve-mw/ui/tools/ve.ui.MWFormatTool.js on lines 71..73
        modules/ve-mw/ui/tools/ve.ui.MWFormatTool.js on lines 89..91
        modules/ve-mw/ui/tools/ve.ui.MWFormatTool.js on lines 107..109
        modules/ve-mw/ui/tools/ve.ui.MWFormatTool.js on lines 136..138
        modules/ve-mw/ui/tools/ve.ui.MWMetaDialogTool.js on lines 66..68
        modules/ve-mw/ui/tools/ve.ui.MWMetaDialogTool.js on lines 95..97
        modules/ve-mw/ui/tools/ve.ui.MWMetaDialogTool.js on lines 124..126
        modules/ve-mw/ui/tools/ve.ui.MWMetaDialogTool.js on lines 153..155
        modules/ve-mw/ui/tools/ve.ui.MWMetaDialogTool.js on lines 182..184

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

        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

            if ( action === 'convert' ) {
                return new OO.ui.Process( () => {
                    this.close( { action: action } );
                } );
            }
        Severity: Minor
        Found in modules/ve-mw/ui/inspectors/ve.ui.MWMagicLinkNodeInspector.js and 1 other location - About 40 mins to fix
        modules/ve-mw/ui/inspectors/ve.ui.MWLinkNodeInspector.js on lines 65..69

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

        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

                    if ( offset > -1 ) {
                        fragment = fragment.clone( new ve.dm.LinearSelection( new ve.Range( offset ) ) );
                    }
        Severity: Minor
        Found in modules/ve-mw/dm/models/ve.dm.MWImageModel.js and 1 other location - About 40 mins to fix
        modules/ve-mw/dm/models/ve.dm.MWImageModel.js on lines 497..499

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

        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

            const languageInput = new ve.ui.LanguageInputWidget( {
                dialogManager: this.manager.getSurface().getDialogs(),
                dirInput: 'none'
            } );
        Severity: Minor
        Found in modules/ve-mw/ui/inspectors/ve.ui.MWLanguageVariantInspector.js and 1 other location - About 40 mins to fix
        modules/ve-mw/ui/inspectors/ve.ui.MWLanguageVariantInspector.js on lines 751..754

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

        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

            if ( action === 'convert' ) {
                return new OO.ui.Process( () => {
                    this.close( { action: action } );
                } );
            }
        Severity: Minor
        Found in modules/ve-mw/ui/inspectors/ve.ui.MWLinkNodeInspector.js and 1 other location - About 40 mins to fix
        modules/ve-mw/ui/inspectors/ve.ui.MWMagicLinkNodeInspector.js on lines 94..98

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

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

        ve.ui.MWHeading2FormatTool = function VeUiMWHeading2FormatTool() {
            ve.ui.MWHeading2FormatTool.super.apply( this, arguments );
        };
        Severity: Major
        Found in modules/ve-mw/ui/tools/ve.ui.MWFormatTool.js and 12 other locations - About 40 mins to fix
        editcheck/modules/EditCheckDialog.js on lines 117..119
        modules/ve-mw/ui/tools/ve.ui.MWFormatTool.js on lines 53..55
        modules/ve-mw/ui/tools/ve.ui.MWFormatTool.js on lines 71..73
        modules/ve-mw/ui/tools/ve.ui.MWFormatTool.js on lines 89..91
        modules/ve-mw/ui/tools/ve.ui.MWFormatTool.js on lines 107..109
        modules/ve-mw/ui/tools/ve.ui.MWFormatTool.js on lines 136..138
        modules/ve-mw/ui/tools/ve.ui.MWMetaDialogTool.js on lines 37..39
        modules/ve-mw/ui/tools/ve.ui.MWMetaDialogTool.js on lines 66..68
        modules/ve-mw/ui/tools/ve.ui.MWMetaDialogTool.js on lines 95..97
        modules/ve-mw/ui/tools/ve.ui.MWMetaDialogTool.js on lines 124..126
        modules/ve-mw/ui/tools/ve.ui.MWMetaDialogTool.js on lines 153..155
        modules/ve-mw/ui/tools/ve.ui.MWMetaDialogTool.js on lines 182..184

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

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

        ve.ui.MWTemplatesUsedDialogTool = function VeUiMWTemplatesUsedDialogTool() {
            ve.ui.MWTemplatesUsedDialogTool.super.apply( this, arguments );
        };
        Severity: Major
        Found in modules/ve-mw/ui/tools/ve.ui.MWMetaDialogTool.js and 12 other locations - About 40 mins to fix
        editcheck/modules/EditCheckDialog.js on lines 117..119
        modules/ve-mw/ui/tools/ve.ui.MWFormatTool.js on lines 35..37
        modules/ve-mw/ui/tools/ve.ui.MWFormatTool.js on lines 53..55
        modules/ve-mw/ui/tools/ve.ui.MWFormatTool.js on lines 71..73
        modules/ve-mw/ui/tools/ve.ui.MWFormatTool.js on lines 89..91
        modules/ve-mw/ui/tools/ve.ui.MWFormatTool.js on lines 107..109
        modules/ve-mw/ui/tools/ve.ui.MWFormatTool.js on lines 136..138
        modules/ve-mw/ui/tools/ve.ui.MWMetaDialogTool.js on lines 37..39
        modules/ve-mw/ui/tools/ve.ui.MWMetaDialogTool.js on lines 66..68
        modules/ve-mw/ui/tools/ve.ui.MWMetaDialogTool.js on lines 95..97
        modules/ve-mw/ui/tools/ve.ui.MWMetaDialogTool.js on lines 124..126
        modules/ve-mw/ui/tools/ve.ui.MWMetaDialogTool.js on lines 153..155

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

        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.ui.MWWikitextStringTransferHandler.static.types = [
            ...ve.ui.MWWikitextStringTransferHandler.super.static.types,
            'text/x-wiki'
        ];
        modules/ve-mw/ui/datatransferhandlers/ve.ui.MWWikitextPlainTextStringTransferHandler.js on lines 39..42

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

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

        ve.ui.EditCheckDialogTool = function VeUiEditCheckDialogTool() {
            ve.ui.EditCheckDialogTool.super.apply( this, arguments );
        };
        Severity: Major
        Found in editcheck/modules/EditCheckDialog.js and 12 other locations - About 40 mins to fix
        modules/ve-mw/ui/tools/ve.ui.MWFormatTool.js on lines 35..37
        modules/ve-mw/ui/tools/ve.ui.MWFormatTool.js on lines 53..55
        modules/ve-mw/ui/tools/ve.ui.MWFormatTool.js on lines 71..73
        modules/ve-mw/ui/tools/ve.ui.MWFormatTool.js on lines 89..91
        modules/ve-mw/ui/tools/ve.ui.MWFormatTool.js on lines 107..109
        modules/ve-mw/ui/tools/ve.ui.MWFormatTool.js on lines 136..138
        modules/ve-mw/ui/tools/ve.ui.MWMetaDialogTool.js on lines 37..39
        modules/ve-mw/ui/tools/ve.ui.MWMetaDialogTool.js on lines 66..68
        modules/ve-mw/ui/tools/ve.ui.MWMetaDialogTool.js on lines 95..97
        modules/ve-mw/ui/tools/ve.ui.MWMetaDialogTool.js on lines 124..126
        modules/ve-mw/ui/tools/ve.ui.MWMetaDialogTool.js on lines 153..155
        modules/ve-mw/ui/tools/ve.ui.MWMetaDialogTool.js on lines 182..184

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

        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

            const languageInput = new ve.ui.LanguageInputWidget( {
                dialogManager: this.manager.getSurface().getDialogs(),
                dirInput: 'none'
            } );
        Severity: Minor
        Found in modules/ve-mw/ui/inspectors/ve.ui.MWLanguageVariantInspector.js and 1 other location - About 40 mins to fix
        modules/ve-mw/ui/inspectors/ve.ui.MWLanguageVariantInspector.js on lines 600..603

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

        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.dm.MWNumberedExternalLinkNode.prototype.getHref = function () {
            return this.element.attributes.href;
        };
        Severity: Minor
        Found in modules/ve-mw/dm/nodes/ve.dm.MWNumberedExternalLinkNode.js and 1 other location - About 40 mins to fix
        modules/ve-mw/dm/nodes/ve.dm.MWLanguageVariantNode.js on lines 304..306

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

        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