Showing 994 of 1,238 total issues
Function getServers
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
private function getServers(
bool $isDryRun,
bool $shouldReindex,
?string $ttmServerId = null
): array {
- 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 prepareTranslationUnits
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
private function prepareTranslationUnits( TranslatablePage $page, ParserOutput $parserOutput ): array {
$highest = (int)$this->messageGroupMetadata->get( $page->getMessageGroupId(), 'maxid' );
$store = $this->translationUnitStoreFactory->getReader( $page->getPageIdentity() );
$storedUnits = $store->getUnits();
- 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 rebuild
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
public function rebuild( float $timestamp = null ): array {
static $recursion = 0;
if ( $recursion > 0 ) {
$msg = __METHOD__ . ': trying to recurse - building the index first time?';
- 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 14 (exceeds 5 allowed). Consider refactoring. Open
public function execute( $par ) {
$request = $this->getRequest();
$user = $this->getUser();
$this->addHelpLink( 'Help:Extension:Translate/Move_translatable_page' );
$out = $this->getOutput();
- 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 applyFilter
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
private function applyFilter( string $filter, bool $condition, ?int $value ): void {
$keys = $this->keys;
if ( $filter === 'fuzzy' ) {
$keys = $this->filterFuzzy( $keys, $condition );
} elseif ( $filter === 'hastranslation' ) {
- 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 14 (exceeds 5 allowed). Consider refactoring. Open
public function execute( $par ) {
$this->addHelpLink( 'Help:Deletion_and_undeletion' );
$request = $this->getRequest();
- 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 getNames
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
public function getNames(): array {
$ttmServersIds = [];
foreach ( $this->configs as $serviceId => $config ) {
$type = $config['type'] ?? '';
if ( $type === 'ttmserver' || $type === 'remote-ttmserver' ) {
- 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 getHopefullyValidConfigurations
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
public function getHopefullyValidConfigurations( string $data, ?callable $callback = null ): array {
if ( !is_callable( $callback ) ) {
$callback = static function ( $unused1, $unused2, $unused3 ) {
/*noop*/
};
- 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 flattenCLDRPlurals
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
public function flattenCLDRPlurals( array $messages ) {
$hasNonPluralKeys = false;
$pluralKeys = [];
foreach ( $messages as $key => $value ) {
if ( is_array( $value ) ) {
- 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 loadMessagesFromCache
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
protected function loadMessagesFromCache( $groups ) {
$messages = [];
foreach ( $groups as $group ) {
if ( $group instanceof self ) {
$messages += $this->loadMessagesFromCache( $group->getGroups() );
- 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 doesKeyMatch
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
protected function doesKeyMatch( string $key, array $keyMatches ): bool {
$normalizedKey = lcfirst( $key );
foreach ( $keyMatches as $match ) {
if ( is_string( $match ) ) {
if ( lcfirst( $match ) === $normalizedKey ) {
- 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 getTooltipSize
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
function getTooltipSize(tooltip, model) {
var ctx = tooltip._chart.ctx;
var height = model.yPadding * 2; // Tooltip Padding
var width = 0;
Function draw
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
draw: function() {
var me = this;
var ctx = me.ctx;
var opts = me.options;
Method startSync
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function startSync( array $modificationJobs, array $renameJobs ): void {
// We are adding an empty array for groups that have no jobs. This is mainly done to
// avoid adding unnecessary checks. Remove those using array_filter
$modificationGroupIds = array_keys( array_filter( $modificationJobs ) );
$renameGroupIds = array_keys( array_filter( $renameJobs ) );
Method showRenames
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function showRenames(
MessageGroup $group,
MessageSourceChange $sourceChanges,
OutputPage $out,
string $language,
Method getMessageParameters
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function getMessageParameters(): array {
$params = parent::getMessageParameters();
$legacy = $this->entry->getParameters();
$type = $this->entry->getFullType();
Method writeReal
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function writeReal( MessageCollection $collection ): string {
global $wgTranslateDocumentationLanguageCode;
$collection->filter( 'hastranslation', false );
if ( count( $collection ) === 0 ) {
Function getBackgroundPoint
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
function getBackgroundPoint(vm, size, alignment, chart) {
// Background Position
var x = vm.x;
var y = vm.y;
Function updateElement
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
updateElement: function(arc, index, reset) {
var me = this;
var chart = me.chart;
var chartArea = chart.chartArea;
var opts = chart.options;
Function search
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
search: function ( query ) {
var resultCount = 0,
matcher = new RegExp( '(^|\\s|\\b)' + escapeRegex( query ), 'i' );
this.$container.find( itemsClass[ this.mode ] ).each( function () {