wikimedia/mediawiki-core

View on GitHub

Showing 11,545 of 11,545 total issues

Method doUpdates has 108 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function doUpdates() {
        $this->assertTransition( 'done' );

        // TODO: move logic into a PageEventEmitter service

Severity: Major
Found in includes/Storage/DerivedPageDataUpdater.php - About 4 hrs to fix

    Method getCurlHandle has 108 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        protected function getCurlHandle( array &$req, array $opts ) {
            $ch = curl_init();
    
            curl_setopt( $ch, CURLOPT_PROXY, $req['proxy'] ?? $this->proxy );
            curl_setopt( $ch, CURLOPT_CONNECTTIMEOUT_MS, intval( $opts['connTimeout'] * 1e3 ) );
    Severity: Major
    Found in includes/libs/http/MultiHttpClient.php - About 4 hrs to fix

      Method getFinalParamDescription has 108 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public function getFinalParamDescription() {
              $prefix = $this->getModulePrefix();
              $name = $this->getModuleName();
              $path = $this->getModulePath();
      
      
      Severity: Major
      Found in includes/api/ApiBase.php - About 4 hrs to fix

        Method run has 108 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            private function run( $resultPageSet = null ) {
                $pages = $this->getPageSet()->getGoodPages();
                if ( $pages === [] ) {
                    return; // nothing to do
                }
        Severity: Major
        Found in includes/api/ApiQueryCategories.php - About 4 hrs to fix

          Method showForm has 108 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              protected function showForm() {
                  $userAllowed = true;
          
                  // Messages: revdelete-selected-text, revdelete-selected-file, logdelete-selected
                  $out = $this->getOutput();
          Severity: Major
          Found in includes/specials/SpecialRevisionDelete.php - About 4 hrs to fix

            Method concatenateChunks has 108 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                public function concatenateChunks() {
                    $oldFileKey = $this->mFileKey;
                    $chunkIndex = $this->getChunkIndex();
                    $this->logger->debug(
                        __METHOD__ . ' concatenate {totalChunks} chunks: {offset} inx: {curIndex}',
            Severity: Major
            Found in includes/upload/UploadFromChunks.php - About 4 hrs to fix

              File mw.widgets.DateInputWidget.js has 346 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              /*!
               * MediaWiki Widgets – DateInputWidget class.
               *
               * @copyright 2011-2015 MediaWiki Widgets Team and others; see AUTHORS.txt
               * @license The MIT License (MIT); see LICENSE.txt
              Severity: Minor
              Found in resources/src/mediawiki.widgets/mw.widgets.DateInputWidget.js - About 4 hrs to fix

                File PostgresInstaller.php has 346 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                <?php
                /**
                 * PostgreSQL-specific installer.
                 *
                 * This program is free software; you can redistribute it and/or modify
                Severity: Minor
                Found in includes/installer/PostgresInstaller.php - About 4 hrs to fix

                  File ApiQueryBacklinksprop.php has 346 lines of code (exceeds 250 allowed). Consider refactoring.
                  Open

                  <?php
                  /**
                   * API module to handle links table back-queries
                   *
                   * Copyright © 2014 Wikimedia Foundation and contributors
                  Severity: Minor
                  Found in includes/api/ApiQueryBacklinksprop.php - About 4 hrs to fix

                    File MWExceptionHandler.php has 346 lines of code (exceeds 250 allowed). Consider refactoring.
                    Open

                    <?php
                    /**
                     * This program is free software; you can redistribute it and/or modify
                     * it under the terms of the GNU General Public License as published by
                     * the Free Software Foundation; either version 2 of the License, or
                    Severity: Minor
                    Found in includes/exception/MWExceptionHandler.php - About 4 hrs to fix

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

                              if ( this._hasScroll() ) {
                                  base = this.active.offset().top;
                                  height = this.element.height();
                                  this.active.prevAll( ".ui-menu-item" ).each(function() {
                                      item = $( this );
                      Severity: Major
                      Found in resources/lib/jquery.ui/jquery.ui.menu.js and 1 other location - About 4 hrs to fix
                      resources/lib/jquery.ui/jquery.ui.menu.js on lines 554..566

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

                      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 ( this._hasScroll() ) {
                                  base = this.active.offset().top;
                                  height = this.element.height();
                                  this.active.nextAll( ".ui-menu-item" ).each(function() {
                                      item = $( this );
                      Severity: Major
                      Found in resources/lib/jquery.ui/jquery.ui.menu.js and 1 other location - About 4 hrs to fix
                      resources/lib/jquery.ui/jquery.ui.menu.js on lines 578..589

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

                      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 ( that.orientation === "horizontal" ) {
                                              if ( i === 0 ) {
                                                  that.range.stop( 1, 1 )[ animate ? "animate" : "css" ]( { left: valPercent + "%" }, o.animate );
                                              }
                                              if ( i === 1 ) {
                      Severity: Major
                      Found in resources/lib/jquery.ui/jquery.ui.slider.js and 1 other location - About 4 hrs to fix
                      resources/lib/jquery.ui/jquery.ui.slider.js on lines 606..613

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

                      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 ( i === 0 ) {
                                                  that.range.stop( 1, 1 )[ animate ? "animate" : "css" ]( { bottom: ( valPercent ) + "%" }, o.animate );
                                              }
                                              if ( i === 1 ) {
                      Severity: Major
                      Found in resources/lib/jquery.ui/jquery.ui.slider.js and 1 other location - About 4 hrs to fix
                      resources/lib/jquery.ui/jquery.ui.slider.js on lines 599..606

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

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

                          mw.widgets.datetime.DateTimeInputWidget = function MwWidgetsDatetimeDateTimeInputWidget( config ) {
                              // Configuration initialization
                              config = Object.assign( {
                                  type: 'datetime',
                                  clearable: true,
                      Severity: Major
                      Found in resources/src/mediawiki.widgets.datetime/DateTimeInputWidget.js - About 4 hrs to fix

                        Function deflate_stored has 107 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                          const deflate_stored = (s, flush) => {
                        
                            /* Smallest worthy block size when not flushing or finishing. By default
                             * this is 32K. This can be as small as 507 bytes for memLevel == 1. For
                             * large input and output buffers, the stored block size will be larger.
                        Severity: Major
                        Found in resources/lib/pako/pako_deflate.js - About 4 hrs to fix

                          File GlobalIdGenerator.php has 345 lines of code (exceeds 250 allowed). Consider refactoring.
                          Open

                          <?php
                          /**
                           * This program is free software; you can redistribute it and/or modify
                           * it under the terms of the GNU General Public License as published by
                           * the Free Software Foundation; either version 2 of the License, or
                          Severity: Minor
                          Found in includes/libs/uuid/GlobalIdGenerator.php - About 4 hrs to fix

                            Method primaryPosWait has 107 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                public function primaryPosWait( IDatabase $conn, DBPrimaryPos $pos, $timeout ) {
                                    if ( !( $pos instanceof MySQLPrimaryPos ) ) {
                                        throw new InvalidArgumentException( "Position not an instance of MySQLPrimaryPos" );
                                    }
                            
                            
                            Severity: Major
                            Found in includes/libs/rdbms/database/replication/MysqlReplicationReporter.php - About 4 hrs to fix

                              Method handleRollbackRequest has 107 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                  public function handleRollbackRequest() {
                                      $this->enableTransactionalTimelimit();
                                      $this->getOutput()->addModuleStyles( 'mediawiki.interface.helpers.styles' );
                              
                                      $request = $this->getRequest();
                              Severity: Major
                              Found in includes/actions/RollbackAction.php - About 4 hrs to fix

                                Method extractRevisionInfo has 107 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                    protected function extractRevisionInfo( RevisionRecord $revision, $row ) {
                                        $vals = [];
                                        $anyHidden = false;
                                
                                        if ( $this->fld_ids ) {
                                Severity: Major
                                Found in includes/api/ApiQueryRevisionsBase.php - About 4 hrs to fix
                                  Severity
                                  Category
                                  Status
                                  Source
                                  Language