wikimedia/mediawiki-core

View on GitHub

Showing 11,545 of 11,545 total issues

Function startOf has 57 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    function startOf(units) {
        var time, startOfDate;
        units = normalizeUnits(units);
        if (units === undefined || units === 'millisecond' || !this.isValid()) {
            return this;
Severity: Major
Found in resources/lib/moment/moment.js - About 2 hrs to fix

    Function OoUiComboBoxInputWidget has 57 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    OO.ui.ComboBoxInputWidget = function OoUiComboBoxInputWidget( config ) {
        // Configuration initialization
        config = Object.assign( {
            autocomplete: false
        }, config );
    Severity: Major
    Found in resources/lib/ooui/oojs-ui-core.js - About 2 hrs to fix

      Function keydown has 57 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

                  keydown: function( event ) {
                      var allowed, curVal, newVal, step,
                          index = $( event.target ).data( "ui-slider-handle-index" );
      
                      switch ( event.keyCode ) {
      Severity: Major
      Found in resources/lib/jquery.ui/jquery.ui.slider.js - About 2 hrs to fix

        Function winnow_results has 57 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            AbstractChosen.prototype.winnow_results = function() {
              var escapedQuery, fix, i, len, option, prefix, query, ref, regex, results, results_group, search_match, startpos, suffix, text;
              this.no_results_clear();
              results = 0;
              query = this.get_search_text();
        Severity: Major
        Found in resources/lib/jquery.chosen/chosen.jquery.js - About 2 hrs to fix

          Method getCascadeProtectionSourcesInternal has 57 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              private function getCascadeProtectionSourcesInternal(
                  PageIdentity $page, bool $shortCircuit = false
              ) {
                  if ( !$page->canExist() ) {
                      return $shortCircuit ? false : [ [], [] ];
          Severity: Major
          Found in includes/Permissions/RestrictionStore.php - About 2 hrs to fix

            Method newPoolWorkArticleView has 57 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                protected function newPoolWorkArticleView(
                    PageRecord $page,
                    ParserOptions $parserOptions,
                    RevisionRecord $revision,
                    int $options
            Severity: Major
            Found in includes/page/ParserOutputAccess.php - About 2 hrs to fix

              Method updateRedirectTarget has 57 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  public function updateRedirectTarget(
                      PageIdentity $page,
                      ?LinkTarget $target,
                      ?bool $lastRevWasRedirect = null
                  ) {
              Severity: Major
              Found in includes/page/RedirectStore.php - About 2 hrs to fix

                Method addOneModuleResponse has 57 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    private function addOneModuleResponse(
                        Context $context, MinifierState $minifier, $name, Module $module, &$headers
                    ) {
                        $only = $context->getOnly();
                        $debug = (bool)$context->getDebug();
                Severity: Major
                Found in includes/ResourceLoader/ResourceLoader.php - About 2 hrs to fix

                  Method doSectionLinks has 57 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      private function doSectionLinks(
                          $comment,
                          $selfLinkTarget = null,
                          $samePage = false,
                          $wikiId = false
                  Severity: Major
                  Found in includes/CommentFormatter/CommentParser.php - About 2 hrs to fix

                    Method updateOpStats has 57 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        protected function updateOpStats( string $op, array $keyInfo ) {
                            $deltasByMetric = [];
                    
                            foreach ( $keyInfo as $indexOrKey => $keyOrSizes ) {
                                if ( is_array( $keyOrSizes ) ) {
                    Severity: Major
                    Found in includes/libs/objectcache/MediumSpecificBagOStuff.php - About 2 hrs to fix

                      Method getMediaType has 57 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          public function getMediaType( string $path = null, string $mime = null ): string {
                              if ( !$mime && !$path ) {
                                  return MEDIATYPE_UNKNOWN;
                              }
                      
                      
                      Severity: Major
                      Found in includes/libs/mime/MimeAnalyzer.php - About 2 hrs to fix

                        Method getInputCodex has 57 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            public function getInputCodex( $value, $hasErrors ) {
                                $optionDescriptions = $this->getOptionDescriptions();
                                $html = '';
                        
                                // Iterate over an array of options and return the HTML markup.
                        Severity: Major
                        Found in includes/htmlform/fields/HTMLRadioField.php - About 2 hrs to fix

                          Method findVariantLink has 57 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              public function findVariantLink( &$link, &$nt, $ignoreOtherCond = false ) {
                                  # If the article has already existed, there is no need to
                                  # check it again. Otherwise it may cause a fault.
                                  if ( $nt instanceof LinkTarget ) {
                                      $nt = Title::castFromLinkTarget( $nt );
                          Severity: Major
                          Found in includes/language/LanguageConverter.php - About 2 hrs to fix

                            Method collapseData has 57 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                private function collapseData() {
                                    $this->exifGPStoNumber( 'GPSLatitude' );
                                    $this->exifGPStoNumber( 'GPSDestLatitude' );
                                    $this->exifGPStoNumber( 'GPSLongitude' );
                                    $this->exifGPStoNumber( 'GPSDestLongitude' );
                            Severity: Major
                            Found in includes/media/Exif.php - About 2 hrs to fix

                              Method initQueryBuilderForTable has 57 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                  private function initQueryBuilderForTable( string $table, string $select ): SelectQueryBuilder {
                                      $prefix = $this->getPrefix( $table );
                                      $queryBuilder = $this->getDB()->newSelectQueryBuilder();
                                      $joinPageTable = $select !== 'ids';
                              
                              
                              Severity: Major
                              Found in includes/cache/BacklinkCache.php - About 2 hrs to fix

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

                                    public function getAllowedParams() {
                                        $allowedParams = $this->buildCommonApiParams() + [
                                            'what' => [
                                                ParamValidator::PARAM_TYPE => [
                                                    'title',
                                Severity: Major
                                Found in includes/api/ApiQuerySearch.php - About 2 hrs to fix

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

                                      public function execute( $par ) {
                                          $this->useTransactionalTimeLimit();
                                          $this->checkReadOnly();
                                          $this->setHeaders();
                                          $this->outputHeader();
                                  Severity: Major
                                  Found in includes/specials/SpecialMovePage.php - About 2 hrs to fix

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

                                        public function run() {
                                            if ( !$this->redirTitle ) {
                                                $this->setLastError( 'Invalid title' );
                                    
                                                return false;
                                    Severity: Major
                                    Found in includes/jobqueue/jobs/DoubleRedirectJob.php - About 2 hrs to fix

                                      Method toJsonArray has 57 lines of code (exceeds 25 allowed). Consider refactoring.
                                      Open

                                          protected function toJsonArray(): array {
                                              // WARNING: When changing how this class is serialized, follow the instructions
                                              // at <https://www.mediawiki.org/wiki/Manual:Parser_cache/Serialization_compatibility>!
                                      
                                              $data = [
                                      Severity: Major
                                      Found in includes/parser/ParserOutput.php - About 2 hrs to fix

                                        Method insert has 57 lines of code (exceeds 25 allowed). Consider refactoring.
                                        Open

                                            public function insert( IDatabase $dbw = null ) {
                                                $services = MediaWikiServices::getInstance();
                                                $dbw = $dbw ?: $services->getConnectionProvider()->getPrimaryDatabase();
                                        
                                                $this->timestamp ??= wfTimestampNow();
                                        Severity: Major
                                        Found in includes/logging/ManualLogEntry.php - About 2 hrs to fix
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language