Function execute
has a Cognitive Complexity of 39 (exceeds 5 allowed). Consider refactoring. Open
public function execute() {
// Extensions will do stuff like $wgResourceModules += array(...) which is a
// fatal unless an array is already set. So set an empty value.
// And use the weird $__settings name to avoid any conflicts
// with real poorly named settings.
- 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 execute
has 88 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function execute() {
// Extensions will do stuff like $wgResourceModules += array(...) which is a
// fatal unless an array is already set. So set an empty value.
// And use the weird $__settings name to avoid any conflicts
// with real poorly named settings.
Function handleResourceModules
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
protected function handleResourceModules( $realName, $value ) {
$defaults = [];
$remote = $this->hasOption( 'skin' ) ? 'remoteSkinPath' : 'remoteExtPath';
foreach ( $value as $name => $data ) {
if ( isset( $data['localBasePath'] ) ) {
- 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
File convertExtensionToRegistration.php
has 279 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
use Wikimedia\Composer\ComposerJson;
require_once __DIR__ . '/Maintenance.php';
Function handleHooks
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
public function handleHooks( $realName, $value ) {
foreach ( $value as $hookName => &$handlers ) {
if ( $hookName === 'UnitTestsList' ) {
$this->output( "Note: the UnitTestsList hook is no longer necessary as " .
"long as your tests are located in the \"tests/phpunit/\" directory. " .
- 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 handleResourceModules
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function handleResourceModules( $realName, $value ) {
$defaults = [];
$remote = $this->hasOption( 'skin' ) ? 'remoteSkinPath' : 'remoteExtPath';
foreach ( $value as $name => $data ) {
if ( isset( $data['localBasePath'] ) ) {