Showing 11,545 of 11,545 total issues
Function doConcatenate
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
protected function doConcatenate( array $params ) {
$status = $this->newStatus();
$tmpPath = $params['dst'];
unset( $params['latest'] );
- 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 doStoreInternal
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
protected function doStoreInternal( array $params ) {
$status = $this->newStatus();
$fsSrcPath = $params['src']; // file system path
$fsDstPath = $this->resolveToFSPath( $params['dst'] );
- 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 startAtomic
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
final public function startAtomic(
$fname = __METHOD__,
$cancelable = self::ATOMIC_NOT_CANCELABLE
) {
$cs = $this->commenceCriticalSection( __METHOD__ );
- 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 validate
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
private function validate( $reader ) {
// First, move through anything that isn't an element, and
// handle any processing instructions with the callback
do {
if ( !$this->readNext( $reader ) ) {
- 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 factorCondsWithCommonFields
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
private function factorCondsWithCommonFields( $condsArray ) {
$first = $condsArray[array_key_first( $condsArray )];
if ( count( $first ) === 1 ) {
// IN clause
$field = array_key_first( $first );
- 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 approvePrimaryChanges
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
public function approvePrimaryChanges( int $maxWriteDuration, $fname = __METHOD__ ) {
$this->assertTransactionRoundStage( self::ROUND_FINALIZED );
/** @noinspection PhpUnusedLocalVariableInspection */
$scope = ScopedCallback::newScopedIgnoreUserAbort();
- 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 pickReaderIndex
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
private function pickReaderIndex( array $loads ) {
if ( $loads === [] ) {
throw new InvalidArgumentException( "Server configuration array is empty" );
}
- 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 buildContentActionUrls
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
private function buildContentActionUrls( $content_navigation ) {
// content_actions has been replaced with content_navigation for backwards
// compatibility and also for skins that just want simple tabs content_actions
// is now built by flattening the content_navigation arrays into one
- 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 loadFromRow
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
public function loadFromRow( $row ) {
if ( $row ) { // page found
if ( isset( $row->page_id ) ) {
$this->mArticleID = (int)$row->page_id;
}
- 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 getNewRevision
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
private function getNewRevision() {
$undoRev = $this->revisionLookup->getRevisionById( $this->undo );
$oldRev = $this->revisionLookup->getRevisionById( $this->undoafter );
$curRev = $this->curRev;
- 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 getUndeleteLink
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
public function getUndeleteLink() {
$action = $this->getRequest()->getRawVal( 'action', 'view' );
$title = $this->getTitle();
$linkRenderer = MediaWikiServices::getInstance()->getLinkRenderer();
- 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 getPersonalToolsForMakeListItem
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
final public function getPersonalToolsForMakeListItem( $urls, $applyClassesToListItems = false ) {
$personal_tools = [];
foreach ( $urls as $key => $plink ) {
# The class on a personal_urls item is meant to go on the <a> instead
# of the <li> so we have to use a single item "links" array instead
- 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 readCentralDirectory
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
private function readCentralDirectory( $offset, $size ) {
$block = $this->getBlock( $offset, $size );
$fixedInfo = [
'signature' => [ 'string', 4 ],
- 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 __construct
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
public function __construct( $repoDir, $usePrecomputed = true ) {
$this->repoDir = $repoDir;
$services = MediaWikiServices::getInstance();
$this->options = new ServiceOptions(
self::CONSTRUCTOR_OPTIONS, $services->getMainConfig()
- 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 getFinalUrl
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
public function getFinalUrl() {
$headers = $this->getResponseHeaders();
// return full url (fix for incorrect but handled relative location)
if ( isset( $headers['location'] ) ) {
- 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 assemble
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
public static function assemble( array $urlParts ): string {
$result = '';
if ( isset( $urlParts['delimiter'] ) ) {
if ( isset( $urlParts['scheme'] ) ) {
- 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 convertGrammar
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
public function convertGrammar( $word, $case ) {
$grammarForms = $this->config->get( MainConfigNames::GrammarForms );
if ( isset( $grammarForms[$this->getCode()][$case][$word] ) ) {
return $grammarForms[$this->getCode()][$case][$word];
}
- 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 recursiveConvertRule
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
protected function recursiveConvertRule( $text, $variant, &$startPos, $depth = 0 ) {
// Quick check (no function calls)
if ( $text[$startPos] !== '-' || $text[$startPos + 1] !== '{' ) {
throw new InvalidArgumentException( __METHOD__ . ': invalid input string' );
}
- 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 localizeElement
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
private function localizeElement( Element $node, Bcp47Code $lang, Document $doc ) {
if ( DOMUtils::hasTypeOf( $node, 'mw:LocalizedAttrs' ) ) {
$i18nNames = DOMDataUtils::getDataAttrI18nNames( $node );
if ( count( $i18nNames ) === 0 ) {
$this->logger->warning( 'node with mw:LocalizedAttrs typeof does not contain localisation data',
- 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 validate
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
private function validate( $section, $tag, $val, $recursive = false ): bool {
$debug = "tag is '$tag'";
$etype = $this->mExifTags[$section][$tag];
$ecount = 1;
if ( is_array( $etype ) ) {
- 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"