wikimedia/mediawiki-core

View on GitHub

Showing 11,545 of 11,545 total issues

Method isReusableFor has 40 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function isReusableFor(
        UserIdentity $user = null,
        RevisionRecord $revision = null,
        RevisionSlotsUpdate $slotsUpdate = null,
        $parentId = null
Severity: Minor
Found in includes/Storage/DerivedPageDataUpdater.php - About 1 hr to fix

    Method format has 40 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public function format( $diff ) {
            $oldline = 1;
            $newline = 1;
            $retval = [];
            foreach ( $diff->getEdits() as $edit ) {
    Severity: Minor
    Found in includes/libs/Diff/ArrayDiffFormatter.php - About 1 hr to fix

      Method newSaved has 40 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public static function newSaved(
              int $revisionId,
              ?int $contentId,
              string $contentAddress,
              SlotRecord $protoSlot
      Severity: Minor
      Found in includes/Revision/SlotRecord.php - About 1 hr to fix

        Method checkRange has 40 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            protected function checkRange( $value, $name, $origValue, array $settings, array $options ) {
                $min = $settings[self::PARAM_MIN] ?? null;
                $max1 = $settings[self::PARAM_MAX] ?? null;
                $max2 = $settings[self::PARAM_MAX2] ?? $max1;
                $err = false;
        Severity: Minor
        Found in includes/libs/ParamValidator/TypeDef/NumericDef.php - About 1 hr to fix

          Method getFileHttpUrl has 40 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              public function getFileHttpUrl( array $params ) {
                  if ( $this->swiftTempUrlKey != '' ||
                      ( $this->rgwS3AccessKey != '' && $this->rgwS3SecretKey != '' )
                  ) {
                      [ $srcCont, $srcRel ] = $this->resolveStoragePathReal( $params['src'] );
          Severity: Minor
          Found in includes/libs/filebackend/SwiftFileBackend.php - About 1 hr to fix

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

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

              Method executeQuery has 40 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  final protected function executeQuery( $sql, $fname, $flags ) {
                      $this->assertHasConnectionHandle();
              
                      $isPermWrite = false;
                      $isWrite = $sql->isWriteQuery();
              Severity: Minor
              Found in includes/libs/rdbms/database/Database.php - About 1 hr to fix

                Method handleErroredQuery has 40 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    private function handleErroredQuery( QueryStatus $status, $sql, $fname, $queryRuntime, $priorSessInfo ) {
                        $errflags = self::ERR_NONE;
                        $error = $status->message;
                        $errno = $status->code;
                        if ( $status->res !== false ) {
                Severity: Minor
                Found in includes/libs/rdbms/database/Database.php - About 1 hr to fix

                  Method create has 40 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      public function create( $type, $params = [], $connect = Database::NEW_CONNECTED ) {
                          $class = $this->getClass( $type, $params['driver'] ?? null );
                  
                          if ( class_exists( $class ) && is_subclass_of( $class, IDatabase::class ) ) {
                              $params += [
                  Severity: Minor
                  Found in includes/libs/rdbms/database/DatabaseFactory.php - About 1 hr to fix

                    Method recordQueryCompletion has 40 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        public function recordQueryCompletion(
                            $query,
                            float $sTime,
                            bool $isWrite,
                            ?int $rowCount,
                    Severity: Minor
                    Found in includes/libs/rdbms/TransactionProfiler.php - About 1 hr to fix

                      Method getUndeleteLink has 40 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          public function getUndeleteLink() {
                              $action = $this->getRequest()->getRawVal( 'action', 'view' );
                              $title = $this->getTitle();
                              $linkRenderer = MediaWikiServices::getInstance()->getLinkRenderer();
                      
                      
                      Severity: Minor
                      Found in includes/skins/Skin.php - About 1 hr to fix

                        Method buildSidebar has 40 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            public function buildSidebar() {
                                if ( $this->sidebar === null ) {
                                    $services = MediaWikiServices::getInstance();
                                    $callback = function ( $old = null, &$ttl = null ) {
                                        $bar = [];
                        Severity: Minor
                        Found in includes/skins/Skin.php - About 1 hr to fix

                          Method getPersonalToolsForMakeListItem has 40 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              final public function getPersonalToolsForMakeListItem( $urls, $applyClassesToListItems = false ) {
                                  $personal_tools = [];
                                  foreach ( $urls as $key => $plink ) {
                                      # The class on a personal_urls item is meant to go on the <a> instead
                                      # of the <li> so we have to use a single item "links" array instead
                          Severity: Minor
                          Found in includes/skins/Skin.php - About 1 hr to fix

                            Method getFormFields has 40 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                protected function getFormFields() {
                                    $request = $this->getRequest();
                                    $ret = [
                                        'diff' => [
                                            'type' => 'info',
                            Severity: Minor
                            Found in includes/actions/McrUndoAction.php - About 1 hr to fix

                              Method readEndOfCentralDirectoryRecord has 40 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                  private function readEndOfCentralDirectoryRecord() {
                                      $info = [
                                          'signature' => 4,
                                          'disk' => 2,
                                          'CD start disk' => 2,
                              Severity: Minor
                              Found in includes/utils/ZipDirectoryReader.php - About 1 hr to fix

                                Method openElement has 40 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                    public static function openElement( $element, $attribs = [] ) {
                                        $attribs = (array)$attribs;
                                        // This is not required in HTML5, but let's do it anyway, for
                                        // consistency and better compression.
                                        $element = strtolower( $element );
                                Severity: Minor
                                Found in includes/Html/Html.php - About 1 hr to fix

                                  Method getInputOOUI has 40 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                      public function getInputOOUI( $value ) {
                                          $this->mParent->getOutput()->addModuleStyles( 'mediawiki.widgets.TagMultiselectWidget.styles' );
                                  
                                          $params = [ 'name' => $this->mName ];
                                  
                                  
                                  Severity: Minor
                                  Found in includes/htmlform/fields/HTMLUsersMultiselectField.php - About 1 hr to fix

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

                                        protected function execute() {
                                            global $wgTitle;
                                    
                                            // Get title from request parameters,
                                            // is set on the fly by parseTitle the first time.
                                    Severity: Minor
                                    Found in includes/actions/ActionEntryPoint.php - About 1 hr to fix

                                      Method getInputOOUI has 40 lines of code (exceeds 25 allowed). Consider refactoring.
                                      Open

                                          public function getInputOOUI( $value ) {
                                              $classes = [];
                                      
                                              if ( isset( $this->mParams['cols'] ) ) {
                                                  throw new InvalidArgumentException( "OOUIHTMLForm does not support the 'cols' parameter for textareas" );
                                      Severity: Minor
                                      Found in includes/htmlform/fields/HTMLTextAreaField.php - About 1 hr to fix

                                        Method namespaceSelector has 40 lines of code (exceeds 25 allowed). Consider refactoring.
                                        Open

                                            public static function namespaceSelector(
                                                array $params = [],
                                                array $selectAttribs = []
                                            ) {
                                                ksort( $selectAttribs );
                                        Severity: Minor
                                        Found in includes/Html/Html.php - About 1 hr to fix
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language