wikimedia/mediawiki-extensions-VisualEditor

View on GitHub

Showing 912 of 912 total issues

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

ve.ui.MWRequiredParamBlankConfirmDialog = function VeUiMWRequiredParamBlankConfirmDialog( config ) {
    // Parent constructor
    ve.ui.MWRequiredParamBlankConfirmDialog.super.call( this, config );
};
modules/ve-mw/ce/nodes/ve.ce.MWTransclusionBlockNode.js on lines 16..19
modules/ve-mw/ce/nodes/ve.ce.MWTransclusionInlineNode.js on lines 16..19
modules/ve-mw/ui/actions/ve.ui.MWLinkAction.js on lines 17..20
modules/ve-mw/ui/dialogs/ve.ui.MWCommandHelpDialog.js on lines 17..20
modules/ve-mw/ui/dialogs/ve.ui.MWMetaDialog.js on lines 17..20
modules/ve-mw/ui/dialogs/ve.ui.MWTableDialog.js on lines 16..19
modules/ve-mw/ui/inspectors/ve.ui.MWWikitextLinkAnnotationInspector.js on lines 17..20
modules/ve-mw/ui/widgets/ve.ui.MWPreTextInputWidget.js on lines 16..19

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

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

ve.ce.MWTransclusionInlineNode = function VeCeMWTransclusionInlineNode( model ) {
    // Parent constructor
    ve.ce.MWTransclusionInlineNode.super.call( this, model );
};
Severity: Major
Found in modules/ve-mw/ce/nodes/ve.ce.MWTransclusionInlineNode.js and 8 other locations - About 55 mins to fix
modules/ve-mw/ce/nodes/ve.ce.MWTransclusionBlockNode.js on lines 16..19
modules/ve-mw/ui/actions/ve.ui.MWLinkAction.js on lines 17..20
modules/ve-mw/ui/dialogs/ve.ui.MWCommandHelpDialog.js on lines 17..20
modules/ve-mw/ui/dialogs/ve.ui.MWMetaDialog.js on lines 17..20
modules/ve-mw/ui/dialogs/ve.ui.MWRequiredParamBlankConfirmDialog.js on lines 17..20
modules/ve-mw/ui/dialogs/ve.ui.MWTableDialog.js on lines 16..19
modules/ve-mw/ui/inspectors/ve.ui.MWWikitextLinkAnnotationInspector.js on lines 17..20
modules/ve-mw/ui/widgets/ve.ui.MWPreTextInputWidget.js on lines 16..19

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

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

ve.ui.MWMetaDialog = function VeUiMWMetaDialog( config ) {
    // Parent constructor
    ve.ui.MWMetaDialog.super.call( this, config );
};
Severity: Major
Found in modules/ve-mw/ui/dialogs/ve.ui.MWMetaDialog.js and 8 other locations - About 55 mins to fix
modules/ve-mw/ce/nodes/ve.ce.MWTransclusionBlockNode.js on lines 16..19
modules/ve-mw/ce/nodes/ve.ce.MWTransclusionInlineNode.js on lines 16..19
modules/ve-mw/ui/actions/ve.ui.MWLinkAction.js on lines 17..20
modules/ve-mw/ui/dialogs/ve.ui.MWCommandHelpDialog.js on lines 17..20
modules/ve-mw/ui/dialogs/ve.ui.MWRequiredParamBlankConfirmDialog.js on lines 17..20
modules/ve-mw/ui/dialogs/ve.ui.MWTableDialog.js on lines 16..19
modules/ve-mw/ui/inspectors/ve.ui.MWWikitextLinkAnnotationInspector.js on lines 17..20
modules/ve-mw/ui/widgets/ve.ui.MWPreTextInputWidget.js on lines 16..19

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

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

ve.ui.MWPreTextInputWidget = function VeUiMWPreTextInputWidget( config ) {
    // Parent constructor
    ve.ui.MWPreTextInputWidget.super.call( this, config );
};
Severity: Major
Found in modules/ve-mw/ui/widgets/ve.ui.MWPreTextInputWidget.js and 8 other locations - About 55 mins to fix
modules/ve-mw/ce/nodes/ve.ce.MWTransclusionBlockNode.js on lines 16..19
modules/ve-mw/ce/nodes/ve.ce.MWTransclusionInlineNode.js on lines 16..19
modules/ve-mw/ui/actions/ve.ui.MWLinkAction.js on lines 17..20
modules/ve-mw/ui/dialogs/ve.ui.MWCommandHelpDialog.js on lines 17..20
modules/ve-mw/ui/dialogs/ve.ui.MWMetaDialog.js on lines 17..20
modules/ve-mw/ui/dialogs/ve.ui.MWRequiredParamBlankConfirmDialog.js on lines 17..20
modules/ve-mw/ui/dialogs/ve.ui.MWTableDialog.js on lines 16..19
modules/ve-mw/ui/inspectors/ve.ui.MWWikitextLinkAnnotationInspector.js on lines 17..20

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

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

ve.ce.MWTransclusionBlockNode = function VeCeMWTransclusionBlockNode( model ) {
    // Parent constructor
    ve.ce.MWTransclusionBlockNode.super.call( this, model );
};
Severity: Major
Found in modules/ve-mw/ce/nodes/ve.ce.MWTransclusionBlockNode.js and 8 other locations - About 55 mins to fix
modules/ve-mw/ce/nodes/ve.ce.MWTransclusionInlineNode.js on lines 16..19
modules/ve-mw/ui/actions/ve.ui.MWLinkAction.js on lines 17..20
modules/ve-mw/ui/dialogs/ve.ui.MWCommandHelpDialog.js on lines 17..20
modules/ve-mw/ui/dialogs/ve.ui.MWMetaDialog.js on lines 17..20
modules/ve-mw/ui/dialogs/ve.ui.MWRequiredParamBlankConfirmDialog.js on lines 17..20
modules/ve-mw/ui/dialogs/ve.ui.MWTableDialog.js on lines 16..19
modules/ve-mw/ui/inspectors/ve.ui.MWWikitextLinkAnnotationInspector.js on lines 17..20
modules/ve-mw/ui/widgets/ve.ui.MWPreTextInputWidget.js on lines 16..19

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

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

ve.ui.MWTableDialog = function VeUiMWTableDialog( config ) {
    // Parent constructor
    ve.ui.MWTableDialog.super.call( this, config );
};
Severity: Major
Found in modules/ve-mw/ui/dialogs/ve.ui.MWTableDialog.js and 8 other locations - About 55 mins to fix
modules/ve-mw/ce/nodes/ve.ce.MWTransclusionBlockNode.js on lines 16..19
modules/ve-mw/ce/nodes/ve.ce.MWTransclusionInlineNode.js on lines 16..19
modules/ve-mw/ui/actions/ve.ui.MWLinkAction.js on lines 17..20
modules/ve-mw/ui/dialogs/ve.ui.MWCommandHelpDialog.js on lines 17..20
modules/ve-mw/ui/dialogs/ve.ui.MWMetaDialog.js on lines 17..20
modules/ve-mw/ui/dialogs/ve.ui.MWRequiredParamBlankConfirmDialog.js on lines 17..20
modules/ve-mw/ui/inspectors/ve.ui.MWWikitextLinkAnnotationInspector.js on lines 17..20
modules/ve-mw/ui/widgets/ve.ui.MWPreTextInputWidget.js on lines 16..19

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

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

ve.ui.MWWikitextLinkAnnotationInspector = function VeUiMWWikitextLinkAnnotationInspector( config ) {
    // Parent constructor
    ve.ui.MWWikitextLinkAnnotationInspector.super.call( this, config );
};
modules/ve-mw/ce/nodes/ve.ce.MWTransclusionBlockNode.js on lines 16..19
modules/ve-mw/ce/nodes/ve.ce.MWTransclusionInlineNode.js on lines 16..19
modules/ve-mw/ui/actions/ve.ui.MWLinkAction.js on lines 17..20
modules/ve-mw/ui/dialogs/ve.ui.MWCommandHelpDialog.js on lines 17..20
modules/ve-mw/ui/dialogs/ve.ui.MWMetaDialog.js on lines 17..20
modules/ve-mw/ui/dialogs/ve.ui.MWRequiredParamBlankConfirmDialog.js on lines 17..20
modules/ve-mw/ui/dialogs/ve.ui.MWTableDialog.js on lines 16..19
modules/ve-mw/ui/widgets/ve.ui.MWPreTextInputWidget.js on lines 16..19

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

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.MWLanguageVariantNode.static.getHashObject = function ( dataElement ) {
    return {
        type: dataElement.type,
        variantInfo: dataElement.attributes.variantInfo
    };
Severity: Minor
Found in modules/ve-mw/dm/nodes/ve.dm.MWLanguageVariantNode.js and 1 other location - About 55 mins to fix
modules/ve-mw/dm/nodes/ve.dm.MWTransclusionNode.js on lines 69..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 54.

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

    toolbarLists: function () {
        seleniumUtils.runMenuTask( arguments[ arguments.length - 1 ], ve.init.target.toolbar.tools.bullet );
    },
Severity: Minor
Found in build/screenshots-client/userGuide.js and 1 other location - About 55 mins to fix
build/screenshots-client/userGuide.js on lines 70..72

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

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

    toolbarHeadings: function () {
        seleniumUtils.runMenuTask( arguments[ arguments.length - 1 ], ve.init.target.toolbar.tools.paragraph );
    },
Severity: Minor
Found in build/screenshots-client/userGuide.js and 1 other location - About 55 mins to fix
build/screenshots-client/userGuide.js on lines 76..78

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

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.MWMediaDialog.prototype.onUploadValid = function ( isValid ) {
    this.actions.setAbilities( { upload: isValid } );
};
Severity: Minor
Found in modules/ve-mw/ui/dialogs/ve.ui.MWMediaDialog.js and 1 other location - About 55 mins to fix
modules/ve-mw/ui/dialogs/ve.ui.MWMediaDialog.js on lines 484..486

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

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.MWTransclusionNode.static.getHashObject = function ( dataElement ) {
    return {
        type: dataElement.type,
        mw: dataElement.attributes.mw
    };
Severity: Minor
Found in modules/ve-mw/dm/nodes/ve.dm.MWTransclusionNode.js and 1 other location - About 55 mins to fix
modules/ve-mw/dm/nodes/ve.dm.MWLanguageVariantNode.js on lines 41..46

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

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

    doc.commit(
        ve.dm.TransactionBuilder.static.newFromAttributeChanges(
            doc, this.previewNode.getOuterRange().start, { mw: mwData }
        )
    );
Severity: Minor
Found in modules/ve-mw/ui/dialogs/ve.ui.MWExtensionPreviewDialog.js and 1 other location - About 55 mins to fix
modules/ve-mw/ui/dialogs/ve.ui.MWGalleryDialog.js on lines 1063..1069

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

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.MWMediaDialog.prototype.onInfoValid = function ( isValid ) {
    this.actions.setAbilities( { save: isValid } );
};
Severity: Minor
Found in modules/ve-mw/ui/dialogs/ve.ui.MWMediaDialog.js and 1 other location - About 55 mins to fix
modules/ve-mw/ui/dialogs/ve.ui.MWMediaDialog.js on lines 475..477

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

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.MWSaveDialogAction.prototype.review = function () {
    ve.init.target.showSaveDialog( 'review' );
    return true;
};
Severity: Minor
Found in modules/ve-mw/ui/actions/ve.ui.MWSaveDialogAction.js and 1 other location - About 55 mins to fix
modules/ve-mw/ui/actions/ve.ui.MWSaveDialogAction.js on lines 62..65

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

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

    this.surface.getView().$element.off( {
        touchstart: this.onTouchStartHandler,
        touchmove: this.onTouchMoveHandler,
        touchend: this.onTouchEndHandler
    } );
Severity: Minor
Found in modules/ve-mw/init/ve.init.mw.ViewportZoomHandler.js and 1 other location - About 55 mins to fix
modules/ve-mw/init/ve.init.mw.ViewportZoomHandler.js on lines 77..81

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 54.

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.MWSaveDialogAction.prototype.preview = function () {
    ve.init.target.showSaveDialog( 'preview' );
    return true;
};
Severity: Minor
Found in modules/ve-mw/ui/actions/ve.ui.MWSaveDialogAction.js and 1 other location - About 55 mins to fix
modules/ve-mw/ui/actions/ve.ui.MWSaveDialogAction.js on lines 52..55

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

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

        surfaceModel.change(
            ve.dm.TransactionBuilder.static.newFromAttributeChanges(
                surfaceModelDocument,
                this.selectedNode.getOuterRange().start,
                { mw: mwData }
Severity: Minor
Found in modules/ve-mw/ui/dialogs/ve.ui.MWGalleryDialog.js and 1 other location - About 55 mins to fix
modules/ve-mw/ui/dialogs/ve.ui.MWExtensionPreviewDialog.js on lines 95..99

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

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

    this.surface.getView().$element.on( {
        touchstart: this.onTouchStartHandler,
        touchmove: this.onTouchMoveHandler,
        touchend: this.onTouchEndHandler
    } );
Severity: Minor
Found in modules/ve-mw/init/ve.init.mw.ViewportZoomHandler.js and 1 other location - About 55 mins to fix
modules/ve-mw/init/ve.init.mw.ViewportZoomHandler.js on lines 91..95

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

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

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

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

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

Refactorings

Further Reading

Function getSaveButtonLabel has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

ve.init.mw.ArticleTarget.prototype.getSaveButtonLabel = function ( startProcess, forceShort ) {
    const suffix = startProcess ? '-start' : '';

    if ( forceShort || OO.ui.isMobile() ) {
        // The following messages can be used here:
Severity: Minor
Found in modules/ve-mw/init/targets/ve.init.mw.ArticleTarget.js - About 55 mins 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

Severity
Category
Status
Source
Language