Showing 11,545 of 11,545 total issues
Function view
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
public function view() {
$context = $this->getContext();
$useFileCache = $context->getConfig()->get( MainConfigNames::UseFileCache );
# Get variables from query 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 preloadTitleInfo
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
public static function preloadTitleInfo(
Context $context, array $moduleNames
) {
$rl = $context->getResourceLoader();
// getDB() can be overridden to point to a foreign database.
- 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 securitySensitiveOperationStatus
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
public function securitySensitiveOperationStatus( $operation ) {
$status = self::SEC_OK;
$this->logger->debug( __METHOD__ . ": Checking $operation" );
- 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 providerAllowsAuthenticationDataChange
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
public function providerAllowsAuthenticationDataChange(
AuthenticationRequest $req, $checkData = true
) {
// We only want to blank the password if something else will accept the
// new authentication data, so return 'ignore' here.
- 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 send
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
public static function send( $to, $from, $subject, $body, $options = [] ) {
$services = MediaWikiServices::getInstance();
$allowHTMLEmail = $services->getMainConfig()->get(
MainConfigNames::AllowHTMLEmail );
- 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( $skipcache = false ) {
if ( !$this->cacheable || $skipcache ) {
$status = $this->poolCounter->acquireForMe();
} else {
if ( $this->isFastStaleEnabled() ) {
- 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 doCopyInternal
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
protected function doCopyInternal( array $params ) {
$status = $this->newStatus();
$fsSrcPath = $this->resolveToFSPath( $params['src'] );
if ( $fsSrcPath === 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 getInputHTMLForKey
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
protected function getInputHTMLForKey( $key, array $values ) {
$displayFormat = $this->mParams['format'] ?? $this->mParent->getDisplayFormat();
// Conveniently, PHP method names are case-insensitive.
$getFieldHtmlMethod = $displayFormat == 'table' ? 'getTableRow' : ( 'get' . $displayFormat );
- 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 getButtons
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
public function getButtons() {
$buttons = '';
if ( $this->mShowSubmit ) {
$attribs = [
- 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 getErrorsOrWarnings
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
public function getErrorsOrWarnings( $elements, $elementsType ) {
if ( $elements === '' ) {
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 listDropdownOptions
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
public static function listDropdownOptions( $list, $params = [] ) {
$options = [];
if ( isset( $params['other'] ) ) {
$options[ $params['other'] ] = 'other';
- 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 getButtons
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
public function getButtons() {
$buttons = '';
if ( $this->mShowSubmit ) {
$attribs = [];
- 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 skinPreferences
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
protected function skinPreferences( User $user, IContextSource $context, &$defaultPreferences ) {
// Skin selector, if there is at least one valid skin
$validSkinNames = $this->getValidSkinNames( $user, $context );
if ( $validSkinNames ) {
$defaultPreferences['skin'] = [
- 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 getMsgFromNamespace
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
public function getMsgFromNamespace( $title, $code ) {
// Load all MediaWiki page definitions into cache. Note that individual keys
// already loaded into the cache during this request remain in the cache, which
// includes the value of hook-defined messages.
$this->load( $code );
- 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 listDropdownOptions
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
public static function listDropdownOptions( $list, $params = [] ) {
$options = [];
if ( isset( $params['other'] ) ) {
$options[ $params['other'] ] = 'other';
- 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 mteiToBengali
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
private function mteiToBengali( $text ) {
$chars = mb_str_split( $text );
$l = count( $chars );
$i = 0;
while ( $i < $l ) {
- 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 normaliseParams
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
public function normaliseParams( $image, &$params ) {
if ( !isset( $params['width'] ) ) {
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 wfCgiToArray
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
function wfCgiToArray( $query ) {
if ( isset( $query[0] ) && $query[0] == '?' ) {
$query = substr( $query, 1 );
}
$bits = explode( '&', $query );
- 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 getUserLinks
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
protected function getUserLinks(
SpecialPage $sp,
User $target
) {
$id = $target->getId();
- 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() {
global $wgLang;
$r = $this->parent->request;
$userLang = $r->getVal( 'uselang' );
$contLang = $r->getVal( 'ContLang' );
- 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"