wikimedia/mediawiki-extensions-Wikibase

View on GitHub
repo/includes/Api/SetReference.php

Summary

Maintainability
C
1 day
Test Coverage

File SetReference.php has 260 lines of code (exceeds 250 allowed). Consider refactoring.
Open

<?php

declare( strict_types = 1 );

namespace Wikibase\Repo\Api;
Severity: Minor
Found in repo/includes/Api/SetReference.php - About 2 hrs to fix

    Method __construct has 12 arguments (exceeds 4 allowed). Consider refactoring.
    Open

            ApiMain $mainModule,
            string $moduleName,
            DeserializerFactory $deserializerFactory,
            ApiErrorReporter $errorReporter,
            StatementChangeOpFactory $statementChangeOpFactory,
    Severity: Major
    Found in repo/includes/Api/SetReference.php - About 1 hr to fix

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

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

        Method factory has 11 arguments (exceeds 4 allowed). Consider refactoring.
        Open

                ApiMain $mainModule,
                string $moduleName,
                ApiHelperFactory $apiHelperFactory,
                DeserializerFactory $deserializerFactory,
                ChangeOpFactoryProvider $changeOpFactoryProvider,
        Severity: Major
        Found in repo/includes/Api/SetReference.php - About 1 hr to fix

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

              public function execute(): void {
                  $params = $this->extractRequestParams();
                  $this->validateParameters( $params );
          
                  $entityId = $this->guidParser->parse( $params['statement'] )->getEntityId();
          Severity: Minor
          Found in repo/includes/Api/SetReference.php - About 1 hr to fix

            Method applyChangeOpAndReturnChangedReference has 5 arguments (exceeds 4 allowed). Consider refactoring.
            Open

                    ChangeOp $changeOp,
                    EntityDocument $entity,
                    Summary $summary,
                    Statement $statement,
                    Reference $newReference
            Severity: Minor
            Found in repo/includes/Api/SetReference.php - About 35 mins to fix

              There are no issues that match your filters.

              Category
              Status