wikimedia/mediawiki-extensions-VisualEditor

View on GitHub

Showing 912 of 912 total issues

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

ve.ui.MWTransclusionOutlinePartWidget.prototype.isSelected = function () {
    return this.header.isSelected();
};
modules/ve-mw/dm/models/ve.dm.MWImageModel.js on lines 1046..1048
modules/ve-mw/ui/layouts/ve.ui.MWTwoPaneTransclusionDialogLayout.js on lines 192..194

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

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

ve.ce.MWNumberedExternalLinkNode.static.getDescription = function ( model ) {
    return model.getAttribute( 'href' );
};
Severity: Minor
Found in modules/ve-mw/ce/nodes/ve.ce.MWNumberedExternalLinkNode.js and 2 other locations - About 35 mins to fix
modules/ve-mw/ce/annotations/ve.ce.MWInternalLinkAnnotation.js on lines 41..43
modules/ve-mw/ce/nodes/ve.ce.MWMagicLinkNode.js on lines 57..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 46.

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.MWMagicLinkRfcType.prototype.getHref = function () {
    return mw.msg( 'rfcurl', this.code );
};
Severity: Minor
Found in modules/ve-mw/dm/nodes/ve.dm.MWMagicLinkNode.js and 1 other location - About 35 mins to fix
modules/ve-mw/dm/nodes/ve.dm.MWMagicLinkNode.js on lines 390..392

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

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

ve.ce.MWMagicLinkNode.static.getDescription = function ( model ) {
    return model.getAttribute( 'content' );
};
Severity: Minor
Found in modules/ve-mw/ce/nodes/ve.ce.MWMagicLinkNode.js and 2 other locations - About 35 mins to fix
modules/ve-mw/ce/annotations/ve.ce.MWInternalLinkAnnotation.js on lines 41..43
modules/ve-mw/ce/nodes/ve.ce.MWNumberedExternalLinkNode.js on lines 75..77

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

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.static.excludeCommands = [
    // No formatting
    'paragraph',
    'heading1',
    'heading2',
Severity: Minor
Found in modules/ve-mw/ui/dialogs/ve.ui.MWMediaDialog.js and 1 other location - About 35 mins to fix
modules/ve-mw/ui/inspectors/ve.ui.MWLanguageVariantInspector.js on lines 57..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 46.

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

            } else {
                surfaceModel.change(
                    ve.dm.TransactionBuilder.static.newFromAttributeChanges(
                        doc, nodeRange.start, { href: value }
                    )
Severity: Minor
Found in modules/ve-mw/ui/inspectors/ve.ui.MWLinkNodeInspector.js and 1 other location - About 35 mins to fix
modules/ve-mw/ui/inspectors/ve.ui.MWMagicLinkNodeInspector.js on lines 178..184

Duplicated Code

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

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

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

Tuning

This issue has a mass of 46.

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.MWLanguageVariantInspector.static.excludeCommands = [
    // No formatting
    'paragraph',
    'heading1',
    'heading2',
Severity: Minor
Found in modules/ve-mw/ui/inspectors/ve.ui.MWLanguageVariantInspector.js and 1 other location - About 35 mins to fix
modules/ve-mw/ui/dialogs/ve.ui.MWMediaDialog.js on lines 109..130

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

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.MWLinkAnnotationInspector.prototype.createExternalAnnotationInput = function () {
    return new ve.ui.MWExternalLinkAnnotationWidget();
};
Severity: Minor
Found in modules/ve-mw/ui/inspectors/ve.ui.MWLinkAnnotationInspector.js and 1 other location - About 35 mins to fix
modules/ve-mw/ui/inspectors/ve.ui.MWLinkAnnotationInspector.js on lines 136..138

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

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

            } else if ( done && this.validate( value ) ) {
                surfaceModel.change(
                    ve.dm.TransactionBuilder.static.newFromAttributeChanges(
                        doc, nodeRange.start, { content: value }
                    )
Severity: Minor
Found in modules/ve-mw/ui/inspectors/ve.ui.MWMagicLinkNodeInspector.js and 1 other location - About 35 mins to fix
modules/ve-mw/ui/inspectors/ve.ui.MWLinkNodeInspector.js on lines 140..146

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

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.MWLinkAnnotationInspector.prototype.createInternalAnnotationInput = function () {
    return new ve.ui.MWInternalLinkAnnotationWidget();
};
Severity: Minor
Found in modules/ve-mw/ui/inspectors/ve.ui.MWLinkAnnotationInspector.js and 1 other location - About 35 mins to fix
modules/ve-mw/ui/inspectors/ve.ui.MWLinkAnnotationInspector.js on lines 143..145

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

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

Avoid too many return statements within this function.
Open

        return mw.user.options.set( keyOrValueMap, jsonValue );
Severity: Major
Found in modules/ve-mw/init/ve.init.mw.Platform.js - About 30 mins to fix

    Avoid too many return statements within this function.
    Open

        return this.getApi().get( {
            action: 'query',
            // Can't use a direct lookup by title because we need this to be case-insensitive
            generator: 'prefixsearch',
            gpssearch: query,
    Severity: Major
    Found in modules/ve-mw/ui/widgets/ve.ui.MWTemplateTitleInputWidget.js - About 30 mins to fix

      Avoid too many return statements within this function.
      Open

              return new ve.ui.MWParameterCheckboxInputWidget( valueInputConfig );
      Severity: Major
      Found in modules/ve-mw/ui/pages/ve.ui.MWParameterPage.js - About 30 mins to fix

        Avoid too many return statements within this function.
        Open

                return ve.ui.MWExternalLinkAnnotationWidget.static.createExternalLinkInputWidget( valueInputConfig );
        Severity: Major
        Found in modules/ve-mw/ui/pages/ve.ui.MWParameterPage.js - About 30 mins to fix

          Avoid too many return statements within this function.
          Open

                  return new ve.ui.MWLazyMultilineTextInputWidget( valueInputConfig );
          Severity: Major
          Found in modules/ve-mw/ui/pages/ve.ui.MWParameterPage.js - About 30 mins to fix

            Avoid too many return statements within this function.
            Open

                return new ve.ui.MWLazyMultilineTextInputWidget( ve.extendObject( {
                    rows: 1,
                    autosize: true,
                    allowLinebreaks: false
                }, valueInputConfig ) );
            Severity: Major
            Found in modules/ve-mw/ui/pages/ve.ui.MWParameterPage.js - About 30 mins to fix

              Avoid too many return statements within this function.
              Open

                              return true;
              Severity: Major
              Found in modules/ve-mw/ui/dialogs/ve.ui.MWGalleryDialog.js - About 30 mins to fix

                Avoid too many return statements within this function.
                Open

                    return false;
                Severity: Major
                Found in modules/ve-mw/ui/dialogs/ve.ui.MWGalleryDialog.js - About 30 mins to fix

                  Avoid too many return statements within this function.
                  Open

                          return new OO.ui.ComboBoxInputWidget( valueInputConfig );
                  Severity: Major
                  Found in modules/ve-mw/ui/pages/ve.ui.MWParameterPage.js - About 30 mins to fix

                    Avoid too many return statements within this function.
                    Open

                        return false;
                      Severity
                      Category
                      Status
                      Source
                      Language