wikimedia/mediawiki-extensions-Wikibase

View on GitHub

Showing 2,096 of 2,096 total issues

Method displayUndoDiff has 26 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    private function displayUndoDiff( EntityContentDiff $diff ): void {
        $tableClass = 'diff diff-contentalign-' . $this->getTitle()->getPageLanguage()->alignStart();

        // add Wikibase styles, the diff may include entity links with labels, including fallback indicators
        $this->getOutput()->addModuleStyles( [ 'wikibase.alltargets' ] );
Severity: Minor
Found in repo/includes/Actions/EditEntityAction.php - About 1 hr to fix

    Method getApiFormatReferenceSpec has 26 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public function getApiFormatReferenceSpec( array $clientSettings ): ?array {
            // This API module is (for now) only enabled conditionally
            if ( !( $clientSettings['dataBridgeEnabled'] ?? false ) ) {
                return null;
            }
    Severity: Minor
    Found in client/includes/Hooks/ExtensionLoadHandler.php - About 1 hr to fix

      Method outputForm has 26 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          private function outputForm( array $sites, $itemString ) {
              $formDescriptor = [
                  'site' => [
                      'name' => 'site',
                      'default' => implode( ',', $sites ),
      Severity: Minor
      Found in repo/includes/Specials/SpecialGoToLinkedPage.php - About 1 hr to fix

        Method parseStringValue has 26 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            private function parseStringValue( ValueParser $parser, string $value, ?ValueValidator $validator ): array {
                $result = [
                    'raw' => $value,
                ];
        
        
        Severity: Minor
        Found in repo/includes/Api/ParseValue.php - About 1 hr to fix

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

              protected function getAllowedParams(): array {
                  return array_merge(
                      [
                          'claim' => [
                              ParamValidator::PARAM_TYPE => 'text',
          Severity: Minor
          Found in repo/includes/Api/SetClaim.php - About 1 hr to fix

            Method buildTermSearchMatchDisplayEntry has 26 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                private function buildTermSearchMatchDisplayEntry( TermSearchResult $match, array $entry ): array {
                    $entry['display'] = [];
                    ApiResult::setArrayType( $entry['display'], 'assoc' );
            
                    $displayLabel = $match->getDisplayLabel();
            Severity: Minor
            Found in repo/includes/Api/SearchEntities.php - About 1 hr to fix

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

                  public function execute(): void {
                      $params = $this->extractRequestParams();
                      $this->validateParameters( $params );
              
                      $guid = $params['statement'];
              Severity: Minor
              Found in repo/includes/Api/RemoveReferences.php - About 1 hr to fix

                Method getItem has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    private function getItem(): ?Item {
                        $params = $this->getParams();
                        $itemId = new ItemId( $params['entityId'] );
                        try {
                            $entity = $this->entityLookup->getEntity( $itemId );
                Severity: Minor
                Found in repo/includes/UpdateRepo/UpdateRepoJob.php - About 1 hr to fix

                  Method onBeforePageDisplay has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      public static function onBeforePageDisplay( OutputPage $out, Skin $skin ) {
                          $entityNamespaceLookup = WikibaseRepo::getEntityNamespaceLookup();
                          $namespace = $out->getTitle()->getNamespace();
                          $isEntityTitle = $entityNamespaceLookup->isNamespaceWithEntities( $namespace );
                          $settings = WikibaseRepo::getSettings();
                  Severity: Minor
                  Found in repo/includes/RepoHooks.php - About 1 hr to fix

                    Method validateEntity has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        public function validateEntity( EntityDocument $entity ) {
                            $entityId = $entity->getId()->getSerialization();
                            $entityType = $entity->getType();
                    
                            if ( $entity instanceof LabelsProvider ) {
                    Severity: Minor
                    Found in repo/includes/Validators/LabelUniquenessValidator.php - About 1 hr to fix

                      Method getFlavor has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          private function getFlavor( ?string $flavorName ): int {
                              switch ( $flavorName ) {
                                  case 'simple':
                                      return RdfProducer::PRODUCE_TRUTHY_STATEMENTS
                                          | RdfProducer::PRODUCE_SITELINKS
                      Severity: Minor
                      Found in repo/includes/LinkedData/EntityDataSerializationService.php - About 1 hr to fix

                        Method validate has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            public function validate( EntityDocument $entity ) {
                                if ( !( $entity instanceof DescriptionsProvider ) ) {
                                    throw new InvalidArgumentException( '$entity must be a DescriptionsProvider' );
                                }
                        
                        
                        Severity: Minor
                        Found in repo/includes/ChangeOp/ChangeOpDescription.php - About 1 hr to fix

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

                              public static function factory(
                                  Language $contentLanguage,
                                  HttpRequestFactory $httpRequestFactory,
                                  IBufferingStatsdDataFactory $statsdDataFactory,
                                  UserOptionsLookup $userOptionsLookup,
                          Severity: Minor
                          Found in repo/includes/Hooks/OutputPageBeforeHTMLHookHandler.php - About 1 hr to fix

                            Method formatArg has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                protected function formatArg( $arg ) {
                                    try {
                                        if ( $arg instanceof Snak ) {
                                            return $this->snakFormatter->formatSnak( $arg );
                                        } elseif ( $arg instanceof EntityId ) {
                            Severity: Minor
                            Found in repo/includes/SummaryFormatter.php - About 1 hr to fix

                              Method validateBadgeSerialization has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                  public function validateBadgeSerialization( array $serialization ) {
                                      foreach ( $serialization as $badgeSerialization ) {
                                          if ( !is_string( $badgeSerialization ) ) {
                                              throw new ChangeOpDeserializationException(
                                                  'Badges: a string was expected, but not found',

                                Method getValueBuilder has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                    private function getValueBuilder( $dataTypeId, $dataValueType ) {
                                        if ( $dataTypeId !== null ) {
                                            if ( isset( $this->valueBuilders["PT:$dataTypeId"] ) ) {
                                                return $this->valueBuilders["PT:$dataTypeId"];
                                            }
                                Severity: Minor
                                Found in repo/includes/Rdf/DispatchingValueSnakRdfBuilder.php - About 1 hr to fix

                                  Method validate has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                      public function validate( EntityDocument $entity ) {
                                          if ( !( $entity instanceof LabelsProvider ) ) {
                                              throw new InvalidArgumentException( '$entity must be a LabelsProvider' );
                                          }
                                  
                                  
                                  Severity: Minor
                                  Found in repo/includes/ChangeOp/ChangeOpLabel.php - About 1 hr to fix

                                    Method addEntityPageProps has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                        public function addEntityPageProps( EntityDocument $entity ): void {
                                            if ( !$this->shouldProduce( RdfProducer::PRODUCE_PAGE_PROPS ) ) {
                                                return;
                                            }
                                            $pagePropertyDefs = $this->getPagePropertyDefs();
                                    Severity: Minor
                                    Found in repo/includes/Rdf/RdfBuilder.php - About 1 hr to fix

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

                                          public function __construct() {
                                              parent::__construct();
                                      
                                              $this->addDescription( 'Rebuilds entity quantity unit values' );
                                      
                                      
                                      Severity: Minor
                                      Found in repo/maintenance/rebuildEntityQuantityUnit.php - About 1 hr to fix

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

                                            public function execute( PatchPropertyAliasesRequest $request ): PatchPropertyAliasesResponse {
                                                $deserializedRequest = $this->validator->validateAndDeserialize( $request );
                                                $editMetadata = $deserializedRequest->getEditMetadata();
                                        
                                                $this->assertPropertyExists->execute( $deserializedRequest->getPropertyId() );
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language