Showing 11,545 of 11,545 total issues
Function __construct
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
public function __construct( array $keys, ...$sources ) {
$this->keys = $keys;
foreach ( $keys as $key ) {
foreach ( $sources as $source ) {
if ( $source instanceof Config ) {
- 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 getPsr3MessageAndContext
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
public function getPsr3MessageAndContext( StatusValue $status ): array {
$options = [ 'lang' => 'en' ];
$errors = $status->getErrors();
if ( count( $errors ) === 1 ) {
- 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 recentChangesBlockLine
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
protected function recentChangesBlockLine( $rcObj ) {
$data = [];
$type = $rcObj->mAttribs['rc_type'];
$logType = $rcObj->mAttribs['rc_log_type'];
- 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 startElement
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
protected function startElement( $parser, $name, $attribs ) {
$this->checkpointJustWritten = false;
$this->clearOpenElement( null );
$this->lastName = $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 trackOrphanText
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
private function trackOrphanText() {
# Wait until the blob_tracking table is available in the replica DB
$dbw = $this->getPrimaryDB();
$dbr = $this->getReplicaDB();
$this->getServiceContainer()->getDBLoadBalancerFactory()->waitForReplication( [ 'timeout' => 100_000 ] );
- 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 trackRevisions
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
private function trackRevisions() {
$dbw = $this->getPrimaryDB();
$dbr = $this->getReplicaDB();
$textClause = $this->getTextClause();
- 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 showUsageStats
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
private function showUsageStats() {
$option = $this->getArg( 0 );
$ret = [];
$userOptionsLookup = $this->getServiceContainer()->getUserOptionsLookup();
- 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 execute
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
public function execute() {
$userName = $this->getOption( 'user', false );
$summary = $this->getOption( 'summary', '' );
$remove = $this->hasOption( 'remove' );
$minor = $this->hasOption( 'minor' );
- 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 GitInfo.php
has 274 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
File userOptions.php
has 274 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* Script to change users preferences on the fly.
*
* Made on an original idea by Fooey (freenode)
Function _showDatepicker
has 64 lines of code (exceeds 25 allowed). Consider refactoring. Open
_showDatepicker: function(input) {
input = input.target || input;
if (input.nodeName.toLowerCase() != 'input') // find from button/image trigger
input = $('input', input.parentNode)[0];
if ($.datepicker._isDisabledDatepicker(input) || $.datepicker._lastInput == input) // already here
Method save
has 64 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function save() {
# Permission check!
if ( $this->disabled ) {
$this->show();
return false;
Method logPotentialSessionLeakage
has 64 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function logPotentialSessionLeakage( Session $session = null ) {
$proxyLookup = MediaWikiServices::getInstance()->getProxyLookup();
$session = $session ?: self::getGlobalSession();
$suspiciousIpExpiry = $this->config->get( MainConfigNames::SuspiciousIpExpiry );
Method getData
has 64 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function getData(): array {
if ( $this->data ) {
return $this->data;
}
Method doOperationsInternal
has 64 lines of code (exceeds 25 allowed). Consider refactoring. Open
final protected function doOperationsInternal( array $ops, array $opts ) {
$status = $this->newStatus();
$fname = __METHOD__;
$mbe = $this->backends[$this->masterIndex]; // convenience
Method getInclusiveMetrics
has 64 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getInclusiveMetrics() {
if ( $this->inclusive === null ) {
$main = $this->hieraData['main()'];
$hasCpu = isset( $main['cpu'] );
$hasMu = isset( $main['mu'] );
Method onSubmit
has 64 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function onSubmit( $data ) {
if ( !$this->getRequest()->getCheck( 'wpSave' ) ) {
// Diff or preview
return false;
}
Method getTemplateData
has 64 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getTemplateData(): array {
// Optimization: Generate once.
if ( $this->cachedData ) {
return $this->cachedData;
}
Method parseTitle
has 64 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function parseTitle( $request ) {
$curid = $request->getInt( 'curid' );
$title = $request->getText( 'title' );
$ret = null;
Method extractParam
has 64 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function extractParam( $param, $format ) {
if ( is_array( $param ) ) {
if ( isset( $param['raw'] ) ) {
return [ 'after', $param['raw'] ];
} elseif ( isset( $param['num'] ) ) {