wikimedia/mediawiki-core

View on GitHub
includes/Rest/Handler/UpdateHandler.php

Summary

Maintainability
B
4 hrs
Test Coverage

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

    private function getConflictData() {
        $body = $this->getValidatedBody();
        '@phan-var array $body';
        $baseRevId = $body['latest']['id'] ?? 0;
        $title = $this->titleParser->parseTitle( $this->getValidatedParams()['title'] );
Severity: Minor
Found in includes/Rest/Handler/UpdateHandler.php - About 1 hr to fix

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

        public function getParamSettings() {
            return [
                'title' => [
                    self::PARAM_SOURCE => 'path',
                    ParamValidator::PARAM_TYPE => 'string',
    Severity: Minor
    Found in includes/Rest/Handler/UpdateHandler.php - About 1 hr to fix

      Method getActionModuleParameters has 28 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          protected function getActionModuleParameters() {
              $body = $this->getValidatedBody();
              '@phan-var array $body';
      
              $title = $this->getTitleParameter();
      Severity: Minor
      Found in includes/Rest/Handler/UpdateHandler.php - About 1 hr to fix

        Avoid too many return statements within this method.
        Open

                return [
                    'base' => $baseRev->getId(),
                    'current' => $currentRev->getId(),
                    'local' => $localDiff,
                    'remote' => $remoteDiff,
        Severity: Major
        Found in includes/Rest/Handler/UpdateHandler.php - About 30 mins to fix

          There are no issues that match your filters.

          Category
          Status