Showing 11,545 of 11,545 total issues
Function extractRevisionInfo
has a Cognitive Complexity of 58 (exceeds 5 allowed). Consider refactoring. Open
protected function extractRevisionInfo( RevisionRecord $revision, $row ) {
$vals = [];
$anyHidden = false;
if ( $this->fld_ids ) {
- 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 58 (exceeds 5 allowed). Consider refactoring. Open
public function execute() {
// Get parameters
$params = $this->extractRequestParams();
$this->helpFormat = $params['helpformat'];
- 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
Method execute
has 227 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function execute() {
// Parse some parameters
$this->params = $this->extractRequestParams();
$prop = array_fill_keys( $this->params['prop'], true );
MediaHandler
has 62 functions (exceeds 20 allowed). Consider refactoring. Open
abstract class MediaHandler {
public const TRANSFORM_LATER = 1;
public const METADATA_GOOD = true;
public const METADATA_BAD = false;
public const METADATA_COMPATIBLE = 2; // for old but backwards compatible.
Function showDiffPage
has a Cognitive Complexity of 57 (exceeds 5 allowed). Consider refactoring. Open
public function showDiffPage( $diffOnly = false ) {
# Allow frames except in certain special cases
$out = $this->getOutput();
$out->setPreventClickjacking( false );
$out->setRobotPolicy( 'noindex,nofollow' );
- 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 SpecialRevisionDelete.php
has 538 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 FileBackendMultiWrite.php
has 532 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* Proxy backend that mirrors writes to several internal backends.
*
* This program is free software; you can redistribute it and/or modify
File DatabaseMySQL.php
has 532 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 CategoryViewer.php
has 532 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* List and paging of category members.
*
* This program is free software; you can redistribute it and/or modify
Function execute
has a Cognitive Complexity of 56 (exceeds 5 allowed). Consider refactoring. Open
public function execute() {
$oldLayout = $this->getOption( 'oldlayout' );
if ( !in_array( $oldLayout, [ 'name', 'sha1' ] ) ) {
$this->fatalError( "Invalid old layout." );
}
- 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 PageHistoryCountHandler.php
has 531 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
namespace MediaWiki\Rest\Handler;
use ChangeTags;
Method convertGrammarKk_cyrl
has 218 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function convertGrammarKk_cyrl( $word, $case ) {
$grammarForms =
MediaWikiServices::getInstance()->getMainConfig()->get( MainConfigNames::GrammarForms );
if ( isset( $grammarForms['kk-kz'][$case][$word] ) ) {
return $grammarForms['kk-kz'][$case][$word];
File jpegmeta.js
has 528 lines of code (exceeds 250 allowed). Consider refactoring. Open
/**
* This is JsJpegMeta v1.0
* From: https://code.google.com/p/jsjpegmeta/downloads/list
* From: https://github.com/bennoleslie/jsjpegmeta/blob/v1.0.0/jpegmeta.js
*
WANObjectCache
has 60 functions (exceeds 20 allowed). Consider refactoring. Open
class WANObjectCache implements
ExpirationAwareness,
StorageAwareness,
IStoreKeyEncoder,
LoggerAwareInterface
SiteConfig
has 60 functions (exceeds 20 allowed). Consider refactoring. Open
class SiteConfig extends ISiteConfig {
/**
* Regular expression fragment for matching wikitext comments.
* Meant for inclusion in other regular expressions.
Method execute
has 216 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function execute() {
$db = $this->getDB();
$params = $this->extractRequestParams();
$this->requireMaxOneParameter( $params, 'users', 'ip' );
File jquery.ui.slider.js
has 526 lines of code (exceeds 250 allowed). Consider refactoring. Open
/*!
* jQuery UI Slider 1.9.2
* http://jqueryui.com
*
* Copyright 2012 jQuery Foundation and other contributors
File SessionBackend.php
has 525 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* MediaWiki session backend
*
* This program is free software; you can redistribute it and/or modify
Function setup
has a Cognitive Complexity of 55 (exceeds 5 allowed). Consider refactoring. Open
setup(props, { emit, attrs }) {
const rootElement = ref();
const statusMessageContent = ref("");
const computedDirection = useComputedDirection(rootElement);
const input = ref();
- 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 extractOutputData
has a Cognitive Complexity of 55 (exceeds 5 allowed). Consider refactoring. Open
private function extractOutputData( WatchedItem $watchedItem, array $recentChangeInfo ) {
/* Determine the title of the page that has been changed. */
$target = $watchedItem->getTarget();
if ( $target instanceof LinkTarget ) {
$title = Title::newFromLinkTarget( $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"