wikimedia/mediawiki-core

View on GitHub
includes/api/ApiQueryAllPages.php

Summary

Maintainability
D
2 days
Test Coverage

Function run has a Cognitive Complexity of 60 (exceeds 5 allowed). Consider refactoring.
Open

    private function run( $resultPageSet = null ) {
        $db = $this->getDB();

        $params = $this->extractRequestParams();

Severity: Minor
Found in includes/api/ApiQueryAllPages.php - About 1 day 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 run has 157 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    private function run( $resultPageSet = null ) {
        $db = $this->getDB();

        $params = $this->extractRequestParams();

Severity: Major
Found in includes/api/ApiQueryAllPages.php - About 6 hrs to fix

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

        public function getAllowedParams() {
            $ret = [
                'from' => null,
                'continue' => [
                    ApiBase::PARAM_HELP_MSG => 'api-help-param-continue',
    Severity: Major
    Found in includes/api/ApiQueryAllPages.php - About 3 hrs to fix

      File ApiQueryAllPages.php has 292 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      <?php
      /**
       * Copyright © 2006 Yuri Astrakhan "<Firstname><Lastname>@gmail.com"
       *
       * This program is free software; you can redistribute it and/or modify
      Severity: Minor
      Found in includes/api/ApiQueryAllPages.php - About 3 hrs to fix

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

                ApiQuery $query,
                $moduleName,
                NamespaceInfo $namespaceInfo,
                GenderCache $genderCache,
                RestrictionStore $restrictionStore
        Severity: Minor
        Found in includes/api/ApiQueryAllPages.php - About 35 mins to fix

          There are no issues that match your filters.

          Category
          Status