wikimedia/mediawiki-core

View on GitHub

Showing 11,545 of 11,545 total issues

Method deserialize has 42 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function deserialize( $json, string $expectedClass = null ) {
        Assert::parameterType( [ 'stdClass', 'array', 'string' ], $json, '$json' );
        Assert::precondition(
            !$expectedClass || is_subclass_of( $expectedClass, JsonDeserializable::class ),
            '$expectedClass parameter must be subclass of JsonDeserializable, got ' . $expectedClass
Severity: Minor
Found in includes/json/JsonCodec.php - About 1 hr to fix

    Method constructSlotRecords has 42 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        private function constructSlotRecords(
            $revId,
            $slotRows,
            $queryFlags,
            PageIdentity $page,
    Severity: Minor
    Found in includes/Revision/RevisionStore.php - About 1 hr to fix

      Method detectNonSerializableDataInternal has 42 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          private function detectNonSerializableDataInternal(
              $value,
              bool $expectDeserialize,
              string $accumulatedPath,
              bool $exhaustive = false
      Severity: Minor
      Found in includes/json/JsonCodec.php - About 1 hr to fix

        Method doCreateInternal has 42 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            protected function doCreateInternal( array $params ) {
                $status = $this->newStatus();
        
                [ $dstCont, $dstRel ] = $this->resolveStoragePathReal( $params['dst'] );
                if ( $dstRel === null ) {
        Severity: Minor
        Found in includes/libs/filebackend/SwiftFileBackend.php - About 1 hr to fix

          Method doQuickOperationsInternal has 42 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              final protected function doQuickOperationsInternal( array $ops, array $opts ) {
                  /** @noinspection PhpUnusedLocalVariableInspection */
                  $ps = $this->scopedProfileSection( __METHOD__ . "-{$this->name}" );
                  $status = $this->newStatus();
          
          
          Severity: Minor
          Found in includes/libs/filebackend/FileBackendStore.php - About 1 hr to fix

            Method validateCookieDomain has 42 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                public static function validateCookieDomain( $domain, $originDomain = null ) {
                    $dc = explode( ".", $domain );
            
                    // Don't allow a trailing dot or addresses without a or just a leading dot
                    if ( substr( $domain, -1 ) == '.' ||
            Severity: Minor
            Found in includes/libs/Cookie.php - About 1 hr to fix

              Method doGetMulti has 42 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  protected function doGetMulti( array $keys, $flags = 0 ) {
                      $blobsFound = [];
              
                      [ $keysByServer, $connByServer ] = $this->getConnectionsForKeys( $keys );
                      foreach ( $keysByServer as $server => $batchKeys ) {
              Severity: Minor
              Found in includes/libs/objectcache/RedisBagOStuff.php - About 1 hr to fix

                Method parseAccept has 42 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    public function parseAccept( $accept ): array {
                        $accepts = explode( ',', $accept );  // FIXME: Allow commas in quotes
                        $ret = [];
                
                        foreach ( $accepts as $i => $a ) {
                Severity: Minor
                Found in includes/libs/http/HttpAcceptParser.php - About 1 hr to fix

                  Method scaleLoads has 42 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      public function scaleLoads( array &$weightByServer ) {
                          if ( count( $weightByServer ) <= 1 ) {
                              // Single-server group; relative adjustments are pointless
                              return;
                          }
                  Severity: Minor
                  Found in includes/libs/rdbms/loadmonitor/LoadMonitor.php - About 1 hr to fix

                    Method showPreview has 42 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        private function showPreview( RevisionRecord $rev ) {
                            // Mostly copied from EditPage::getPreviewText()
                            $out = $this->getOutput();
                    
                            try {
                    Severity: Minor
                    Found in includes/actions/McrUndoAction.php - About 1 hr to fix

                      Method __construct has 42 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          public function __construct(
                              $url, array $options, $caller = __METHOD__, Profiler $profiler = null
                          ) {
                              $this->urlUtils = MediaWikiServices::getInstance()->getUrlUtils();
                              if ( !array_key_exists( 'timeout', $options )
                      Severity: Minor
                      Found in includes/http/MWHttpRequest.php - About 1 hr to fix

                        Method performAction has 42 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            protected function performAction( Article $article, Title $requestTitle ) {
                                $request = $this->getRequest();
                                $output = $this->getOutput();
                                $title = $this->getTitle();
                                $user = $this->getUser();
                        Severity: Minor
                        Found in includes/actions/ActionEntryPoint.php - About 1 hr to fix

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

                              public function getInputCodex( $value, $hasErrors ) {
                                  $textareaClasses = [ 'cdx-text-area__textarea' ];
                                  if ( $this->mClass !== '' ) {
                                      $textareaClasses[] = $this->mClass;
                                  }
                          Severity: Minor
                          Found in includes/htmlform/fields/HTMLTextAreaField.php - About 1 hr to fix

                            Method getHumanTimestampInternal has 42 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                private function getHumanTimestampInternal(
                                    MWTimestamp $ts, MWTimestamp $relativeTo, User $user
                                ) {
                                    $diff = $ts->diff( $relativeTo );
                                    $diffDay = (bool)( (int)$ts->timestamp->format( 'w' ) -
                            Severity: Minor
                            Found in includes/language/Language.php - About 1 hr to fix

                              Method swapICCProfile has 42 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                  public function swapICCProfile( $filepath, array $colorSpaces,
                                      array $oldProfileStrings, $profileFilepath
                                  ) {
                                      $exiftool = MediaWikiServices::getInstance()->getMainConfig()->get( MainConfigNames::Exiftool );
                              
                              
                              Severity: Minor
                              Found in includes/media/JpegHandler.php - About 1 hr to fix

                                Method rasterize has 42 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                    public function rasterize( $srcPath, $dstPath, $width, $height, $lang = false ) {
                                        $mainConfig = MediaWikiServices::getInstance()->getMainConfig();
                                        $svgConverters = $mainConfig->get( MainConfigNames::SVGConverters );
                                        $svgConverter = $mainConfig->get( MainConfigNames::SVGConverter );
                                        $svgConverterPath = $mainConfig->get( MainConfigNames::SVGConverterPath );
                                Severity: Minor
                                Found in includes/media/SvgHandler.php - About 1 hr to fix

                                  Method doAdd has 42 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                      protected function doAdd( $path, $params, $options, $key = null ) {
                                          // Make sure all paths start with a /
                                          if ( $path[0] !== '/' ) {
                                              $path = '/' . $path;
                                          }
                                  Severity: Minor
                                  Found in includes/Request/PathRouter.php - About 1 hr to fix

                                    Method __construct has 42 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                        public function __construct( Installer $installer ) {
                                            $this->installer = $installer;
                                    
                                            $this->extensions = $installer->getVar( '_Extensions' );
                                            $this->skins = $installer->getVar( '_Skins' );
                                    Severity: Minor
                                    Found in includes/installer/LocalSettingsGenerator.php - About 1 hr to fix

                                      Method checkLoginSecurityLevel has 42 lines of code (exceeds 25 allowed). Consider refactoring.
                                      Open

                                          protected function checkLoginSecurityLevel( $level = null ) {
                                              $level = $level ?: $this->getName();
                                              $key = 'SpecialPage:reauth:' . $this->getName();
                                              $request = $this->getRequest();
                                      
                                      
                                      Severity: Minor
                                      Found in includes/specialpage/SpecialPage.php - About 1 hr to fix

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

                                            public function getAllowedParams() {
                                                $ret = [
                                                    'prop' => [
                                                        ParamValidator::PARAM_ISMULTI => true,
                                                        ParamValidator::PARAM_DEFAULT => 'ids|title|url',
                                        Severity: Minor
                                        Found in includes/api/ApiQueryExtLinksUsage.php - About 1 hr to fix
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language