wikimedia/mediawiki-core

View on GitHub

Showing 11,545 of 11,545 total issues

File PNGMetadataExtractor.php has 292 lines of code (exceeds 250 allowed). Consider refactoring.
Open

<?php
/**
 * PNG frame counter and metadata extractor.
 *
 * Slightly derived from GIFMetadataExtractor.php
Severity: Minor
Found in includes/media/PNGMetadataExtractor.php - About 3 hrs to fix

    File findBadBlobs.php has 292 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 maintenance/findBadBlobs.php - About 3 hrs to fix

      Function parse has 75 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          parse = function ( title, defaultNamespace ) {
              let namespace = defaultNamespace === undefined ? NS_MAIN : defaultNamespace;
      
              title = title
                  // Strip Unicode bidi override characters
      Severity: Major
      Found in resources/src/mediawiki.Title/Title.js - About 3 hrs to fix

        Function getFilterRepresentation has 75 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        FilterGroup.prototype.getFilterRepresentation = function ( paramRepresentation ) {
            let areAnySelected,
                oneWasSelected = false;
            const defaultParams = this.getDefaultParams(),
                expandedParams = $.extend( true, {}, paramRepresentation ),
        Severity: Major
        Found in resources/src/mediawiki.rcfilters/dm/FilterGroup.js - About 3 hrs to fix

          Function makeApi has 75 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              function makeApi(sinon) {
                  var collection = {
                      verify: function resolve() {
                          each(this, "verify");
                      },
          Severity: Major
          Found in resources/lib/sinonjs/sinon.js - About 3 hrs to fix

            Consider simplifying this complex logical expression.
            Open

                    if (m._isValid == null) {
                        var flags = getParsingFlags(m),
                            parsedParts = some.call(flags.parsedDateParts, function (i) {
                                return i != null;
                            }),
            Severity: Critical
            Found in resources/lib/moment/moment.js - About 3 hrs to fix

              Function _create has 75 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  _create: function() {
                      var accordionId = this.accordionId = "ui-accordion-" +
                              (this.element.attr( "id" ) || ++uid),
                          options = this.options;
              
              
              Severity: Major
              Found in resources/lib/jquery.ui/jquery.ui.accordion.js - About 3 hrs to fix

                Function Datepicker has 75 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                function Datepicker() {
                    this.debug = false; // Change this to true to start debugging
                    this._curInst = null; // The current instance in use
                    this._keyEvent = false; // If the last event was a key event
                    this._disabledInputs = []; // List of date picker inputs that have been disabled
                Severity: Major
                Found in resources/lib/jquery.ui/jquery.ui.datepicker.js - About 3 hrs to fix

                  Method archiveRevisions has 75 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      private function archiveRevisions( WikiPage $page, int $id ): bool {
                          // Given the lock above, we can be confident in the title and page ID values
                          $namespace = $page->getTitle()->getNamespace();
                          $dbKey = $page->getTitle()->getDBkey();
                  
                  
                  Severity: Major
                  Found in includes/page/DeletePage.php - About 3 hrs to fix

                    ConfigSchemaAggregator has 26 functions (exceeds 20 allowed). Consider refactoring.
                    Open

                    class ConfigSchemaAggregator implements ConfigSchema {
                        use JsonSchemaTrait;
                    
                        /** @var array[] Maps config keys to JSON schema structures */
                        private $schemas = [];
                    Severity: Minor
                    Found in includes/Settings/Config/ConfigSchemaAggregator.php - About 3 hrs to fix

                      Method getDiffBody has 75 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          public function getDiffBody() {
                              $this->mCacheHit = true;
                              // Check if the diff should be hidden from this user
                              if ( !$this->isContentOverridden ) {
                                  if ( !$this->loadRevisionData() ) {
                      Severity: Major
                      Found in includes/diff/DifferenceEngine.php - About 3 hrs to fix

                        Method __construct has 24 arguments (exceeds 4 allowed). Consider refactoring.
                        Open

                                RevisionStore $revisionStore,
                                RevisionRenderer $revisionRenderer,
                                SlotRoleRegistry $slotRoleRegistry,
                                ParserCache $parserCache,
                                JobQueueGroup $jobQueueGroup,
                        Severity: Major
                        Found in includes/Storage/PageUpdaterFactory.php - About 3 hrs to fix

                          Method doCreate has 75 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              private function doCreate( CommentStoreComment $summary ): PageUpdateStatus {
                                  if ( $this->preventChange ) {
                                      throw new LogicException(
                                          "Content was changed even though preventChange() was called."
                                      );
                          Severity: Major
                          Found in includes/Storage/PageUpdater.php - About 3 hrs to fix

                            Method insertRevisionRowOn has 75 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                private function insertRevisionRowOn(
                                    IDatabase $dbw,
                                    RevisionRecord $rev,
                                    $parentId
                                ) {
                            Severity: Major
                            Found in includes/Revision/RevisionStore.php - About 3 hrs to fix

                              TablePager has 26 functions (exceeds 20 allowed). Consider refactoring.
                              Open

                              abstract class TablePager extends IndexPager {
                                  /** @var string */
                                  protected $mSort;
                              
                                  /** @var stdClass */
                              Severity: Minor
                              Found in includes/pager/TablePager.php - About 3 hrs to fix

                                BlockManager has 26 functions (exceeds 20 allowed). Consider refactoring.
                                Open

                                class BlockManager {
                                    /**
                                     * @internal For use by ServiceWiring
                                     */
                                    public const CONSTRUCTOR_OPTIONS = [
                                Severity: Minor
                                Found in includes/block/BlockManager.php - About 3 hrs to fix

                                  TrivialLanguageConverter has 26 functions (exceeds 20 allowed). Consider refactoring.
                                  Open

                                  class TrivialLanguageConverter implements ILanguageConverter {
                                  
                                      /**
                                       * @var Language
                                       */
                                  Severity: Minor
                                  Found in includes/language/TrivialLanguageConverter.php - About 3 hrs to fix

                                    LoginSignupSpecialPage has 26 functions (exceeds 20 allowed). Consider refactoring.
                                    Open

                                    abstract class LoginSignupSpecialPage extends AuthManagerSpecialPage {
                                    
                                        /**
                                         * The title of the page to return to after authentication finishes, or the empty string
                                         * when there is no return target.
                                    Severity: Minor
                                    Found in includes/specialpage/LoginSignupSpecialPage.php - About 3 hrs to fix

                                      ApiUpload has 26 functions (exceeds 20 allowed). Consider refactoring.
                                      Open

                                      class ApiUpload extends ApiBase {
                                      
                                          use ApiWatchlistTrait;
                                      
                                          /** @var UploadBase|UploadFromChunks */
                                      Severity: Minor
                                      Found in includes/api/ApiUpload.php - About 3 hrs to fix

                                        Method getAllowedParams has 75 lines of code (exceeds 25 allowed). Consider refactoring.
                                        Open

                                            public function getAllowedParams( $flags = 0 ) {
                                                $config = $this->getConfig();
                                                if ( $flags & ApiBase::GET_VALUES_FOR_HELP ) {
                                                    $logActions = $this->getAllowedLogActions();
                                                    sort( $logActions );
                                        Severity: Major
                                        Found in includes/api/ApiQueryLogEvents.php - About 3 hrs to fix
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language