Showing 11,545 of 11,545 total issues
Function execute
has a Cognitive Complexity of 34 (exceeds 5 allowed). Consider refactoring. Open
public function execute( $par ) {
$this->setHeaders();
$this->addHelpLink( 'Help:Renameuser' );
$this->checkPermissions();
- 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 cleanUpTocLine
has a Cognitive Complexity of 34 (exceeds 5 allowed). Consider refactoring. Open
private function cleanUpTocLine( Node $container ) {
'@phan-var Element|DocumentFragment $container'; // @var Element|DocumentFragment $container
# Strip out HTML
# Allowed tags are:
# * <sup> and <sub> (T10393)
- 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 replaceInternal
has a Cognitive Complexity of 34 (exceeds 5 allowed). Consider refactoring. Open
protected function replaceInternal( &$text ) {
if ( !$this->internals ) {
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 execute
has a Cognitive Complexity of 34 (exceeds 5 allowed). Consider refactoring. Open
public function execute(
User $performingUser,
$username = null,
$email = 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 getTrackingCategories
has a Cognitive Complexity of 34 (exceeds 5 allowed). Consider refactoring. Open
public function getTrackingCategories() {
$categories = array_merge(
self::CORE_TRACKING_CATEGORIES,
$this->extensionRegistry->getAttribute( MainConfigNames::TrackingCategories ),
$this->options->get( MainConfigNames::TrackingCategories ) // deprecated
- 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
Method deleteInternal
has 127 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function deleteInternal(
WikiPage $page,
string $pageRole,
string $reason,
?string $webRequestId = null
Method run
has 127 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function run( $resultPageSet = null ) {
$params = $this->extractRequestParams();
$user = $this->getUser();
$wlowner = $this->getWatchlistUser( $params );
File ForeignResourceManager.php
has 377 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 UsersPager.php
has 377 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* Copyright © 2004 Brooke Vibber, lcrocker, Tim Starling,
* Domas Mituzas, Antoine Musso, Jens Frank, Zhengzhu,
* 2006 Rob Church <robchur@gmail.com>
Function register_observers
has 126 lines of code (exceeds 25 allowed). Consider refactoring. Open
Chosen.prototype.register_observers = function() {
this.container.on('touchstart.chosen', (function(_this) {
return function(evt) {
_this.container_mousedown(evt);
};
Method run
has 126 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function run( $resultPageSet = null ) {
$params = $this->extractRequestParams();
// Extract parameters
$query = $params['search'];
Method getCurrentUserInfo
has 126 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function getCurrentUserInfo() {
$user = $this->getUser();
$vals = [];
$vals['id'] = $user->getId();
$vals['name'] = $user->getName();
Method checkLinkTable
has 126 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function checkLinkTable( $table, $fieldPrefix, $ns, $name, $options,
$extraConds = []
) {
$dbw = $this->getPrimaryDB();
File HTMLFormFieldCloner.php
has 376 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
namespace MediaWiki\HTMLForm\Field;
use InvalidArgumentException;
File MaintenanceParameters.php
has 376 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
SettingsBuilder
has 38 functions (exceeds 20 allowed). Consider refactoring. Open
class SettingsBuilder {
/**
* @var int The initial stage in which settings can be loaded,
* but config values cannot be accessed.
MemcachedClient
has 38 functions (exceeds 20 allowed). Consider refactoring. Open
class MemcachedClient implements StorageAwareness {
// {{{ properties
// {{{ public
// {{{ constants
ChangeTags
has 38 functions (exceeds 20 allowed). Consider refactoring. Open
class ChangeTags {
/**
* The tagged edit changes the content model of the page.
*/
public const TAG_CONTENT_MODEL_CHANGE = 'mw-contentmodelchange';
Site
has 38 functions (exceeds 20 allowed). Consider refactoring. Open
class Site {
public const TYPE_UNKNOWN = 'unknown';
public const TYPE_MEDIAWIKI = 'mediawiki';
public const GROUP_NONE = 'none';
DatabaseInstaller
has 38 functions (exceeds 20 allowed). Consider refactoring. Open
abstract class DatabaseInstaller {
/**
* A connection for creating DBs, suitable for pre-installation.
*/
public const CONN_CREATE_DATABASE = 'create-database';