Function exportExtractedData
has a Cognitive Complexity of 42 (exceeds 5 allowed). Consider refactoring. Open
protected function exportExtractedData( array $info ) {
foreach ( $info['globals'] as $key => $val ) {
// If a merge strategy is set, read it and remove it from the value
// so it doesn't accidentally end up getting set.
if ( is_array( $val ) && isset( $val[self::MERGE_STRATEGY] ) ) {
- 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 ExtensionRegistry.php
has 366 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
use Composer\Semver\Semver;
use MediaWiki\Settings\SettingsBuilder;
use MediaWiki\Shell\Shell;
ExtensionRegistry
has 28 functions (exceeds 20 allowed). Consider refactoring. Open
class ExtensionRegistry {
/**
* "requires" key that applies to MediaWiki core
*/
Method exportExtractedData
has 76 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function exportExtractedData( array $info ) {
foreach ( $info['globals'] as $key => $val ) {
// If a merge strategy is set, read it and remove it from the value
// so it doesn't accidentally end up getting set.
if ( is_array( $val ) && isset( $val[self::MERGE_STRATEGY] ) ) {
Function readFromQueue
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
public function readFromQueue( array $queue ) {
$processor = new ExtensionProcessor();
$versionChecker = $this->buildVersionChecker();
$extDependencies = [];
$warnings = false;
- 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 readFromQueue
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function readFromQueue( array $queue ) {
$processor = new ExtensionProcessor();
$versionChecker = $this->buildVersionChecker();
$extDependencies = [];
$warnings = false;
Function saveToCache
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
protected function saveToCache( BagOStuff $cache, array $data ) {
global $wgDevelopmentWarnings;
if ( $data['warnings'] && $wgDevelopmentWarnings ) {
// If warnings were shown, don't cache it
return;
- 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"