Function __set
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public function __set( $name, $value ) {
if ( isset( self::$deprecatedPublicProperties[$name] ) ) {
[ $version, $class, $component, , $setter ] = self::$deprecatedPublicProperties[$name];
$qualifiedName = $class . '::$' . $name;
wfDeprecated( $qualifiedName, $version, $component, 2 );
- 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 deprecatePublicPropertyFallback
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
string $property,
string $version,
$getter,
$setter = null,
$class = null,
Function __isset
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function __isset( $name ) {
// Overriding magic __isset is required not only for isset() and empty(),
// but to correctly support null coalescing for dynamic properties,
// e.g. $foo->bar ?? 'default'
if ( isset( self::$deprecatedPublicProperties[$name] ) ) {
- 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 deprecationHelperGetPropertyOwner
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
private function deprecationHelperGetPropertyOwner( $property ) {
// Returning false is a non-error path and should avoid slow checks like reflection.
// Use array cast hack instead.
$obfuscatedProps = array_keys( (array)$this );
$obfuscatedPropTail = "\0$property";
- 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 __get
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function __get( $name ) {
if ( isset( self::$deprecatedPublicProperties[$name] ) ) {
[ $version, $class, $component, $getter ] = self::$deprecatedPublicProperties[$name];
$qualifiedName = $class . '::$' . $name;
wfDeprecated( $qualifiedName, $version, $component, 2 );
- 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"