wikimedia/mediawiki-extensions-Wikibase

View on GitHub

Showing 1,432 of 2,096 total issues

Function focus has 31 lines of code (exceeds 25 allowed). Consider refactoring.
Open

        focus: function () {
            // Focus first invalid/incomplete item or - if there is none - the first item.
            var listview = this.$listview.data( 'listview' ),
                lia = listview.listItemAdapter(),
                $items = listview.items();
Severity: Minor
Found in view/resources/jquery/wikibase/jquery.wikibase.sitelinklistview.js - About 1 hr to fix

    Method formatResult has 31 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        private function formatResult(
            IResultWrapper $res,
            int $limit,
            array $prop,
            ?ApiPageSet $resultPageSet
    Severity: Minor
    Found in client/includes/Api/ApiListEntityUsage.php - About 1 hr to fix

      Method purgeWebCache has 31 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public function purgeWebCache(
              array $titles,
              array $rootJobParams,
              $causeAction,
              $causeAgent
      Severity: Minor
      Found in client/includes/Changes/WikiPageUpdater.php - About 1 hr to fix

        Method formatEntityUsage has 31 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            private function formatEntityUsage( array $usages, IContextSource $context ): string {
                $usageAspectsByEntity = [];
                $entityIds = [];
        
                foreach ( $usages as $entityUsage ) {
        Severity: Minor
        Found in client/includes/Hooks/EditActionHookHandler.php - About 1 hr to fix

          Method getOrCreatePingbackId has 31 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              private function getOrCreatePingbackId() {
                  if ( !$this->id ) {
                      $dbr = $this->repoConnections->getReadConnection();
          
                      $id = $dbr->newSelectQueryBuilder()
          Severity: Minor
          Found in repo/includes/WikibasePingback.php - About 1 hr to fix

            Method generateDumpForEntityId has 31 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                protected function generateDumpForEntityId( EntityId $entityId ): ?string {
                    try {
                        $entityRevision = $this->entityRevisionLookup->getEntityRevision( $entityId );
            
                        if ( !$entityRevision ) {
            Severity: Minor
            Found in repo/includes/Dumpers/RdfDumpGenerator.php - About 1 hr to fix

              Method getRankedSearchResults has 31 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  public function getRankedSearchResults(
                      $text,
                      $languageCode,
                      $entityType,
                      $limit,
              Severity: Minor
              Found in repo/includes/Api/ConceptUriSearchHelper.php - About 1 hr to fix

                Method getResultHtml has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    public function getResultHtml( TermSearchResult $searchResult ): string {
                        $idHtml = $this->getIdHtml( $searchResult->getEntityId() );
                
                        $displayLabel = $searchResult->getDisplayLabel();
                        $displayDescription = $searchResult->getDisplayDescription();
                Severity: Minor
                Found in repo/includes/ItemDisambiguation.php - About 1 hr to fix

                  Method equals has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      public function equals( Content $that = null ) {
                          if ( $that === $this ) {
                              return true;
                          }
                  
                  
                  Severity: Minor
                  Found in repo/includes/Content/EntityContent.php - About 1 hr to fix

                    Method throwUseCaseError has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        private function throwUseCaseError( ValidationError $validationError ): void {
                            $context = $validationError->getContext();
                            switch ( $validationError->getCode() ) {
                                case LanguageCodeValidator::CODE_INVALID_LANGUAGE_CODE:
                                    throw UseCaseError::newPatchResultInvalidKey( '', $context[LanguageCodeValidator::CONTEXT_LANGUAGE_CODE] );

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

                          public function execute( PatchItemRequest $request ): PatchItemResponse {
                              $deserializedRequest = $this->validator->validateAndDeserialize( $request );
                              $providedMetadata = $deserializedRequest->getEditMetadata();
                              $itemId = $deserializedRequest->getItemId();
                      
                      
                      Severity: Minor
                      Found in repo/rest-api/src/Application/UseCases/PatchItem/PatchItem.php - About 1 hr to fix

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

                            public function validate( array $serialization, string $basePath = '' ): ?ValidationError {
                                $expectedFields = [ 'labels', 'descriptions', 'aliases', 'sitelinks', 'statements' ];
                                foreach ( $expectedFields as $expectedField ) {
                                    $serialization[$expectedField] ??= [];
                                    if ( !is_array( $serialization[$expectedField] ) ) {
                        Severity: Minor
                        Found in repo/rest-api/src/Application/Validation/ItemValidator.php - About 1 hr to fix

                          Method getAmountAndPrecisionHtml has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              private function getAmountAndPrecisionHtml( $precision, $amount = 1 ) {
                                  if ( $amount === 0 ) {
                                      // TODO: Use NumberLocalizer
                                      return '0';
                                  }
                          Severity: Minor
                          Found in lib/includes/Formatters/TimeDetailsFormatter.php - About 1 hr to fix

                            Method getHtml has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                public function getHtml( TermFallback $term ) {
                                    $requestedLanguage = $term->getLanguageCode();
                                    $actualLanguage = $term->getActualLanguageCode();
                                    $sourceLanguage = $term->getSourceLanguageCode();
                            
                            
                            Severity: Minor
                            Found in lib/includes/LanguageFallbackIndicator.php - About 1 hr to fix

                              Method computeSiteDetails has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                  public function computeSiteDetails( MediaWikiSite $site, array $specialGroups, MessageLocalizer $localizer ): array {
                                      $languageNameLookup = $this->languageNameLookupFactory->getForAutonyms();
                              
                                      // FIXME: quickfix to allow a custom site-name / handling for the site groups which are
                                      // special according to the specialSiteLinkGroups setting
                              Severity: Minor
                              Found in lib/includes/Modules/SitesModuleBase.php - About 1 hr to fix

                                Method movePropertyGroup has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                    private function movePropertyGroup( PropertyId $propertyId, $toIndex ) {
                                        if ( $this->getPropertyGroupIndex( $propertyId ) === $toIndex ) {
                                            return;
                                        }
                                
                                
                                Severity: Minor
                                Found in lib/packages/wikibase/data-model/src/ByPropertyIdArray.php - About 1 hr to fix

                                  Function getStatementView has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                      SELF.prototype.getStatementView = function ( startEditingCallback, entityId, propertyId, removeCallback, value, $dom ) {
                                          var currentPropertyId = value ? value.getClaim().getMainSnak().getPropertyId() : propertyId;
                                          var view = this._getView(
                                              'statementview',
                                              $dom,
                                  Severity: Minor
                                  Found in view/resources/wikibase/view/ViewFactory.js - About 1 hr to fix

                                    Function getStatementView has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                        SELF.prototype.getStatementView = function ( startEditingCallback, entityId, propertyId, removeCallback, value, $dom ) {
                                            var controller;
                                            var startEditingController = function () {
                                                return controller.startEditing();
                                            };
                                    Severity: Minor
                                    Found in view/resources/wikibase/view/ControllerViewFactory.js - About 1 hr to fix

                                      Function _onConfirmationDataLoad has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                                      Open

                                              _onConfirmationDataLoad: function ( entity ) {
                                                  var i, itemLink;
                                      
                                                  if ( entity && entity.sitelinks ) {
                                                      var siteLinkCount = 0;
                                      Severity: Minor
                                      Found in client/resources/jquery.wikibase/jquery.wikibase.linkitem.js - About 1 hr to fix

                                        Function search has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                                        Open

                                                search: function () {
                                                    var self = this,
                                                        deferred = $.Deferred();
                                        
                                                    this._clearTimeout();
                                        Severity: Minor
                                        Found in client/resources/jquery.ui/jquery.ui.suggester.js - About 1 hr to fix
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language