wikimedia/mediawiki-extensions-Wikibase

View on GitHub

Showing 1,432 of 2,096 total issues

Method addValue has 34 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function addValue(
        RdfWriter $writer,
        $propertyValueNamespace,
        $propertyValueLName,
        $dataType,
Severity: Minor
Found in repo/includes/Rdf/Values/QuantityRdfBuilder.php - About 1 hr to fix

    Method doDBUpdates has 34 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public function doDBUpdates() {
            if ( !WikibaseSettings::isRepoEnabled() ) {
                $this->output( "You need to have Wikibase enabled in order to use this maintenance script!\n\n" );
                exit;
            }
    Severity: Minor
    Found in repo/maintenance/rebuildPropertyInfo.php - About 1 hr to fix

      Method newSuccessHttpResponse has 34 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          private function newSuccessHttpResponse( CreatePropertyResponse $useCaseResponse ): Response {
              $response = $this->getResponseFactory()->create();
              $response->setStatus( 201 );
              $response->setHeader( 'Content-Type', 'application/json' );
              $response->setHeader(
      Severity: Minor
      Found in repo/rest-api/src/RouteHandlers/CreatePropertyRouteHandler.php - About 1 hr to fix

        Method validateAndDeserialize has 34 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public function validateAndDeserialize( PropertyDescriptionEditRequest $request ): Term {
                $property = $this->propertyRetriever->getPropertyWriteModel( new NumericPropertyId( $request->getPropertyId() ) );
                $language = $request->getLanguageCode();
                $description = $request->getDescription();
        
        

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

              public function validate( array $statementSerialization, string $basePath = '' ): ?ValidationError {
                  try {
                      $this->deserializedStatement = $this->deserializer->deserialize( $statementSerialization, $basePath );
                  } catch ( MissingFieldException $e ) {
                      return new ValidationError(
          Severity: Minor
          Found in repo/rest-api/src/Application/Validation/StatementValidator.php - About 1 hr to fix

            Method newFromArray has 34 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                public static function newFromArray( array $wellKnownPropertyIds, ?LoggerInterface $logger = null ): self {
                    $logger = $logger ?: new NullLogger();
            
                    $referenceUrlPropertyId = self::parseWellKnownProperty( $wellKnownPropertyIds, 'referenceUrl', $logger );
                    $titlePropertyId = self::parseWellKnownProperty( $wellKnownPropertyIds, 'title', $logger );
            Severity: Minor
            Found in lib/includes/Formatters/Reference/WellKnownReferenceProperties.php - About 1 hr to fix

              Method getFormatter has 34 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  protected function getFormatter( $dataValueType, $dataTypeId = null ): ValueFormatter {
                      $formatter = null;
              
                      if ( $dataTypeId !== null ) {
                          if ( isset( $this->formatters["PT:$dataTypeId"] ) ) {
              Severity: Minor
              Found in lib/includes/Formatters/DispatchingValueFormatter.php - About 1 hr to fix

                Method loadEntityDataFromWikiPageRevision has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    public function loadEntityDataFromWikiPageRevision( RevisionRecord $revision, string $slotRole, int $revStoreFlags ) {
                        // NOTE: Support for cross-wiki content access in RevisionStore is incomplete when,
                        // reading from the pre-MCR database schema, see T201194.
                        // For that reason, we have to load and decode the content blob directly,
                        // instead of using RevisionRecord::getContent() or SlotRecord::getContent().
                Severity: Minor
                Found in lib/includes/Store/Sql/WikiPageEntityDataLoader.php - About 1 hr to fix

                  Consider simplifying this complex logical expression.
                  Open

                          if ( ( !structureEditorFactory || !structureEditorFactory.getAdder )
                              || ( !messageProvider || !messageProvider.getMessage )
                              || !Array.isArray( userLanguages )
                              || ( vocabularyLookupApiUrl && typeof vocabularyLookupApiUrl !== 'string'
                              || !commonsApiUrl )
                  Severity: Critical
                  Found in view/resources/wikibase/view/ViewFactory.js - About 1 hr to fix

                    Function _onSiteSelectorChangeHandler has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                            _onSiteSelectorChangeHandler: function () {
                                var apiUrl,
                                    $page = $( '#wbclient-linkItem-page' );
                    
                                $page.val( '' );
                    Severity: Minor
                    Found in client/resources/jquery.wikibase/jquery.wikibase.linkitem.js - About 1 hr to fix

                      Function WbListviewListItemAdapter has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          var SELF = $.wikibase.listview.ListItemAdapter = function WbListviewListItemAdapter( options ) {
                              if ( typeof options.listItemWidget !== 'function'
                                  || !options.listItemWidget.prototype.widgetName
                                  || !options.listItemWidget.prototype.widgetEventPrefix
                              ) {

                        Function value has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                                value: function ( value ) {
                                    if ( value !== undefined ) {
                                        this.option( 'value', value );
                                        return;
                                    }
                        Severity: Minor
                        Found in view/resources/jquery/wikibase/snakview/snakview.js - About 1 hr to fix

                          Function fdbc has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                          /***/ (function(module, exports) {
                          
                          // iterable DOM collections
                          // flag - `iterable` interface - 'entries', 'keys', 'values', 'forEach' methods
                          module.exports = {
                          Severity: Minor
                          Found in view/lib/wikibase-tainted-ref/dist/tainted-ref.common.js - About 1 hr to fix

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

                                public function doQuery( array $params ): ?IResultWrapper {
                                    $pages = $this->getPageSet()->getGoodPages();
                                    if ( !$pages ) {
                                        return null;
                                    }
                            Severity: Minor
                            Found in client/includes/Api/ApiPropsEntityUsage.php - About 1 hr to fix

                              Function actions has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                              function actions(metricTracker) {
                                return {
                                  [STORE_INIT](context, guids) {
                                    context.commit(SET_ALL_UNTAINTED, guids);
                                    context.commit(SET_ALL_POPPERS_HIDDEN, guids);
                              Severity: Minor
                              Found in view/lib/wikibase-tainted-ref/dist/tainted-ref.common.js - About 1 hr to fix

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

                                    public function doWikibaseHandleChange( Change $change ) {
                                        if ( $this->sendEchoNotification !== true ) {
                                            return false;
                                        }
                                
                                
                                Severity: Minor
                                Found in client/includes/Hooks/EchoNotificationsHandlers.php - About 1 hr to fix

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

                                      public function createSchema(
                                          Title $title,
                                          $revisionTimestamp,
                                          $entityConceptUri,
                                          File $imageFile = null,
                                  Severity: Minor
                                  Found in client/includes/Hooks/SkinAfterBottomScriptsHandler.php - About 1 hr to fix

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

                                        public static function rebuildPropertyTerms( DatabaseUpdater $updater ) {
                                            $localEntitySourceName = WikibaseRepo::getSettings()->getSetting( 'localEntitySourceName' );
                                            $propertySource = WikibaseRepo::getEntitySourceDefinitions()
                                                ->getDatabaseSourceForEntityType( 'property' );
                                            if ( $propertySource === null || $propertySource->getSourceName() !== $localEntitySourceName ) {
                                    Severity: Minor
                                    Found in repo/includes/Store/Sql/DatabaseSchemaUpdater.php - About 1 hr to fix

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

                                          public function getEntityIds( array $sites, array $titles, $normalize ) {
                                              $ids = [];
                                              $numSites = count( $sites );
                                              $numTitles = count( $titles );
                                      
                                      
                                      Severity: Minor
                                      Found in repo/includes/Api/EntityByTitleHelper.php - About 1 hr to fix

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

                                            protected function showQuery( array $query = [], $subPage = false ) {
                                                $paging = false;
                                                $out = $this->getOutput();
                                        
                                                if ( $this->limit == 0 && $this->offset == 0 ) {
                                        Severity: Minor
                                        Found in repo/includes/Specials/SpecialWikibaseQueryPage.php - About 1 hr to fix
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language