Showing 11,461 of 11,461 total issues
Function match
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function match( $path ) {
$parts = explode( '/', $path );
$length = count( $parts );
if ( !isset( $this->treesByLength[$length] ) ) {
return 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
Function run
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
private static function run( DeferrableUpdate $update ): ?Throwable {
$logger = LoggerFactory::getInstance( 'DeferredUpdates' );
$type = get_class( $update )
. ( $update instanceof DeferrableCallback ? '_' . $update->getOrigin() : '' );
- 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 doWrites
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
protected function doWrites() {
$db = $this->getDB();
$table = $this->getTableName();
$domainId = $db->getDomainID();
$batchSize = $this->getBatchSize();
- 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 applyCacheControl
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function applyCacheControl( ResponseInterface $response ) {
// NOTE: keep this consistent with the logic in OutputPage::sendCacheControl
// If the response sets cookies, it must not be cached in proxies.
// If there's an active cookie-based session (logged-in user or anonymous user with
- 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 seek
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function seek( $offset, $whence = SEEK_SET ) {
switch ( $whence ) {
case SEEK_SET:
$this->offset = $offset;
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
Function getHandler
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function getHandler( $name ) {
if ( !isset( $this->singletons['handlers'][$name] ) ) {
$spec = $this->config['handlers'][$name];
/** @var HandlerInterface $handler */
$handler = ObjectFactory::getObjectFromSpec( $spec );
- 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 parseBodyData
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function parseBodyData( RequestInterface $request ): ?array {
// Parse the body based on its content type
$contentType = $request->getBodyType();
// HACK: If the Handler uses a custom BodyValidator, the
- 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 tryOpportunisticExecute
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public static function tryOpportunisticExecute(): bool {
// Leave execution up to the current loop if an update is already in progress
// or if updates are explicitly disabled
if ( self::getRecursiveExecutionStackDepth()
|| self::$preventOpportunisticUpdates
- 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 loadAndLazyInit
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
protected static function loadAndLazyInit() {
$config = MediaWikiServices::getInstance()->getMainConfig();
$lb = self::getLB();
$dbr = $lb->getConnection( DB_REPLICA );
- 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 getIndexedUrlsNonReversed
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public static function getIndexedUrlsNonReversed( $urls ) {
$newLinks = [];
foreach ( $urls as $url ) {
$indexes = self::makeIndexes( $url, false );
if ( !$indexes ) {
- 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 tidy
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function tidy( $text, ?callable $textProcessor = null ) {
$traceCallback = static function ( $msg ) {
wfDebug( "RemexHtml: $msg" );
};
$formatter = new RemexCompatFormatter( [ 'textProcessor' => $textProcessor ] );
- 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 reverseDomain
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
private static function reverseDomain( $domain ) {
if ( substr( $domain, 0, 3 ) === 'V6.' ) {
$ipv6 = str_replace( '.', ':', trim( substr( $domain, 3 ), '.' ) );
if ( IPUtils::isValid( $ipv6 ) ) {
return '[' . $ipv6 . ']';
- 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 fillParserOutput
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
protected function fillParserOutput(
Content $content,
ContentParseParams $cpoParams,
ParserOutput &$output
) {
- 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 siteFromDB
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function siteFromDB( $wiki ) {
// Allow override
$def = $this->getWikiParams( $wiki );
if ( $def['suffix'] !== null && $def['lang'] !== null ) {
return [ $def['suffix'], $def['lang'] ];
- 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 checkPasswordCannotMatchDefaults
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public static function checkPasswordCannotMatchDefaults( $policyVal, UserIdentity $user, $password ) {
static $blockedLogins = [
// r75589
'Useruser' => 'Passpass',
'Useruser1' => 'Passpass1',
- 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 makeRedirectContent
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function makeRedirectContent( Title $destination, $text = '' ) {
$optionalColon = '';
if ( $destination->getNamespace() === NS_CATEGORY ) {
$optionalColon = ':';
- 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 crypt
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function crypt( string $password ): void {
$lastHash = $password;
foreach ( $this->config['types'] as $i => $type ) {
// Construct pseudo-hash based on params and arguments
/** @var ParameterizedPassword $passObj */
- 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 parseHash
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
protected function parseHash( ?string $hash ): void {
parent::parseHash( $hash );
if ( $hash === null ) {
$this->params = $this->getDefaultParams();
- 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 getDataForSearchIndex
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function getDataForSearchIndex(
WikiPage $page,
ParserOutput $parserOutput,
SearchEngine $engine,
?RevisionRecord $revision = null
- 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"