wikimedia/mediawiki-extensions-Wikibase

View on GitHub

Showing 1,432 of 2,096 total issues

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

/***/ (function(module, exports, __webpack_require__) {

"use strict";

var fails = __webpack_require__("d039");
Severity: Minor
Found in view/lib/wikibase-tainted-ref/dist/tainted-ref.common.js - About 1 hr to fix

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

        public function doQuery( array $params, ApiPageSet $resultPageSet = null ): ?IResultWrapper {
            if ( !$params['entities'] ) {
                return null;
            }
    
    
    Severity: Minor
    Found in client/includes/Api/ApiListEntityUsage.php - About 1 hr to fix

      Method getPageHeader has 30 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public function getPageHeader() {
              $excludeNamespaces = array_diff(
                  $this->namespaceInfo->getValidNamespaces(),
                  $this->namespaceChecker->getWikibaseNamespaces()
              );
      Severity: Minor
      Found in client/includes/Specials/SpecialUnconnectedPages.php - About 1 hr to fix

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

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

          Method getPagesUsing has 30 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              public function getPagesUsing( array $entityIds, array $aspects = [] ): Traversable {
                  if ( !$this->aspectsMatchImplicitUsage( $aspects ) ) {
                      // Caller is not interested in implicit usage,
                      // no need to add anything
                      return yield from $this->usageLookup->getPagesUsing( $entityIds, $aspects );
          Severity: Minor
          Found in client/includes/Usage/ImplicitDescriptionUsageLookup.php - About 1 hr to fix

            Method attemptSave has 30 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                private function attemptSave(
                    Title $title,
                    EntityContent $content,
                    string $summary,
                    int $undidRevId,
            Severity: Minor
            Found in repo/includes/Actions/SubmitEntityAction.php - About 1 hr to fix

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

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

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

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

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

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

                    Method rdfSerialize has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        private function rdfSerialize(
                            EntityRevision $entityRevision,
                            ?RedirectRevision $followedRedirect,
                            array $incomingRedirects,
                            RdfBuilder $rdfBuilder,
                    Severity: Minor
                    Found in repo/includes/LinkedData/EntityDataSerializationService.php - About 1 hr to fix

                      Method convertUnit has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          public function convertUnit( $unit, $convertUnits, $coherentUnits, $unitUsage, &$reconvert ) {
                              $unit['unit'] = substr( $unit['unit'], $this->baseLen );
                              $unit['siUnit'] = substr( $unit['siUnit'], $this->baseLen );
                      
                              if ( isset( $convertUnits[$unit['unit']] ) ) {
                      Severity: Minor
                      Found in repo/maintenance/updateUnits.php - About 1 hr to fix

                        Method processStatements has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            private function processStatements( $values, $map ) {
                                $shortValues = array_map( function ( $str ) {
                                    return 'wdv:' . $str;
                                }, $values );
                                $valuesStr = implode( ' ', $shortValues );
                        Severity: Minor
                        Found in repo/maintenance/addUnitConversions.php - About 1 hr to fix

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

                              public function execute( PatchPropertyRequest $request ): PatchPropertyResponse {
                                  $deserializedRequest = $this->validator->validateAndDeserialize( $request );
                                  $propertyId = $deserializedRequest->getPropertyId();
                                  $providedMetadata = $deserializedRequest->getEditMetadata();
                          
                          

                            Method handleDescriptionsValidationError has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                private function handleDescriptionsValidationError( ValidationError $validationError ): void {
                                    $context = $validationError->getContext();
                                    switch ( $validationError->getCode() ) {
                                        case DescriptionsSyntaxValidator::CODE_DESCRIPTIONS_NOT_ASSOCIATIVE:
                                            throw UseCaseError::newPatchResultInvalidValue(

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

                                  public function execute( PatchStatementRequest $request ): PatchStatementResponse {
                                      $deserializedRequest = $this->useCaseValidator->validateAndDeserialize( $request );
                                      $statementId = $deserializedRequest->getStatementId();
                                      $editMetadata = $deserializedRequest->getEditMetadata();
                              
                              

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

                                    public function execute() {
                                        $stripProtocols = (bool)$this->getOption( 'strip-protocols', false );
                                        $forceProtocol = $this->getOption( 'force-protocol', null );
                                        $url = $this->getOption( 'load-from', 'https://meta.wikimedia.org/w/api.php' );
                                        $scriptPath = $this->getOption( 'script-path', '/w/$1' );
                                Severity: Minor
                                Found in lib/maintenance/populateSitesTable.php - About 1 hr to fix

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

                                      function attachCopyrightTooltip( $entityview, viewName ) {
                                          var startEditingEvents = [
                                              'entitytermsviewafterstartediting',
                                              'sitelinkgroupviewafterstartediting',
                                              'statementviewafterstartediting'
                                  Severity: Minor
                                  Found in repo/resources/wikibase.ui.entityViewInit.js - About 1 hr to fix

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

                                            value: function ( value ) {
                                                if ( value !== undefined ) {
                                                    return this.option( 'value', value );
                                                }
                                    
                                    

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

                                          SELF.prototype.stopEditing = function ( dropValue ) {
                                              if ( !dropValue && !this._viewHasSavableValue() ) {
                                                  return;
                                              }
                                      
                                      
                                      Severity: Minor
                                      Found in view/resources/wikibase/view/ToolbarViewController.js - About 1 hr to fix

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

                                                _createHelperTag: function () {
                                                    var $tag = this.createTag( '', '', true ),
                                                        input = $tag.find( 'input' );
                                        
                                                    // Add placeholder and auto-expand afterwards:
                                        Severity: Minor
                                        Found in view/resources/jquery/ui/jquery.ui.tagadata.js - About 1 hr to fix
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language