wikimedia/mediawiki-core

View on GitHub

Showing 11,545 of 11,545 total issues

Method specialSearch has 50 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    protected function specialSearch( $search, $limit, $offset ) {
        $searchParts = explode( '/', $search, 2 );
        $searchKey = $searchParts[0];
        $subpageSearch = $searchParts[1] ?? null;

Severity: Minor
Found in includes/search/PrefixSearch.php - About 2 hrs to fix

    Method endElement has 50 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        protected function endElement( $parser, $name ) {
            $this->checkpointJustWritten = false;
    
            if ( $this->openElement ) {
                $this->clearOpenElement( "" );
    Severity: Minor
    Found in maintenance/includes/TextPassDumper.php - About 2 hrs to fix

      Method execute has 50 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public function execute() {
              $services = $this->getServiceContainer();
      
              $this->output( "Checking existence of old default messages..." );
              $dbr = $this->getReplicaDB();
      Severity: Minor
      Found in maintenance/deleteDefaultMessages.php - About 2 hrs to fix

        Method benchmarkSingleKeyOps has 50 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            private function benchmarkSingleKeyOps( BagOStuff $mcc, array $valueByKey ) {
                $add = 0;
                $set = 0;
                $incr = 0;
                $get = 0;
        Severity: Minor
        Found in maintenance/mctest.php - About 2 hrs to fix

          Method execute has 50 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              public function execute() {
                  $dbName = $this->getOption( 'wikidb', false );
                  $lbf = $this->getServiceContainer()->getDBLoadBalancerFactory();
          
                  // Pick LB
          Severity: Minor
          Found in maintenance/mysql.php - About 2 hrs to fix

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

                        if ( OO.ui.Element.static.getDir( this.$element ) === 'rtl' ) {
                            movement = {
                                left: 'forwards',
                                right: 'backwards'
                            };
            Severity: Major
            Found in resources/lib/ooui/oojs-ui-widgets.js and 1 other location - About 2 hrs to fix
            resources/lib/ooui/oojs-ui-widgets.js on lines 4168..4178

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

            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 (!options || !options.root) {
                      type = namespace + type;
                      if (!store._mutations[type]) {
                        console.error(("[vuex] unknown local mutation type: " + (args.type) + ", global type: " + type));
                        return
            Severity: Major
            Found in resources/lib/vuex/vuex.global.js and 1 other location - About 2 hrs to fix
            resources/lib/vuex/vuex.global.js on lines 254..260

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

            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 {
                top: rect.top,
                y: rect.top,
                bottom: rect.bottom,
                left: rect.left,
            Severity: Major
            Found in resources/lib/intersection-observer/intersection-observer.js and 1 other location - About 2 hrs to fix
            resources/lib/ooui/oojs-ui-core.js on lines 5686..5695

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

            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

                    if ( OO.ui.Element.static.getDir( this.$element ) === 'rtl' ) {
                        movement = {
                            left: 'forwards',
                            right: 'backwards'
                        };
            Severity: Major
            Found in resources/lib/ooui/oojs-ui-widgets.js and 1 other location - About 2 hrs to fix
            resources/lib/ooui/oojs-ui-widgets.js on lines 4531..4541

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

            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 (!options || !options.root) {
                      type = namespace + type;
                      if (!store._actions[type]) {
                        console.error(("[vuex] unknown local action type: " + (args.type) + ", global type: " + type));
                        return
            Severity: Major
            Found in resources/lib/vuex/vuex.global.js and 1 other location - About 2 hrs to fix
            resources/lib/vuex/vuex.global.js on lines 271..277

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

            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 ( pi.internalvalues ) {
                                        widget.getMenu().on( 'select', function ( item ) {
                                            this.$element.toggleClass(
                                                'mw-apisandbox-internal-value',
                                                pi.internalvalues.indexOf( item.data ) >= 0
            Severity: Major
            Found in resources/src/mediawiki.special.apisandbox/apisandbox.js and 1 other location - About 2 hrs to fix
            resources/src/mediawiki.special.apisandbox/apisandbox.js on lines 496..503

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

            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

                            left: cur.left - this.offset.parent.left - this.margins.left + (this.offsetParent[0] == document.body ? 0 : this.offsetParent[0].scrollLeft),
            Severity: Major
            Found in resources/lib/jquery.ui/jquery.ui.sortable.js and 1 other location - About 2 hrs to fix
            resources/lib/jquery.ui/jquery.ui.sortable.js on lines 358..358

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

            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 {
                        left: rect.left,
                        top: rect.top,
                        right: rect.right,
                        bottom: rect.bottom,
            Severity: Major
            Found in resources/lib/ooui/oojs-ui-core.js and 1 other location - About 2 hrs to fix
            resources/lib/intersection-observer/intersection-observer.js on lines 921..930

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

            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

                            top: cur.top - this.offset.parent.top - this.margins.top + (this.offsetParent[0] == document.body ? 0 : this.offsetParent[0].scrollTop)
            Severity: Major
            Found in resources/lib/jquery.ui/jquery.ui.sortable.js and 1 other location - About 2 hrs to fix
            resources/lib/jquery.ui/jquery.ui.sortable.js on lines 357..357

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

            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 ( pi.deprecatedvalues ) {
                                        widget.getMenu().on( 'select', function ( item ) {
                                            this.$element.toggleClass(
                                                'mw-apisandbox-deprecated-value',
                                                pi.deprecatedvalues.indexOf( item.data ) >= 0
            Severity: Major
            Found in resources/src/mediawiki.special.apisandbox/apisandbox.js and 1 other location - About 2 hrs to fix
            resources/src/mediawiki.special.apisandbox/apisandbox.js on lines 504..511

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

            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 MwRcfiltersUiWatchlistTopSectionWidget has 49 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            const WatchlistTopSectionWidget = function MwRcfiltersUiWatchlistTopSectionWidget(
                controller, changesListModel, savedLinksListWidget, $watchlistDetails, config
            ) {
                config = config || {};
            
            
            Severity: Minor
            Found in resources/src/mediawiki.rcfilters/ui/WatchlistTopSectionWidget.js - About 1 hr to fix

              Function drawCarousel has 49 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  mw.GallerySlideshow.prototype.drawCarousel = function () {
                      let nextButton, prevButton, toggleButton, interfaceElements, carouselStack;
              
                      this.$carousel = $( '<li>' ).addClass( 'gallerycarousel' );
              
              
              Severity: Minor
              Found in resources/src/mediawiki.page.gallery.slideshow.js - About 1 hr to fix

                Function doPropagation has 49 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    function doPropagation() {
                        var didPropagate = true;
                        var module;
                
                        // Keep going until the last iteration performed no actions.
                Severity: Minor
                Found in resources/src/startup/mediawiki.loader.js - About 1 hr to fix

                  Function MwWidgetsMediaSearchWidget has 49 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      mw.widgets.MediaSearchWidget = function MwWidgetsMediaSearchWidget( config ) {
                          // Configuration initialization
                          config = Object.assign( {
                              placeholder: mw.msg( 'mw-widgets-mediasearch-input-placeholder' )
                          }, config );

                    Function initialize has 49 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    FeedbackDialog.prototype.initialize = function () {
                        let feedbackSubjectFieldLayout, feedbackMessageFieldLayout,
                            feedbackFieldsetLayout, termsOfUseLabel;
                    
                        // Parent method
                    Severity: Minor
                    Found in resources/src/mediawiki.feedback/FeedbackDialog.js - About 1 hr to fix
                      Severity
                      Category
                      Status
                      Source
                      Language