Showing 9,426 of 11,461 total issues
File HTMLFormField.php
has 762 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
namespace MediaWiki\HTMLForm;
use HtmlArmor;
Function checkSettings
has a Cognitive Complexity of 89 (exceeds 5 allowed). Consider refactoring. Open
public function checkSettings(
ApiBase $module, array $params, string $name, array $options
): array {
$options['module'] = $module;
$settings = $params[$name];
- 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 setup
has 356 lines of code (exceeds 25 allowed). Consider refactoring. Open
setup(props, { emit, slots, attrs }) {
const computedMenuItems = computed(() => {
const menuItemsWithFooter = props.footer && props.menuItems ? [...props.menuItems, props.footer] : props.menuItems;
return menuItemsWithFooter.map((menuItem) => __spreadProps(__spreadValues({}, menuItem), {
id: useGeneratedId("menu-item")
EditPage
has 93 functions (exceeds 20 allowed). Consider refactoring. Open
#[\AllowDynamicProperties]
class EditPage implements IEditObject {
use DeprecationHelper;
use ProtectedHookAccessorTrait;
HTMLForm
has 93 functions (exceeds 20 allowed). Consider refactoring. Open
class HTMLForm extends ContextSource {
use ProtectedHookAccessorTrait;
/** @var string[] A mapping of 'type' inputs onto standard HTMLFormField subclasses */
public static $typeMappings = [
Function loadSessionInfoFromStore
has a Cognitive Complexity of 88 (exceeds 5 allowed). Consider refactoring. Open
private function loadSessionInfoFromStore( SessionInfo &$info, WebRequest $request ) {
$key = $this->store->makeKey( 'MWSession', $info->getId() );
$blob = $this->store->get( $key );
// If we got data from the store and the SessionInfo says to force use,
- 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 88 (exceeds 5 allowed). Consider refactoring. Open
public function convertGrammar( $word, $case ) {
$grammarForms =
MediaWikiServices::getInstance()->getMainConfig()->get( MainConfigNames::GrammarForms );
if ( isset( $grammarForms['tyv'][$case][$word] ) ) {
return $grammarForms['tyv'][$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 createSetupStore
has 351 lines of code (exceeds 25 allowed). Consider refactoring. Open
function createSetupStore($id, setup, options = {}, pinia, hot, isOptionsStore) {
let scope;
const optionsForPlugin = assign({ actions: {} }, options);
/* istanbul ignore if */
// @ts-expect-error: active is an internal property
File SpecialWatchlist.php
has 750 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 SessionManager.php
has 749 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* MediaWiki\Session entry point
*
* This program is free software; you can redistribute it and/or modify
Method getHelpInternal
has 348 lines of code (exceeds 25 allowed). Consider refactoring. Open
private static function getHelpInternal( IContextSource $context, array $modules,
array $options, &$haveModules
) {
$out = '';
Function execute
has a Cognitive Complexity of 87 (exceeds 5 allowed). Consider refactoring. Open
public function execute() {
$params = $this->extractRequestParams();
if ( $params['lang'] === null ) {
$langObj = $this->getLanguage();
} elseif ( !$this->languageNameUtils->isValidCode( $params['lang'] ) ) {
- 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
File MainConfigNames.php
has 743 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* This file is automatically generated using maintenance/generateConfigSchema.php.
* Do not modify this file manually, edit includes/MainConfigSchema.php instead.
* @file
File config-vars.php
has 741 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* This file is automatically generated using maintenance/generateConfigSchema.php.
* Do not modify this file manually, edit includes/MainConfigSchema.php instead.
*/
File SpecialRecentChanges.php
has 740 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
Function openShowImage
has a Cognitive Complexity of 86 (exceeds 5 allowed). Consider refactoring. Open
protected function openShowImage() {
$context = $this->getContext();
$mainConfig = $context->getConfig();
$enableUploads = $mainConfig->get( MainConfigNames::EnableUploads );
$send404Code = $mainConfig->get( MainConfigNames::Send404Code );
- 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
File InfoAction.php
has 739 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* Displays information about a page.
*
* Copyright © 2011 Alexandre Emsenhuber
File NormalizeAr.php
has 737 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
// Generated by generateNormalizerDataAr.php. Do not modify!
namespace MediaWiki\Languages\Data;
Function pluralRuleParser
has 341 lines of code (exceeds 25 allowed). Consider refactoring. Open
function pluralRuleParser(rule, number) {
'use strict';
/*
Syntax: see http://unicode.org/reports/tr35/#Language_Plural_Rules
File TextPassDumper.php
has 734 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* BackupDumper that postprocesses XML dumps from dumpBackup.php to add page text
*
* Copyright (C) 2005 Brooke Vibber <bvibber@wikimedia.org>