wikimedia/mediawiki-extensions-Wikibase

View on GitHub

Showing 1,432 of 2,096 total issues

Function show has 43 lines of code (exceeds 25 allowed). Consider refactoring.
Open

        show: function () {
            var self = this;

            // eslint-disable-next-line no-jquery/no-sizzle
            if ( this._tipsy.$tip && this._tipsy.$tip.is( ':visible' ) ) {
Severity: Minor
Found in client/resources/jquery.wikibase/jquery.wikibase.wbtooltip.js - About 1 hr to fix

    Function show has 43 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

            show: function () {
                var self = this;
    
                // eslint-disable-next-line no-jquery/no-sizzle
                if ( this._tipsy.$tip && this._tipsy.$tip.is( ':visible' ) ) {
    Severity: Minor
    Found in view/resources/jquery/wikibase/jquery.wikibase.wbtooltip.js - About 1 hr to fix

      Function _create has 43 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

              _create: function () {
                  var self = this,
                      widgetName = this.widgetName,
                      $menu = this._buildMenu().appendTo( document.body ).hide();
      
      

        Method getRevisionHeader has 43 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public function getRevisionHeader( RevisionRecord $rev, $complete = '' ) {
                //NOTE: This must be kept in sync with the parent implementation.
                //      Perhaps some parts could be factored out to reduce code duplication.
        
                $lang = $this->getLanguage();
        Severity: Minor
        Found in repo/includes/Diff/EntityContentDiffView.php - About 1 hr to fix

          Method createOrUpdate has 43 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              private function createOrUpdate(
                  EntityDocument $entity,
                  EditMetadata $editMetadata,
                  int $newOrUpdateFlag
              ): EntityRevision {
          Severity: Minor
          Found in repo/rest-api/src/Infrastructure/DataAccess/EntityUpdater.php - About 1 hr to fix

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

                public function validateAndDeserialize( ItemLabelEditRequest $request ): Term {
                    $item = $this->itemRetriever->getItemWriteModel( new ItemId( $request->getItemId() ) );
                    $language = $request->getLanguageCode();
                    $label = $request->getLabel();
            
            

              Method insertNonExistingRecords has 43 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  private function insertNonExistingRecords(
                      array $records,
                      ?callable $recordsToInsertDecoratorCallback = null
                  ): array {
                      if ( !$records ) {

                Function makeLocalContext has 42 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                function makeLocalContext (store, namespace, path) {
                  var noNamespace = namespace === '';
                
                  var local = {
                    dispatch: noNamespace ? store.dispatch : function (_type, _payload, _options) {
                Severity: Minor
                Found in view/lib/wikibase-tainted-ref/dist/tainted-ref.common.js - About 1 hr to fix

                  Method visualizeClaimChange has 42 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      public function visualizeClaimChange(
                          ClaimDifference $claimDifference,
                          Statement $baseStatement,
                          array $path = []
                      ) {
                  Severity: Minor
                  Found in repo/includes/Diff/ClaimDifferenceVisualizer.php - About 1 hr to fix

                    Method getEntitySerializationWithMetaData has 42 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        private function getEntitySerializationWithMetaData( array $serialization ) {
                            $serializeEmptyListsAsObjects = WikibaseRepo::getSettings()->getSetting( 'tmpSerializeEmptyListsAsObjects' );
                            $modifications = [];
                    
                            $makeIdKvpCallback = $this->callbackFactory->getCallbackToSetArrayType( 'kvp', 'id' );
                    Severity: Minor
                    Found in repo/includes/Api/ResultBuilder.php - About 1 hr to fix

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

                          protected function getAllowedParams(): array {
                              return [
                                  'search' => [
                                      ParamValidator::PARAM_TYPE => 'string',
                                      ParamValidator::PARAM_REQUIRED => true,
                      Severity: Minor
                      Found in repo/includes/Api/SearchEntities.php - About 1 hr to fix

                        Method addSiteLinks has 42 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            public function addSiteLinks( Item $item ) {
                                $id = $item->getId();
                                $entityLName = $this->vocabulary->getEntityLName( $id );
                                $entityRepoName = $this->vocabulary->getEntityRepositoryName( $id );
                        
                        
                        Severity: Minor
                        Found in repo/includes/Rdf/SiteLinksRdfBuilder.php - About 1 hr to fix

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

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

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

                                public function validateAndDeserialize( ItemDescriptionEditRequest $request ): Term {
                                    $item = $this->itemRetriever->getItemWriteModel( new ItemId( $request->getItemId() ) );
                                    $language = $request->getLanguageCode();
                                    $description = $request->getDescription();
                            
                            

                              Method validateModifiedStatements has 42 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                  public function validateModifiedStatements(
                                      array $originalSerialization,
                                      StatementList $originalStatements,
                                      array $serialization,
                                      string $basePath = ''
                              Severity: Minor
                              Found in repo/rest-api/src/Application/Validation/StatementsValidator.php - About 1 hr to fix

                                Consider simplifying this complex logical expression.
                                Open

                                        if ( !isset( $matches['year'] )
                                            || ( isset( $matches['day'] ) && !isset( $matches['month'] ) )
                                            || ( isset( $matches['hour'] ) && !isset( $matches['day'] ) )
                                            || ( isset( $matches['minute'] ) && !isset( $matches['hour'] ) )
                                            || ( isset( $matches['second'] ) && !isset( $matches['minute'] ) )
                                Severity: Critical
                                Found in repo/includes/Parsers/DateFormatParser.php - About 1 hr to fix

                                  Function _combineResults has 41 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                          _combineResults: function ( hookResults, searchResults ) {
                                              var self = this,
                                                  deferred = $.Deferred(),
                                                  ids = {},
                                                  result = [],
                                  Severity: Minor
                                  Found in view/resources/jquery/wikibase/jquery.wikibase.entityselector.js - About 1 hr to fix

                                    Method showConfirmationForm has 41 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                        private function showConfirmationForm( int $autoSummaryLength, int $undidRevision = 0 ): void {
                                            $req = $this->getRequest();
                                    
                                            $args = [
                                                'action' => 'submit',
                                    Severity: Minor
                                    Found in repo/includes/Actions/EditEntityAction.php - About 1 hr to fix

                                      Method switchForm has 41 lines of code (exceeds 25 allowed). Consider refactoring.
                                      Open

                                          private function switchForm( ?string $languageCode, ?string $label ): void {
                                              $formDescriptor = [
                                                  'language' => [
                                                      'name' => 'language',
                                                      'default' => $languageCode ?: '',
                                      Severity: Minor
                                      Found in repo/includes/Specials/SpecialItemDisambiguation.php - About 1 hr to fix

                                        Method attemptSaveEntity has 41 lines of code (exceeds 25 allowed). Consider refactoring.
                                        Open

                                            public function attemptSaveEntity(
                                                EntityDocument $entity,
                                                $summary,
                                                array $requestParams,
                                                IContextSource $context,
                                        Severity: Minor
                                        Found in repo/includes/Api/EntitySavingHelper.php - About 1 hr to fix
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language