Showing 11,545 of 11,545 total issues
Function submit
has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring. Open
public function submit() {
$this->parent->setVarsFromRequest( [ '_RightsProfile', '_LicenseCode',
'wgEnableEmail', 'wgPasswordSender', 'wgEnableUploads',
'_Logo1x', '_LogoWordmark', '_LogoTagline', '_LogoIcon',
'wgEnableUserEmail', 'wgEnotifUserTalk', 'wgEnotifWatchlist',
- 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 25 (exceeds 5 allowed). Consider refactoring. Open
public function execute() {
$pages = $this->getPageSet()->getGoodPages();
if ( $pages === [] ) {
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"
Further reading
Function handleCORS
has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring. Open
protected function handleCORS() {
$originParam = $this->getParameter( 'origin' ); // defaults to null
if ( $originParam === null ) {
// No origin parameter, nothing to do
return true;
- 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 25 (exceeds 5 allowed). Consider refactoring. Open
public function execute( $par ) {
$user = $this->getUser();
$request = $this->getRequest();
$session = $request->getSession();
$out = $this->getOutput();
- 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 fetchUser
has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring. Open
public function fetchUser( $username, $writing = true ) {
$parts = explode( $this->getConfig()->get( MainConfigNames::UserrightsInterwikiDelimiter ),
$username );
if ( count( $parts ) < 2 ) {
$name = trim( $username );
- 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 findFile
has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring. Open
public function findFile( $title, $options = [] ) {
if ( !empty( $options['private'] ) && !( $options['private'] instanceof Authority ) ) {
throw new InvalidArgumentException(
__METHOD__ . ' called with the `private` option set to something ' .
'other than an Authority object'
- 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 initInternal
has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring. Open
private function initInternal(
PageIdentity $page,
$body,
array $parameters,
?RevisionRecord $originalRevision = 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"
Further reading
Function doCategoryQuery
has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring. Open
protected function doCategoryQuery() {
$dbr = MediaWikiServices::getInstance()->getConnectionProvider()->getReplicaDatabase();
$this->nextPage = [
'page' => 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"
Further reading
Function specialSearch
has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring. Open
protected function specialSearch( $search, $limit, $offset ) {
$searchParts = explode( '/', $search, 2 );
$searchKey = $searchParts[0];
$subpageSearch = $searchParts[1] ?? 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"
Further reading
Function filter
has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring. Open
public static function filter( $source ) {
$tokens = token_get_all( $source );
$buffer = null;
$output = '';
foreach ( $tokens as $token ) {
- 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 25 (exceeds 5 allowed). Consider refactoring. Open
public function execute() {
global $wgLang, $wgAllowSchemaUpdates;
if ( !$wgAllowSchemaUpdates
&& !( $this->hasOption( 'force' )
- 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 25 (exceeds 5 allowed). Consider refactoring. Open
public function execute() {
if ( $this->hasOption( 'procs' ) ) {
$procs = intval( $this->getOption( 'procs' ) );
if ( $procs < 1 || $procs > 1000 ) {
$this->fatalError( "Invalid argument to --procs" );
- 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 25 (exceeds 5 allowed). Consider refactoring. Open
public function execute() {
$dbName = $this->getOption( 'wikidb', false );
$lbf = $this->getServiceContainer()->getDBLoadBalancerFactory();
// Pick LB
- 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 25 (exceeds 5 allowed). Consider refactoring. Open
public function execute() {
global $IP, $wgLocalDatabases;
$username = wfMessage( 'spambot_username' )->text();
$user = User::newSystemUser( $username );
- 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 showPreview
has 89 lines of code (exceeds 25 allowed). Consider refactoring. Open
function showPreview( file ) {
let $canvas,
ctx,
meta,
previewSize = 180,
Function watchstar
has 89 lines of code (exceeds 25 allowed). Consider refactoring. Open
function watchstar( $links, title, callback ) {
// Set up the ARIA connection between the watch link and the notification.
// This is set outside the click handler so that it's already present when the user clicks.
const notificationId = 'mw-watchlink-notification';
const mwTitle = mw.Title.newFromText( title );
Function wrapMethod
has 89 lines of code (exceeds 25 allowed). Consider refactoring. Open
sinon.wrapMethod = function wrapMethod(object, property, method) {
if (!object) {
throw new TypeError("Should wrap property of object");
}
File Session.php
has 315 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* MediaWiki session
*
* This program is free software; you can redistribute it and/or modify
Method undeleteUnsafe
has 89 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function undeleteUnsafe( string $comment ): StatusValue {
$hookStatus = $this->runPreUndeleteHook( $comment );
if ( !$hookStatus->isGood() ) {
return $hookStatus;
}
Method beginAuthentication
has 89 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function beginAuthentication( array $reqs, $returnToUrl ) {
$session = $this->request->getSession();
if ( !$session->canSetUser() ) {
// Caller should have called canAuthenticateNow()
$session->remove( self::AUTHN_STATE );