wikimedia/mediawiki-extensions-VisualEditor

View on GitHub

Showing 912 of 912 total issues

Avoid too many return statements within this function.
Open

    return returnExternalData();
Severity: Major
Found in modules/ve-mw/preinit/ve.utils.parsoid.js - About 30 mins to fix

    Avoid too many return statements within this method.
    Open

                    return self::getLastEditor( $user, $req );
    Severity: Major
    Found in includes/Hooks.php - About 30 mins to fix

      Avoid too many return statements within this function.
      Open

              return 'oneway';
      Severity: Major
      Found in modules/ve-mw/dm/nodes/ve.dm.MWLanguageVariantNode.js - About 30 mins to fix

        Avoid too many return statements within this function.
        Open

            return true;
        Severity: Major
        Found in editcheck/modules/BaseEditCheck.js - About 30 mins to fix

          Avoid too many return statements within this function.
          Open

                  return false;
          Severity: Major
          Found in editcheck/modules/BaseEditCheck.js - About 30 mins to fix

            Avoid too many return statements within this method.
            Open

                    return true;
            Severity: Major
            Found in includes/Hooks.php - About 30 mins to fix

              Avoid too many return statements within this method.
              Open

                          return;
              Severity: Major
              Found in includes/Hooks.php - About 30 mins to fix

                Avoid too many return statements within this function.
                Open

                            return variantInfo.twoway[ languageIndex ].t;
                Severity: Major
                Found in modules/ve-mw/dm/nodes/ve.dm.MWLanguageVariantNode.js - About 30 mins to fix

                  Avoid too many return statements within this function.
                  Open

                      return '';
                  Severity: Major
                  Found in modules/ve-mw/dm/nodes/ve.dm.MWLanguageVariantNode.js - About 30 mins to fix

                    Avoid too many return statements within this function.
                    Open

                            return null;
                    Severity: Major
                    Found in modules/ve-mw/preinit/ve.init.mw.DesktopArticleTarget.init.js - About 30 mins to fix

                      Avoid too many return statements within this method.
                      Open

                                  return;
                      Severity: Major
                      Found in includes/Hooks.php - About 30 mins to fix

                        Avoid too many return statements within this function.
                        Open

                            return 'unknown'; // should never happen
                        Severity: Major
                        Found in modules/ve-mw/dm/nodes/ve.dm.MWLanguageVariantNode.js - About 30 mins to fix

                          Avoid too many return statements within this function.
                          Open

                                      return variantInfo.oneway[ languageIndex ].t;
                          Severity: Major
                          Found in modules/ve-mw/dm/nodes/ve.dm.MWLanguageVariantNode.js - About 30 mins to fix

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

                                const languageNames = mw.language.getData( mw.config.get( 'wgUserLanguage' ), 'languageNames' ) ||
                                    $.uls.data.getAutonyms();
                            Severity: Minor
                            Found in modules/ve-mw/init/ve.init.mw.Platform.js and 1 other location - About 30 mins to fix
                            modules/ve-mw/init/ve.init.mw.Platform.js on lines 215..216

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

                            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

                                    mw.language.getData( mw.config.get( 'wgUserLanguage' ), 'languageNames' ) ||
                                    $.uls.data.getAutonyms()
                            Severity: Minor
                            Found in modules/ve-mw/init/ve.init.mw.Platform.js and 1 other location - About 30 mins to fix
                            modules/ve-mw/init/ve.init.mw.Platform.js on lines 224..225

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

                            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 ( !ve.isEmptyObject( attributes.mw ) ) {
                                    container.setAttribute( 'data-mw', JSON.stringify( attributes.mw ) );
                                }
                            Severity: Minor
                            Found in modules/ve-mw/dm/nodes/ve.dm.MWInlineImageNode.js and 1 other location - About 30 mins to fix
                            modules/ve-mw/dm/nodes/ve.dm.MWBlockImageNode.js on lines 183..185

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

                            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

                                    return new mw.widgets.UserInputWidget( ve.extendObject( {
                                        api: ve.init.target.getContentApi()
                                    }, valueInputConfig ) );
                            Severity: Minor
                            Found in modules/ve-mw/ui/pages/ve.ui.MWParameterPage.js and 1 other location - About 30 mins to fix
                            modules/ve-mw/ui/pages/ve.ui.MWParameterPage.js on lines 202..204

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

                            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

                                    return new mw.widgets.TitleInputWidget( ve.extendObject( {
                                        api: ve.init.target.getContentApi()
                                    }, valueInputConfig ) );
                            Severity: Minor
                            Found in modules/ve-mw/ui/pages/ve.ui.MWParameterPage.js and 1 other location - About 30 mins to fix
                            modules/ve-mw/ui/pages/ve.ui.MWParameterPage.js on lines 223..225

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

                            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 ( !ve.isEmptyObject( attributes.mw ) ) {
                                    figure.setAttribute( 'data-mw', JSON.stringify( attributes.mw ) );
                                }
                            Severity: Minor
                            Found in modules/ve-mw/dm/nodes/ve.dm.MWBlockImageNode.js and 1 other location - About 30 mins to fix
                            modules/ve-mw/dm/nodes/ve.dm.MWInlineImageNode.js on lines 179..181

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

                            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.advancedSettingsFieldset = new OO.ui.FieldsetLayout( {
                                    label: ve.msg( 'visualeditor-dialog-meta-advancedsettings-label' ),
                                    icon: 'settings'
                                } );
                            Severity: Minor
                            Found in modules/ve-mw/ui/pages/ve.ui.MWAdvancedSettingsPage.js and 1 other location - About 30 mins to fix
                            modules/ve-mw/ui/pages/ve.ui.MWSettingsPage.js on lines 30..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 45.

                            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