wikimedia/mediawiki-extensions-Wikibase

View on GitHub

Showing 1,432 of 2,096 total issues

Method getSiteLinkAddRemoveParams has 29 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    private function getSiteLinkAddRemoveParams( DiffOp $diffOp, $action, $siteId, Title $title = null ) {
        $params = [];

        if ( in_array( $action, [ 'remove', 'restore' ] ) ) {
            // Messages: wikibase-comment-remove, wikibase-comment-restore
Severity: Minor
Found in client/includes/RecentChanges/SiteLinkCommentCreator.php - About 1 hr to fix

    Function commit has 29 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    Store.prototype.commit = function commit (_type, _payload, _options) {
        var this$1$1 = this;
    
      // check object-style commit
      var ref = unifyObjectStyle(_type, _payload, _options);
    Severity: Minor
    Found in view/lib/wikibase-tainted-ref/dist/tainted-ref.common.js - About 1 hr to fix

      Method getRecentChangeId has 29 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public function getRecentChangeId( RecentChange $change ) {
              $attribs = $change->getAttributes();
      
              //XXX: need to check master?
              $db = $this->connectionManager->getReadConnection();
      Severity: Minor
      Found in client/includes/RecentChanges/RecentChangesFinder.php - About 1 hr to fix

        Function ddb0 has 29 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        /***/ (function(module, exports, __webpack_require__) {
        
        var global = __webpack_require__("da84");
        var DOMIterables = __webpack_require__("fdbc");
        var ArrayIteratorMethods = __webpack_require__("e260");
        Severity: Minor
        Found in view/lib/wikibase-tainted-ref/dist/tainted-ref.common.js - About 1 hr to fix

          Function main has 29 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          async function main() {
              const client = new ApolloClient( {
                  uri: 'https://api.github.com/graphql',
                  request: ( operation ) => {
                      operation.setContext( {
          Severity: Minor
          Found in build/dist-size/analyze/index.js - About 1 hr to fix

            Function buildSizeDeltaAnnotation has 29 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            function buildSizeDeltaAnnotation( revision ) {
                if ( revision[ CUSTOM_FIELDS.PREVIOUS_SIZE ] === null || revision[ FIELDS.SIZE ] === null ) {
                    // inception & removal may be a notable but not with respect to size
                    return null;
                }
            Severity: Minor
            Found in build/dist-size/web/lib/main.js - About 1 hr to fix

              Method newRendererFromParser has 29 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  public function newRendererFromParser(
                      Parser $parser,
                      string $type = DataAccessSnakFormatterFactory::TYPE_ESCAPED_PLAINTEXT
                  ): StatementGroupRenderer {
                      $usageAccumulator = $this->usageAccumulatorFactory->newFromParser( $parser );

                Method getSecondaryLinks has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    public function getSecondaryLinks() {
                        $ret = [];
                
                        if ( $this->getBundleCount( true, [ $this, 'callbackForBundleCount' ] ) === 1 ) {
                            $ret[] = $this->getAgentLink();
                Severity: Minor
                Found in client/includes/Notifications/PageConnectionPresentationModel.php - About 1 hr to fix

                  Method fetchIds has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      public function fetchIds( $limit ) {
                          Assert::parameter( is_int( $limit ) && $limit > 0, '$limit', '$limit must be a positive integer' );
                  
                          $dbr = $this->db->connections()->getReadConnection();
                          $queryBuilder = $dbr->newSelectQueryBuilder();
                  Severity: Minor
                  Found in repo/includes/Store/Sql/SqlEntityIdPager.php - About 1 hr to fix

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

                        public function execute( $subPage ) {
                            parent::execute( $subPage );
                    
                            $this->checkPermissions();
                            $this->checkBlocked();
                    Severity: Minor
                    Found in repo/includes/Specials/SpecialMergeItems.php - About 1 hr to fix

                      Method applyChangeOp has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          protected function applyChangeOp( ChangeOp $changeOp, EntityDocument $entity, Summary $summary = null ): ChangeOpResult {
                              try {
                                  // NOTE: Always validate modification against the current revision, if it exists!
                                  //       Otherwise, we may miss e.g. a combination of language/label/description
                                  //       that was already taken.
                      Severity: Minor
                      Found in repo/includes/Api/ModifyEntity.php - About 1 hr to fix

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

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

                          Method getAllowedParams has 29 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/QuerySearchEntities.php - About 1 hr to fix

                            Method onPageHistoryLineEnding has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                public static function onPageHistoryLineEnding( HistoryPager $history, $row, &$html, array $classes ) {
                                    // Note: This assumes that HistoryPager::getTitle returns a Title.
                                    $entityContentFactory = WikibaseRepo::getEntityContentFactory();
                                    $services = MediaWikiServices::getInstance();
                            
                            
                            Severity: Minor
                            Found in repo/includes/RepoHooks.php - About 1 hr to fix

                              Method httpContentNegotiation has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                  public function httpContentNegotiation( WebRequest $request, OutputPage $output, EntityId $id, $revision = 0 ) {
                                      $headers = $request->getAllHeaders();
                                      if ( isset( $headers['ACCEPT'] ) ) {
                                          $parser = new HttpAcceptParser();
                                          $accept = $parser->parseWeights( $headers['ACCEPT'] );
                              Severity: Minor
                              Found in repo/includes/LinkedData/EntityDataRequestHandler.php - About 1 hr to fix

                                Method cleanupGregorianValue has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                    protected function cleanupGregorianValue( $dateValue, $precision ) {
                                        try {
                                            [ $minus, $y, $m, $d, $time ] = $this->parseDateValue( $dateValue );
                                        } catch ( IllegalValueException $e ) {
                                            return null;
                                Severity: Minor
                                Found in repo/includes/Rdf/DateTimeValueCleaner.php - About 1 hr to fix

                                  Method newEditEntity has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                      public function newEditEntity(
                                          IContextSource $context,
                                          EntityId $entityId = null,
                                          int $baseRevId = 0,
                                          $allowMasterConnection = true
                                  Severity: Minor
                                  Found in repo/includes/EditEntity/MediaWikiEditEntityFactory.php - About 1 hr to fix

                                    Method execute has 29 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" );
                                            }
                                            if ( !in_array( Property::ENTITY_TYPE, WikibaseRepo::getLocalEntitySource()->getEntityTypes() ) ) {
                                    Severity: Minor
                                    Found in repo/maintenance/changePropertyDataType.php - About 1 hr to fix

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

                                          public function execute( PatchSitelinksRequest $request ): PatchSitelinksResponse {
                                              $deserializedRequest = $this->useCaseValidator->validateAndDeserialize( $request );
                                              $itemId = $deserializedRequest->getItemId();
                                      
                                              $this->assertItemExists->execute( $itemId );

                                        Method newItemView has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                                        Open

                                            public function newItemView(
                                                Language $language,
                                                TermLanguageFallbackChain $termFallbackChain,
                                                CacheableEntityTermsView $entityTermsView
                                            ) {
                                        Severity: Minor
                                        Found in view/src/ViewFactory.php - About 1 hr to fix
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language