wikimedia/mediawiki-extensions-VisualEditor

View on GitHub

Showing 912 of 912 total issues

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

ve.ui.MWFloatingHelpDialog.static.actions = [
    {
        label: OO.ui.deferMsg( 'visualeditor-dialog-action-cancel' ),
        flags: [ 'safe', 'close' ]
    }
Severity: Minor
Found in modules/ve-mw/ui/dialogs/ve.ui.MWFloatingHelpDialog.js and 1 other location - About 45 mins to fix
modules/ve-mw-collab/ve.ui.MWExportWikitextDialog.js on lines 35..40

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

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

ve.ui.commandRegistry.register(
    new ve.ui.Command(
        'gallery', 'window', 'open',
        { args: [ 'gallery' ], supportedSelections: [ 'linear' ] }
    )
Severity: Major
Found in modules/ve-mw/ui/tools/ve.ui.MWGalleryDialogTool.js and 6 other locations - About 40 mins to fix
modules/ve-mw/ui/contextitems/ve.ui.MWAlienExtensionContextItem.js on lines 51..56
modules/ve-mw/ui/contextitems/ve.ui.MWPreContextItem.js on lines 46..51
modules/ve-mw/ui/inspectors/ve.ui.MWWikitextLinkAnnotationInspector.js on lines 253..258
modules/ve-mw/ui/tools/ve.ui.MWFormatTool.js on lines 143..148
modules/ve-mw/ui/tools/ve.ui.MWMediaDialogTool.js on lines 32..37
modules/ve-mw/ui/tools/ve.ui.MWTransclusionDialogTool.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 49.

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.MWVeOnlyDialogTool = function VeUiMWVeOnlyDialogTool() {
    ve.ui.MWVeOnlyDialogTool.super.apply( this, arguments );
};
Severity: Major
Found in modules/ve-mw/ui/tools/ve.ui.MWMetaDialogTool.js and 4 other locations - About 40 mins to fix
modules/ve-mw/ui/tools/ve.ui.MWFormatTool.js on lines 17..19
modules/ve-mw/ui/tools/ve.ui.MWGalleryDialogTool.js on lines 17..19
modules/ve-mw/ui/tools/ve.ui.MWMediaDialogTool.js on lines 17..19
modules/ve-mw/ui/tools/ve.ui.MWMobileLinkInspectorTool.js on lines 18..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 49.

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

ve.ui.commandRegistry.register(
    new ve.ui.Command(
        'alienExtension', 'window', 'open',
        { args: [ 'alienExtension' ], supportedSelections: [ 'linear' ] }
    )
modules/ve-mw/ui/contextitems/ve.ui.MWPreContextItem.js on lines 46..51
modules/ve-mw/ui/inspectors/ve.ui.MWWikitextLinkAnnotationInspector.js on lines 253..258
modules/ve-mw/ui/tools/ve.ui.MWFormatTool.js on lines 143..148
modules/ve-mw/ui/tools/ve.ui.MWGalleryDialogTool.js on lines 30..35
modules/ve-mw/ui/tools/ve.ui.MWMediaDialogTool.js on lines 32..37
modules/ve-mw/ui/tools/ve.ui.MWTransclusionDialogTool.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 49.

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.MWMediaDialogTool = function VeUiMWMediaDialogTool() {
    ve.ui.MWMediaDialogTool.super.apply( this, arguments );
};
Severity: Major
Found in modules/ve-mw/ui/tools/ve.ui.MWMediaDialogTool.js and 4 other locations - About 40 mins to fix
modules/ve-mw/ui/tools/ve.ui.MWFormatTool.js on lines 17..19
modules/ve-mw/ui/tools/ve.ui.MWGalleryDialogTool.js on lines 17..19
modules/ve-mw/ui/tools/ve.ui.MWMetaDialogTool.js on lines 16..18
modules/ve-mw/ui/tools/ve.ui.MWMobileLinkInspectorTool.js on lines 18..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 49.

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.MWHeading1FormatTool = function VeUiMWHeading1FormatTool() {
    ve.ui.MWHeading1FormatTool.super.apply( this, arguments );
};
Severity: Major
Found in modules/ve-mw/ui/tools/ve.ui.MWFormatTool.js and 4 other locations - About 40 mins to fix
modules/ve-mw/ui/tools/ve.ui.MWGalleryDialogTool.js on lines 17..19
modules/ve-mw/ui/tools/ve.ui.MWMediaDialogTool.js on lines 17..19
modules/ve-mw/ui/tools/ve.ui.MWMetaDialogTool.js on lines 16..18
modules/ve-mw/ui/tools/ve.ui.MWMobileLinkInspectorTool.js on lines 18..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 49.

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

ve.ui.commandRegistry.register(
    new ve.ui.Command(
        'mwPre', 'window', 'open',
        { args: [ 'mwPre' ], supportedSelections: [ 'linear' ] }
    )
Severity: Major
Found in modules/ve-mw/ui/contextitems/ve.ui.MWPreContextItem.js and 6 other locations - About 40 mins to fix
modules/ve-mw/ui/contextitems/ve.ui.MWAlienExtensionContextItem.js on lines 51..56
modules/ve-mw/ui/inspectors/ve.ui.MWWikitextLinkAnnotationInspector.js on lines 253..258
modules/ve-mw/ui/tools/ve.ui.MWFormatTool.js on lines 143..148
modules/ve-mw/ui/tools/ve.ui.MWGalleryDialogTool.js on lines 30..35
modules/ve-mw/ui/tools/ve.ui.MWMediaDialogTool.js on lines 32..37
modules/ve-mw/ui/tools/ve.ui.MWTransclusionDialogTool.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 49.

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

ve.ui.wikitextCommandRegistry.register(
    new ve.ui.Command(
        'link', 'window', 'open',
        { args: [ 'wikitextLink' ], supportedSelections: [ 'linear' ] }
    )
modules/ve-mw/ui/contextitems/ve.ui.MWAlienExtensionContextItem.js on lines 51..56
modules/ve-mw/ui/contextitems/ve.ui.MWPreContextItem.js on lines 46..51
modules/ve-mw/ui/tools/ve.ui.MWFormatTool.js on lines 143..148
modules/ve-mw/ui/tools/ve.ui.MWGalleryDialogTool.js on lines 30..35
modules/ve-mw/ui/tools/ve.ui.MWMediaDialogTool.js on lines 32..37
modules/ve-mw/ui/tools/ve.ui.MWTransclusionDialogTool.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 49.

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

ve.ui.commandRegistry.register(
    new ve.ui.Command(
        'preformatted', 'format', 'convert',
        { args: [ 'mwPreformatted' ], supportedSelections: [ 'linear' ] }
    )
Severity: Major
Found in modules/ve-mw/ui/tools/ve.ui.MWFormatTool.js and 6 other locations - About 40 mins to fix
modules/ve-mw/ui/contextitems/ve.ui.MWAlienExtensionContextItem.js on lines 51..56
modules/ve-mw/ui/contextitems/ve.ui.MWPreContextItem.js on lines 46..51
modules/ve-mw/ui/inspectors/ve.ui.MWWikitextLinkAnnotationInspector.js on lines 253..258
modules/ve-mw/ui/tools/ve.ui.MWGalleryDialogTool.js on lines 30..35
modules/ve-mw/ui/tools/ve.ui.MWMediaDialogTool.js on lines 32..37
modules/ve-mw/ui/tools/ve.ui.MWTransclusionDialogTool.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 49.

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

ve.ui.commandRegistry.register(
    new ve.ui.Command(
        'transclusion', 'window', 'open',
        { args: [ 'transclusion' ], supportedSelections: [ 'linear' ] }
    )
Severity: Major
Found in modules/ve-mw/ui/tools/ve.ui.MWTransclusionDialogTool.js and 6 other locations - About 40 mins to fix
modules/ve-mw/ui/contextitems/ve.ui.MWAlienExtensionContextItem.js on lines 51..56
modules/ve-mw/ui/contextitems/ve.ui.MWPreContextItem.js on lines 46..51
modules/ve-mw/ui/inspectors/ve.ui.MWWikitextLinkAnnotationInspector.js on lines 253..258
modules/ve-mw/ui/tools/ve.ui.MWFormatTool.js on lines 143..148
modules/ve-mw/ui/tools/ve.ui.MWGalleryDialogTool.js on lines 30..35
modules/ve-mw/ui/tools/ve.ui.MWMediaDialogTool.js on lines 32..37

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

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

ve.ui.commandRegistry.register(
    new ve.ui.Command(
        'media', 'window', 'open',
        { args: [ 'media' ], supportedSelections: [ 'linear' ] }
    )
Severity: Major
Found in modules/ve-mw/ui/tools/ve.ui.MWMediaDialogTool.js and 6 other locations - About 40 mins to fix
modules/ve-mw/ui/contextitems/ve.ui.MWAlienExtensionContextItem.js on lines 51..56
modules/ve-mw/ui/contextitems/ve.ui.MWPreContextItem.js on lines 46..51
modules/ve-mw/ui/inspectors/ve.ui.MWWikitextLinkAnnotationInspector.js on lines 253..258
modules/ve-mw/ui/tools/ve.ui.MWFormatTool.js on lines 143..148
modules/ve-mw/ui/tools/ve.ui.MWGalleryDialogTool.js on lines 30..35
modules/ve-mw/ui/tools/ve.ui.MWTransclusionDialogTool.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 49.

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.MWMobileLinkInspectorTool = function VeUiMwMobileLinkInspectorTool() {
    ve.ui.MWMobileLinkInspectorTool.super.apply( this, arguments );
};
Severity: Major
Found in modules/ve-mw/ui/tools/ve.ui.MWMobileLinkInspectorTool.js and 4 other locations - About 40 mins to fix
modules/ve-mw/ui/tools/ve.ui.MWFormatTool.js on lines 17..19
modules/ve-mw/ui/tools/ve.ui.MWGalleryDialogTool.js on lines 17..19
modules/ve-mw/ui/tools/ve.ui.MWMediaDialogTool.js on lines 17..19
modules/ve-mw/ui/tools/ve.ui.MWMetaDialogTool.js on lines 16..18

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

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.MWAddParameterPage.prototype.onTemplateParametersChanged = function () {
    this.updateParameterNameValidation( this.paramInputField.getValue() );
};
Severity: Minor
Found in modules/ve-mw/ui/pages/ve.ui.MWAddParameterPage.js and 1 other location - About 40 mins to fix
modules/ve-mw/ui/datatransferhandlers/ve.ui.MWWikitextPlainTextStringTransferHandler.js on lines 51..53

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

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.MWGalleryDialogTool = function VeUiMWGalleryDialogTool() {
    ve.ui.MWGalleryDialogTool.super.apply( this, arguments );
};
Severity: Major
Found in modules/ve-mw/ui/tools/ve.ui.MWGalleryDialogTool.js and 4 other locations - About 40 mins to fix
modules/ve-mw/ui/tools/ve.ui.MWFormatTool.js on lines 17..19
modules/ve-mw/ui/tools/ve.ui.MWMediaDialogTool.js on lines 17..19
modules/ve-mw/ui/tools/ve.ui.MWMetaDialogTool.js on lines 16..18
modules/ve-mw/ui/tools/ve.ui.MWMobileLinkInspectorTool.js on lines 18..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 49.

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.MWWikitextPlainTextStringTransferHandler.prototype.process = function () {
    this.resolve( this.item.getAsString() );
};
modules/ve-mw/ui/pages/ve.ui.MWAddParameterPage.js on lines 127..129

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

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.MWTransclusionOutlineParameterWidget.prototype.toggleActivePageIndicator = function ( state ) {
    this.$element.toggleClass( 've-ui-mwTransclusionOutlineParameterWidget-activePage', state );
};
modules/ve-mw/ui/widgets/ve.ui.MWTransclusionOutlineParameterWidget.js on lines 84..86

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

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.MWTransclusionOutlineParameterWidget.prototype.toggleHasValue = function ( hasValue ) {
    this.$element.toggleClass( 've-ui-mwTransclusionOutlineParameterWidget-hasValue', hasValue );
};
modules/ve-mw/ui/widgets/ve.ui.MWTransclusionOutlineParameterWidget.js on lines 77..79

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

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

Consider simplifying this complex logical expression.
Open

    if (
        (
            ( imageType === 'frameless' || imageType === 'none' ) &&
            alignment === 'none'
        ) ||
Severity: Major
Found in modules/ve-mw/dm/models/ve.dm.MWImageModel.js - About 40 mins to fix

    Consider simplifying this complex logical expression.
    Open

        if ( attributeChanges.mw.from.parts.length === 1 && attributeChanges.mw.to.parts.length === 1 ) {
            // Single-template transclusion, before and after. Relatively easy to summarize.
            // TODO: expand this to well-represent transclusions that contain multiple templates.
    
            // The bits of a template we care about are deeply-nested inside an
    Severity: Major
    Found in modules/ve-mw/dm/nodes/ve.dm.MWTransclusionNode.js - About 40 mins to fix

      Consider simplifying this complex logical expression.
      Open

              if ( isVisual && !(
                  lastDiff && lastDiff.oldId === oldId && lastDiff.newId === newId &&
                  lastDiff.oldPageName === oldPageName && lastDiff.newPageName === newPageName
              ) ) {
                  $visualDiff.empty();
      Severity: Major
      Found in modules/ve-mw/preinit/ve.init.mw.DiffPage.init.js - About 40 mins to fix
        Severity
        Category
        Status
        Source
        Language