wikimedia/mediawiki-core

View on GitHub
includes/api/ApiEditPage.php

Summary

Maintainability
F
6 days
Test Coverage

Function execute has a Cognitive Complexity of 144 (exceeds 5 allowed). Consider refactoring.
Open

    public function execute() {
        $this->useTransactionalTimeLimit();

        $user = $this->getUser();
        $params = $this->extractRequestParams();
Severity: Minor
Found in includes/api/ApiEditPage.php - About 2 days to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

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

    public function execute() {
        $this->useTransactionalTimeLimit();

        $user = $this->getUser();
        $params = $this->extractRequestParams();
Severity: Major
Found in includes/api/ApiEditPage.php - About 2 days to fix

    File ApiEditPage.php has 585 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    <?php
    /**
     * Copyright © 2007 Iker Labarga "<Firstname><Lastname>@gmail.com"
     *
     * This program is free software; you can redistribute it and/or modify
    Severity: Major
    Found in includes/api/ApiEditPage.php - About 1 day to fix

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

          public function getAllowedParams() {
              $params = [
                  'title' => [
                      ParamValidator::PARAM_TYPE => 'string',
                  ],
      Severity: Major
      Found in includes/api/ApiEditPage.php - About 3 hrs to fix

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

                ApiMain $mainModule,
                $moduleName,
                IContentHandlerFactory $contentHandlerFactory = null,
                RevisionLookup $revisionLookup = null,
                WatchedItemStoreInterface $watchedItemStore = null,
        Severity: Major
        Found in includes/api/ApiEditPage.php - About 1 hr to fix

          There are no issues that match your filters.

          Category
          Status