Showing 11,545 of 11,545 total issues
Method getParametersForApi
has 57 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function getParametersForApi() {
$entry = $this->entry;
$params = [];
$subtype = $this->entry->getSubtype();
Method makeLikeArray
has 57 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function makeLikeArray( $filterEntry, $protocol = 'http://' ) {
$services = MediaWikiServices::getInstance();
$db = $services->getConnectionProvider()->getReplicaDatabase();
$likeDomain = [];
$likePath = [];
Method finalSetup
has 57 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function finalSetup( SettingsBuilder $settingsBuilder ) {
$config = $settingsBuilder->getConfig();
$overrides = [];
$overrides['DBadminuser'] = $config->get( MainConfigNames::DBadminuser );
$overrides['DBadminpassword'] = $config->get( MainConfigNames::DBadminpassword );
Method commit
has 57 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function commit() {
$originalCount = count( $this->texts );
if ( !$originalCount ) {
return;
}
Method execute
has 57 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function execute() {
$force = $this->getOption( 'force' );
$startFrom = $this->getOption( 'start-from' );
// We need the namespace index instead of the name to perform the query
File Context.php
has 261 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 EmailUser.php
has 261 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 CoreMagicVariables.php
has 261 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* Magic variable implementations provided by MediaWiki core
*
* This program is free software; you can redistribute it and/or modify
File MessagesOc.php
has 261 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/** Occitan (occitan)
*
* @file
* @ingroup Languages
Function _sfc_render$h
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
function _sfc_render$h(_ctx, _cache, $props, $setup, $data, $options) {
const _component_cdx_icon = resolveComponent("cdx-icon");
const _component_cdx_button = resolveComponent("cdx-button");
return openBlock(), createBlock(Teleport, {
to: _ctx.computedTarget,
- 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 checkUserConfigPermissions
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
private function checkUserConfigPermissions(
$action,
UserIdentity $user,
PermissionStatus $status,
$rigor,
- 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 getApplicableBlock
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
public function getApplicableBlock(
string $action,
User $user,
string $rigor,
$page,
- 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 moveToInternal
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
private function moveToInternal(
UserIdentity $user,
&$nt,
$reason = '',
$createRedirect = true,
- 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 updateRecentChange
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
private function updateRecentChange(
IDatabase $dbw,
RevisionRecord $current,
RevisionRecord $target
) {
- 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 isValidMove
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
public function isValidMove() {
$status = new Status();
if ( $this->oldTitle->equals( $this->newTitle ) ) {
$status->fatal( 'selfmove' );
- 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 expandPackageFiles
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
private function expandPackageFiles( Context $context ) {
$hash = $context->getHash();
if ( isset( $this->expandedPackageFiles[$hash] ) ) {
return $this->expandedPackageFiles[$hash];
}
- 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 getRequirements
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
public function getRequirements( array $info, $includeDev ) {
// Quick shortcuts
if ( !$includeDev || !isset( $info['dev-requires'] ) ) {
return $info['requires'] ?? [];
}
- 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 showDiff
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
public function showDiff() {
$oldtitlemsg = 'currentrev';
# if message does not exist, show diff against the preloaded default
if ( $this->mTitle->getNamespace() === NS_MEDIAWIKI && !$this->mTitle->exists() ) {
$oldtext = $this->mTitle->getDefaultMessageText();
- 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 constructSlotRecords
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
private function constructSlotRecords(
$revId,
$slotRows,
$queryFlags,
PageIdentity $page,
- 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 buildLocationRing
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
private function buildLocationRing( array $weightByLocation ) {
$locationCount = count( $weightByLocation );
$totalWeight = array_sum( $weightByLocation );
$ring = [];
- 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"