Showing 11,545 of 11,545 total issues
Function doAllOrphans
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
private function doAllOrphans() {
$dbr = MediaWikiServices::getInstance()->getConnectionProvider()->getReplicaDatabase();
$startId = 0;
$i = 0;
if ( $this->noCount ) {
- 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 16 (exceeds 5 allowed). Consider refactoring. Open
public function execute() {
$dbr = $this->getReplicaDB();
$endId = $dbr->newSelectQueryBuilder()
->select( 'MAX(old_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 getUserIdentityFromAnyId
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
private function getUserIdentityFromAnyId(
$userId,
$userName,
$actorId = null
): UserIdentity {
- 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 16 (exceeds 5 allowed). Consider refactoring. Open
public function execute() {
// Note that there is a difference between not specifying the start
// and end IDs and using the minimum and maximum values from the page
// table. In the latter case, deleteLinksFromNonexistent() will not
// delete entries for nonexistent IDs that fall outside the range.
- 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 16 (exceeds 5 allowed). Consider refactoring. Open
public function execute() {
$errors = [];
$destinationFolder = $this->getArg( 0 );
if ( !is_dir( $destinationFolder ) || !is_writable( $destinationFolder ) ) {
$errors[] = "The path: $destinationFolder does not exist, is not a folder or is not writable.";
- 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 prune_directory
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
protected function prune_directory( $dir, $report = false ) {
$tsNow = time();
$dirHandle = opendir( $dir );
// phpcs:ignore Generic.CodeAnalysis.AssignmentInCondition.FoundInWhileCondition
while ( ( $file = readdir( $dirHandle ) ) !== 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 execute
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
public function execute() {
$username = $this->getOption( 'user' );
$file = $this->getOption( 'file' );
if ( $username === null && $file === 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 doPurge
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
private function doPurge() {
$stdin = $this->getStdin();
$urls = [];
$htmlCacheUpdater = $this->getServiceContainer()->getHtmlCacheUpdater();
- 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 lazyMenuCreation
has 52 lines of code (exceeds 25 allowed). Consider refactoring. Open
MenuSelectWidget.prototype.lazyMenuCreation = function () {
const widget = this,
items = [],
viewGroupCount = {},
groups = this.model.getFilterGroups();
Function initialize
has 52 lines of code (exceeds 25 allowed). Consider refactoring. Open
mw.ForeignStructuredUpload.BookletLayout.prototype.initialize = function () {
const booklet = this;
return mw.ForeignStructuredUpload.BookletLayout.super.prototype.initialize.call( this ).then(
() => $.when(
// Point the CategoryMultiselectWidget to the right wiki
Function MwWidgetsTitleOptionWidget
has 52 lines of code (exceeds 25 allowed). Consider refactoring. Open
mw.widgets.TitleOptionWidget = function MwWidgetsTitleOptionWidget( config ) {
let icon;
if ( !config.showImages ) {
icon = null;
Function _sfc_render$d
has 52 lines of code (exceeds 25 allowed). Consider refactoring. Open
function _sfc_render$d(_ctx, _cache, $props, $setup, $data, $options) {
const _component_cdx_text_input = resolveComponent("cdx-text-input");
const _component_cdx_menu = resolveComponent("cdx-menu");
return openBlock(), createElementBlock(
"div",
Function makeApi
has 52 lines of code (exceeds 25 allowed). Consider refactoring. Open
function makeApi(sinon) {
var slice = Array.prototype.slice;
function test(callback) {
var type = typeof callback;
Function remove
has 52 lines of code (exceeds 25 allowed). Consider refactoring. Open
remove: function( elem, types, handler, selector, mappedTypes ) {
var j, origCount, tmp,
events, t, handleObj,
special, handlers, type, namespaces, origType,
Function _refreshValue
has 52 lines of code (exceeds 25 allowed). Consider refactoring. Open
_refreshValue: function() {
var lastValPercent, valPercent, value, valueMin, valueMax,
oRange = this.options.range,
o = this.options,
that = this,
Function _processTabs
has 52 lines of code (exceeds 25 allowed). Consider refactoring. Open
_processTabs: function() {
var that = this;
this.tablist = this._getList()
.addClass( "ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all" )
Function getElementClasses
has 52 lines of code (exceeds 25 allowed). Consider refactoring. Open
OO.ui.WikimediaUITheme.prototype.getElementClasses = function ( element ) {
const
variants = {
invert: false,
progressive: false,
Function keydown
has 52 lines of code (exceeds 25 allowed). Consider refactoring. Open
keydown: function( event ) {
if ( this.element.prop( "readOnly" ) ) {
suppressKeyPress = true;
suppressInput = true;
suppressKeyPressRepeat = true;
Function _mouseStart
has 52 lines of code (exceeds 25 allowed). Consider refactoring. Open
_mouseStart: function(event) {
var that = this;
this.opos = [event.pageX, event.pageY];
Function _computeTargetAndRootIntersection
has 52 lines of code (exceeds 25 allowed). Consider refactoring. Open
function(target, targetRect, rootRect) {
// If the element isn't displayed, an intersection can't happen.
if (window.getComputedStyle(target).display == 'none') return;
var intersectionRect = targetRect;