wikimedia/mediawiki-extensions-Wikibase

View on GitHub

Showing 1,432 of 2,096 total issues

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

    public function execute(): void {
        $params = $this->extractRequestParams();
        $user = $this->getUser();

        $this->validateParameters( $params );
Severity: Minor
Found in repo/includes/Api/ModifyEntity.php - About 1 hr to fix

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

        public function __construct() {
            parent::__construct();
    
            $this->addDescription( 'Rebuilds item terms from primary persistence' );
    
    
    Severity: Minor
    Found in repo/maintenance/rebuildItemTerms.php - About 1 hr to fix

      Method doSearch has 33 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public function doSearch( $query ) {
              $limit = (int)$this->getOption( 'limit', 5 );
      
              $results = $this->searchHelper->getRankedSearchResults(
                  $query,
      Severity: Minor
      Found in repo/maintenance/searchEntities.php - About 1 hr to fix

        Method handleDescriptionValidationErrors has 33 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            private function handleDescriptionValidationErrors( ValidationError $validationError ): void {
                $context = $validationError->getContext();
                switch ( $validationError->getCode() ) {
                    case DescriptionsSyntaxValidator::CODE_DESCRIPTIONS_NOT_ASSOCIATIVE:
                        throw UseCaseError::newInvalidValue( '/item/descriptions' );

          Method handleLabelsValidationError has 33 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              private function handleLabelsValidationError( ValidationError $validationError ): void {
                  $context = $validationError->getContext();
          
                  switch ( $validationError->getCode() ) {
                      case LabelsSyntaxValidator::CODE_LABELS_NOT_ASSOCIATIVE:

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

                public function execute( PatchItemDescriptionsRequest $request ): PatchItemDescriptionsResponse {
                    $deserializedRequest = $this->requestValidator->validateAndDeserialize( $request );
                    $itemId = $deserializedRequest->getItemId();
            
                    $this->assertItemExists->execute( $itemId );

              Method handleSitelinksValidationErrors has 33 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  private function handleSitelinksValidationErrors( ValidationError $validationError, array $serialization ): void {
                      $context = $validationError->getContext();
                      $siteId = fn() => $context[SitelinkValidator::CONTEXT_SITE_ID];
              
                      switch ( $validationError->getCode() ) {

                Method makeNormalizer has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    private function makeNormalizer( PropertyId $propertyId, string $valueType ): DataValueNormalizer {
                        $dataTypeNormalizers = [];
                        $valueTypeNormalizers = [];
                
                        try {
                Severity: Minor
                Found in lib/includes/Normalization/SnakNormalizer.php - About 1 hr to fix

                  Method factory has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      public static function factory( $language, $sourceLanguage = null ) {
                          if ( is_string( $language ) ) {
                              $languageCode = self::validateLanguageCode( $language );
                          } else {
                              $languageCode = $language->getCode();
                  Severity: Minor
                  Found in lib/includes/LanguageWithConversion.php - About 1 hr to fix

                    Function _createEntitytermsforlanguagelistviewToggler has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                            _createEntitytermsforlanguagelistviewToggler: function () {
                                this._registerTogglerForLanguagelistviewDiv( TOGGLER_OPTION_KEY );
                    
                                this.$entitytermsforlanguagelistviewContainer.before(
                                    this.$entitytermsforlanguagelistviewToggler
                    Severity: Minor
                    Found in view/resources/jquery/wikibase/jquery.wikibase.entitytermsview.js - About 1 hr to fix

                      Function e260 has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                      /***/ (function(module, exports, __webpack_require__) {
                      
                      "use strict";
                      
                      var toIndexedObject = __webpack_require__("fc6a");
                      Severity: Minor
                      Found in view/lib/wikibase-tainted-ref/dist/tainted-ref.common.js - About 1 hr to fix

                        Method getChangeParamsForDiffOp has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            private function getChangeParamsForDiffOp( DiffOp $diffOp, $siteId, $messagePrefix ) {
                                $params = [];
                        
                                if ( $diffOp instanceof DiffOpAdd ) {
                                    $params['message'] = $messagePrefix . 'add';
                        Severity: Minor
                        Found in client/includes/RecentChanges/SiteLinkCommentCreator.php - About 1 hr to fix

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

                              private function showForm() {
                                  $dataTypeSelect = new DataTypeSelector(
                                      $this->dataTypeFactory->getTypes(),
                                      $this->getLanguage()->getCode()
                                  );
                          Severity: Minor
                          Found in repo/includes/Specials/SpecialListProperties.php - About 1 hr to fix

                            Method getChangeOp has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                protected function getChangeOp( array $preparedParameters, EntityDocument $entity ): ChangeOp {
                                    if ( $this->shouldRemove( $preparedParameters ) ) {
                                        $linksite = $this->stringNormalizer->trimToNFC( $preparedParameters['linksite'] );
                                        return $this->siteLinkChangeOpFactory->newRemoveSiteLinkOp( $linksite );
                                    } else {
                            Severity: Minor
                            Found in repo/includes/Api/SetSiteLink.php - About 1 hr to fix

                              Method modifyEntity has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                  protected function modifyEntity( EntityDocument $entity, ChangeOp $changeOp, array $preparedParameters ): Summary {
                                      if ( !( $entity instanceof Item ) ) {
                                          $this->errorReporter->dieError( "The given entity is not an item", "not-item" );
                                      }
                              
                              
                              Severity: Minor
                              Found in repo/includes/Api/SetSiteLink.php - About 1 hr to fix

                                Method getSecondaryDataUpdates has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                    public function getSecondaryDataUpdates(
                                        Title $title,
                                        Content $content,
                                        $role,
                                        SlotRenderingProvider $slotOutput
                                Severity: Minor
                                Found in repo/includes/Content/ItemHandler.php - About 1 hr to fix

                                  Method getRegexpsFromMessageText has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                      private function getRegexpsFromMessageText( string $msgText ): array {
                                          static $pluralRegex = null;
                                          if ( $pluralRegex === null ) {
                                              // We need to match on a preg_quoted string here, so double quote
                                              $pluralRegex = '@' . preg_quote( preg_quote( '{{PLURAL:$1|' ) ) .
                                  Severity: Minor
                                  Found in repo/includes/Parsers/MwTimeIsoParser.php - About 1 hr to fix

                                    Method getTimeParsers has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                        private function getTimeParsers() {
                                            global $wgDefaultUserOptions;
                                    
                                            $eraParser = new MwEraParser( $this->options );
                                            $isoTimestampParser = new IsoTimestampParser(
                                    Severity: Minor
                                    Found in repo/includes/Parsers/TimeParserFactory.php - About 1 hr to fix

                                      Method handleLabelsValidationError has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                                      Open

                                          private function handleLabelsValidationError( ValidationError $validationError ): void {
                                              $context = $validationError->getContext();
                                      
                                              switch ( $validationError->getCode() ) {
                                                  case LabelsSyntaxValidator::CODE_LABELS_NOT_ASSOCIATIVE:

                                        Method formatSnak has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                                        Open

                                            public function formatSnak( Snak $snak ) {
                                                $warningText = '';
                                                try {
                                                    return $this->snakFormatter->formatSnak( $snak );
                                                } catch ( MismatchingDataValueTypeException $ex ) {
                                        Severity: Minor
                                        Found in lib/includes/Formatters/ErrorHandlingSnakFormatter.php - About 1 hr to fix
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language