Showing 11,545 of 11,545 total issues
File LocalFileDeleteBatch.php
has 289 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 MessagesHi.php
has 289 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/** Hindi (हिन्दी)
*
* @file
* @ingroup Languages
Function showDialog
has 73 lines of code (exceeds 25 allowed). Consider refactoring. Open
showDialog( config ) {
const { initOpenWindow, openWindow, data } = config;
// Display a message in the current browser window, so that if the popup window doesn't open,
// or if the user loses it on their desktop somehow, they can still see what was supposed to happen,
Function translate
has 73 lines of code (exceeds 25 allowed). Consider refactoring. Open
function translate(number, withoutSuffix, key, isFuture) {
var result = number + ' ';
switch (key) {
case 's':
return withoutSuffix || isFuture
Function CHILD
has 73 lines of code (exceeds 25 allowed). Consider refactoring. Open
CHILD: function( type, what, _argument, first, last ) {
var simple = type.slice( 0, 3 ) !== "nth",
forward = type.slice( -4 ) !== "last",
ofType = what === "of-type";
Function toggle
has 73 lines of code (exceeds 25 allowed). Consider refactoring. Open
OO.ui.PopupWidget.prototype.toggle = function ( show ) {
show = show === undefined ? !this.isVisible() : !!show;
const change = show !== this.isVisible();
Method write
has 73 lines of code (exceeds 25 allowed). Consider refactoring. Open
#[\ReturnTypeWillChange]
public function write( $id, $dataStr ) {
if ( self::$instance !== $this ) {
throw new \UnexpectedValueException( __METHOD__ . ': Wrong instance called!' );
}
Method upsert
has 73 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function upsert( $table, array $rows, $uniqueKeys, array $set, $fname = __METHOD__ ) {
$uniqueKey = $this->platform->normalizeUpsertParams( $uniqueKeys, $rows );
if ( !$rows ) {
return true;
}
Method dropDefaults
has 73 lines of code (exceeds 25 allowed). Consider refactoring. Open
private static function dropDefaults( $element, array $attribs ) {
// Whenever altering this array, please provide a covering test case
// in HtmlTest::provideElementsWithAttributesHavingDefaultValues
static $attribDefaults = [
'area' => [ 'shape' => 'rect' ],
Method getAllowedParams
has 73 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getAllowedParams() {
return [
'prop' => [
ParamValidator::PARAM_ISMULTI => true,
ParamValidator::PARAM_TYPE => [
Method run
has 73 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function run( $resultPageSet = null ) {
$pages = $this->getPageSet()->getGoodPages();
if ( $pages === [] ) {
return; // nothing to do
}
Method execute
has 73 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function execute( $par ) {
$this->checkPermissions();
$this->checkReadOnly();
$output = $this->getOutput();
Method getRestrictionListHTML
has 73 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function getRestrictionListHTML( stdClass $row ) {
$items = [];
$linkRenderer = $this->getLinkRenderer();
foreach ( $this->restrictions as $restriction ) {
Method run
has 73 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function run( $title ) {
$params = $this->getValidatedParams();
if ( $params['older_than'] !== null && $params['newer_than'] !== null ) {
throw new LocalizedHttpException(
new MessageValue( 'rest-pagehistory-incompatible-params' ), 400 );
Method execute
has 73 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function execute() {
$dbr = $this->getReplicaDB();
$endId = $dbr->newSelectQueryBuilder()
->select( 'MAX(old_id)' )
Method processOptions
has 73 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function processOptions() {
$sink = null;
$sinks = [];
$this->schemaVersion = WikiExporter::schemaVersion();
Function setErrors
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
HtmlformChecker.prototype.setErrors = function ( valid, errors, forceReplacement ) {
let $oldErrorBox,
showFunc,
$text,
replace,
- 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 exports
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
module.exports = ( function () {
/**
* @classdesc Interact with the API of another MediaWiki site. mw.Foreign API creates
* an object like {@link mw.Api}, but automatically handle everything required to communicate
- 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 internalCan
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
private function internalCan(
string $rigor,
string $action,
PageIdentity $target,
?PermissionStatus $status,
- 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 loadRestrictions
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
public function loadRestrictions(
PageIdentity $page, int $flags = IDBAccessObject::READ_NORMAL
): void {
$page->assertWiki( PageIdentity::LOCAL );
- 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"