Function execute
has a Cognitive Complexity of 58 (exceeds 5 allowed). Consider refactoring. Open
public function execute() {
// Get parameters
$params = $this->extractRequestParams();
$this->helpFormat = $params['helpformat'];
- Read upRead up
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
Function getModuleInfo
has a Cognitive Complexity of 47 (exceeds 5 allowed). Consider refactoring. Open
private function getModuleInfo( $module ) {
$ret = [];
$path = $module->getModulePath();
$paramValidator = $module->getMain()->getParamValidator();
- Read upRead up
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 getModuleInfo
has 131 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function getModuleInfo( $module ) {
$ret = [];
$path = $module->getModulePath();
$paramValidator = $module->getMain()->getParamValidator();
File ApiParamInfo.php
has 363 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* Copyright © 2008 Roan Kattouw <roan.kattouw@gmail.com>
*
* This program is free software; you can redistribute it and/or modify
Method execute
has 104 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function execute() {
// Get parameters
$params = $this->extractRequestParams();
$this->helpFormat = $params['helpformat'];
Method formatHelpMessages
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function formatHelpMessages( array &$res, $key, array $msgs, $joinLists = false ) {
switch ( $this->helpFormat ) {
case 'none':
break;
Function formatHelpMessages
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
protected function formatHelpMessages( array &$res, $key, array $msgs, $joinLists = false ) {
switch ( $this->helpFormat ) {
case 'none':
break;
- Read upRead up
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 getAllowedParams
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getAllowedParams() {
// back compat
$querymodules = $this->getMain()->getModuleManager()
->getModule( 'query' )->getModuleManager()->getNames();
sort( $querymodules );
Function listAllSubmodules
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
private function listAllSubmodules( ApiBase $module, $recursive ) {
$paths = [];
$manager = $module->getModuleManager();
if ( $manager ) {
$names = $manager->getNames();
- Read upRead up
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"