wikimedia/mediawiki-extensions-VisualEditor

View on GitHub

Showing 469 of 903 total issues

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

ve.ui.MWLanguageVariantTwoWayInspector.prototype.initialize = function () {
    ve.ui.MWLanguageVariantTwoWayInspector.super.prototype.initialize.call( this );
    this.items = [];
    this.layout = new OO.ui.FieldsetLayout( { } );
    this.form.$element.append( this.layout.$element );
modules/ve-mw/ui/inspectors/ve.ui.MWLanguageVariantInspector.js on lines 707..721

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

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.MWLanguageVariantOneWayInspector.prototype.initialize = function () {
    ve.ui.MWLanguageVariantOneWayInspector.super.prototype.initialize.call( this );
    this.items = [];
    this.layout = new OO.ui.FieldsetLayout( { } );
    this.form.$element.append( this.layout.$element );
modules/ve-mw/ui/inspectors/ve.ui.MWLanguageVariantInspector.js on lines 558..572

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

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

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

    if ( this.newSectionEditLinkOptionTouched ) {
        if ( newNewSectionEditLinkData.data === 'default' ) {
            if ( currentNewSectionEditLinkItem ) {
                this.fragment.removeMeta( currentNewSectionEditLinkItem );
            }
Severity: Major
Found in modules/ve-mw/ui/pages/ve.ui.MWAdvancedSettingsPage.js and 2 other locations - About 6 hrs to fix
modules/ve-mw/ui/pages/ve.ui.MWAdvancedSettingsPage.js on lines 262..279
modules/ve-mw/ui/pages/ve.ui.MWSettingsPage.js on lines 354..371

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

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

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

    if ( this.tableOfContentsTouched ) {
        if ( newTableOfContentsData.data === 'default' ) {
            if ( currentTableOfContents ) {
                this.fragment.removeMeta( currentTableOfContents );
            }
Severity: Major
Found in modules/ve-mw/ui/pages/ve.ui.MWSettingsPage.js and 2 other locations - About 6 hrs to fix
modules/ve-mw/ui/pages/ve.ui.MWAdvancedSettingsPage.js on lines 262..279
modules/ve-mw/ui/pages/ve.ui.MWAdvancedSettingsPage.js on lines 286..303

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

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

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

    if ( this.indexingOptionTouched ) {
        if ( newIndexingData.data === 'default' ) {
            if ( currentIndexingItem ) {
                this.fragment.removeMeta( currentIndexingItem );
            }
Severity: Major
Found in modules/ve-mw/ui/pages/ve.ui.MWAdvancedSettingsPage.js and 2 other locations - About 6 hrs to fix
modules/ve-mw/ui/pages/ve.ui.MWAdvancedSettingsPage.js on lines 286..303
modules/ve-mw/ui/pages/ve.ui.MWSettingsPage.js on lines 354..371

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

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

    citoidInspectorManual: function () {
        var done = arguments[ arguments.length - 1 ],
            surface = ve.init.target.surface;
        surface.context.inspectors.currentWindow.setModePanel( 'manual' );
        setTimeout( function () {
Severity: Major
Found in build/screenshots-client/userGuide.js and 1 other location - About 5 hrs to fix
build/screenshots-client/userGuide.js on lines 52..64

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

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

    citoidInspectorReuse: function () {
        var done = arguments[ arguments.length - 1 ],
            surface = ve.init.target.surface;
        surface.context.inspectors.currentWindow.setModePanel( 'reuse' );
        setTimeout( function () {
Severity: Major
Found in build/screenshots-client/userGuide.js and 1 other location - About 5 hrs to fix
build/screenshots-client/userGuide.js on lines 39..51

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

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

        new OO.ui.ButtonSelectWidget()
            .addItems( [
                new OO.ui.ButtonOptionWidget( {
                    data: 'mw:PageProp/index',
                    label: ve.msg( 'visualeditor-dialog-meta-settings-index-force' )
Severity: Major
Found in modules/ve-mw/ui/pages/ve.ui.MWAdvancedSettingsPage.js and 1 other location - About 4 hrs to fix
modules/ve-mw/ui/pages/ve.ui.MWAdvancedSettingsPage.js on lines 65..80

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

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

        new OO.ui.ButtonSelectWidget()
            .addItems( [
                new OO.ui.ButtonOptionWidget( {
                    data: 'mw:PageProp/newsectionlink',
                    label: ve.msg( 'visualeditor-dialog-meta-settings-newsectioneditlink-force' )
Severity: Major
Found in modules/ve-mw/ui/pages/ve.ui.MWAdvancedSettingsPage.js and 1 other location - About 4 hrs to fix
modules/ve-mw/ui/pages/ve.ui.MWAdvancedSettingsPage.js on lines 39..54

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

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 ( currentDisplayTitleItem ) {
            if ( newDisplayTitle ) {
                if ( currentDisplayTitleItem.getAttribute( 'content' ) !== newDisplayTitle ) {
                    // There was a display title and is a new one, but they differ, so replace
                    this.fragment.replaceMeta(
Severity: Major
Found in modules/ve-mw/ui/pages/ve.ui.MWAdvancedSettingsPage.js and 1 other location - About 4 hrs to fix
modules/ve-mw/ui/pages/ve.ui.MWSettingsPage.js on lines 375..397

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

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 ( currentRedirectTargetItem ) {
            if ( newRedirectData ) {
                if ( currentRedirectTargetItem.getAttribute( 'title' ) !== newRedirectData ) {
                    // There was a redirect and is a new one, but they differ, so replace
                    this.fragment.replaceMeta(
Severity: Major
Found in modules/ve-mw/ui/pages/ve.ui.MWSettingsPage.js and 1 other location - About 4 hrs to fix
modules/ve-mw/ui/pages/ve.ui.MWAdvancedSettingsPage.js on lines 315..337

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

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

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

ve.ui.MWExtensionDialog.prototype.getSetupProcess = function ( data ) {
    data = data || {};
    // Parent process
    var process = ve.ui.MWExtensionDialog.super.prototype.getSetupProcess.call( this, data );
    // Mixin process
Severity: Major
Found in modules/ve-mw/ui/dialogs/ve.ui.MWExtensionDialog.js and 4 other locations - About 4 hrs to fix
modules/ve-mw/ui/dialogs/ve.ui.MWExtensionDialog.js on lines 63..69
modules/ve-mw/ui/dialogs/ve.ui.MWExtensionDialog.js on lines 74..80
modules/ve-mw/ui/inspectors/ve.ui.MWExtensionInspector.js on lines 53..59
modules/ve-mw/ui/inspectors/ve.ui.MWExtensionInspector.js on lines 78..84

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

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

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

ve.ui.MWExtensionInspector.prototype.getSetupProcess = function ( data ) {
    data = data || {};
    // Parent process
    var process = ve.ui.MWExtensionInspector.super.prototype.getSetupProcess.call( this, data );
    // Mixin process
Severity: Major
Found in modules/ve-mw/ui/inspectors/ve.ui.MWExtensionInspector.js and 4 other locations - About 4 hrs to fix
modules/ve-mw/ui/dialogs/ve.ui.MWExtensionDialog.js on lines 52..58
modules/ve-mw/ui/dialogs/ve.ui.MWExtensionDialog.js on lines 63..69
modules/ve-mw/ui/dialogs/ve.ui.MWExtensionDialog.js on lines 74..80
modules/ve-mw/ui/inspectors/ve.ui.MWExtensionInspector.js on lines 78..84

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

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

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

ve.ui.MWExtensionInspector.prototype.getTeardownProcess = function ( data ) {
    data = data || {};
    // Parent process
    var process = ve.ui.MWExtensionInspector.super.prototype.getTeardownProcess.call( this, data );
    // Mixin process
Severity: Major
Found in modules/ve-mw/ui/inspectors/ve.ui.MWExtensionInspector.js and 4 other locations - About 4 hrs to fix
modules/ve-mw/ui/dialogs/ve.ui.MWExtensionDialog.js on lines 52..58
modules/ve-mw/ui/dialogs/ve.ui.MWExtensionDialog.js on lines 63..69
modules/ve-mw/ui/dialogs/ve.ui.MWExtensionDialog.js on lines 74..80
modules/ve-mw/ui/inspectors/ve.ui.MWExtensionInspector.js on lines 53..59

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

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

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

ve.ui.MWExtensionDialog.prototype.getReadyProcess = function ( data ) {
    data = data || {};
    // Parent process
    var process = ve.ui.MWExtensionDialog.super.prototype.getReadyProcess.call( this, data );
    // Mixin process
Severity: Major
Found in modules/ve-mw/ui/dialogs/ve.ui.MWExtensionDialog.js and 4 other locations - About 4 hrs to fix
modules/ve-mw/ui/dialogs/ve.ui.MWExtensionDialog.js on lines 52..58
modules/ve-mw/ui/dialogs/ve.ui.MWExtensionDialog.js on lines 74..80
modules/ve-mw/ui/inspectors/ve.ui.MWExtensionInspector.js on lines 53..59
modules/ve-mw/ui/inspectors/ve.ui.MWExtensionInspector.js on lines 78..84

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

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

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

ve.ui.MWExtensionDialog.prototype.getTeardownProcess = function ( data ) {
    data = data || {};
    // Parent process
    var process = ve.ui.MWExtensionDialog.super.prototype.getTeardownProcess.call( this, data );
    // Mixin process
Severity: Major
Found in modules/ve-mw/ui/dialogs/ve.ui.MWExtensionDialog.js and 4 other locations - About 4 hrs to fix
modules/ve-mw/ui/dialogs/ve.ui.MWExtensionDialog.js on lines 52..58
modules/ve-mw/ui/dialogs/ve.ui.MWExtensionDialog.js on lines 63..69
modules/ve-mw/ui/inspectors/ve.ui.MWExtensionInspector.js on lines 53..59
modules/ve-mw/ui/inspectors/ve.ui.MWExtensionInspector.js on lines 78..84

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

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.MWGalleryImageNode.static.matchFunction = function ( element ) {
    var parentTypeof = ( element.parentNode && element.parentNode.getAttribute( 'typeof' ) ) || '';
    return element.getAttribute( 'class' ) === 'gallerybox' &&
        parentTypeof.trim().split( /\s+/ ).indexOf( 'mw:Extension/gallery' ) !== -1;
};
Severity: Major
Found in modules/ve-mw/dm/nodes/ve.dm.MWGalleryImageNode.js and 1 other location - About 3 hrs to fix
modules/ve-mw/dm/nodes/ve.dm.MWGalleryCaptionNode.js on lines 29..33

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

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

    {
        name: 'style',
        classes: [ 've-test-toolbar-style' ],
        type: 'list',
        icon: 'textStyle',
Severity: Major
Found in modules/ve-mw-collab/ve.init.mw.MobileCollabTarget.js and 1 other location - About 3 hrs to fix
modules/ve-mw/init/targets/ve.init.mw.MobileArticleTarget.js on lines 62..74

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

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

    {
        name: 'style',
        classes: [ 've-test-toolbar-style' ],
        type: 'list',
        icon: 'textStyle',
Severity: Major
Found in modules/ve-mw/init/targets/ve.init.mw.MobileArticleTarget.js and 1 other location - About 3 hrs to fix
modules/ve-mw-collab/ve.init.mw.MobileCollabTarget.js on lines 48..60

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

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.MWGalleryCaptionNode.static.matchFunction = function ( element ) {
    var parentTypeof = ( element.parentNode && element.parentNode.getAttribute( 'typeof' ) ) || '';
    return element.getAttribute( 'class' ) === 'gallerycaption' &&
        parentTypeof.trim().split( /\s+/ ).indexOf( 'mw:Extension/gallery' ) !== -1;
};
Severity: Major
Found in modules/ve-mw/dm/nodes/ve.dm.MWGalleryCaptionNode.js and 1 other location - About 3 hrs to fix
modules/ve-mw/dm/nodes/ve.dm.MWGalleryImageNode.js on lines 35..39

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

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