Showing 11,545 of 11,545 total issues
Method sendCacheHeaders
has 69 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function sendCacheHeaders( $isError ) {
$response = $this->getRequest()->response();
$out = $this->getOutput();
$out->addVaryHeader( 'Treat-as-Untrusted' );
Method populateGeneratorData
has 69 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function populateGeneratorData( &$result, array $path = [] ) {
if ( $result instanceof ApiResult ) {
$data = $result->getResultData( $path );
if ( $data === null ) {
return true;
Method outputNamespaceProtectionInfo
has 69 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function outputNamespaceProtectionInfo() {
$out = $this->getOutput();
$namespaceProtection = $this->getConfig()->get( MainConfigNames::NamespaceProtection );
if ( count( $namespaceProtection ) == 0 ) {
Method getNormalForm
has 69 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function getNormalForm() {
$fields = [];
$count = 0;
// Allow subscribers to manipulate the list of watched pages (or use it
Method callParserFunction
has 69 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function callParserFunction( PPFrame $frame, $function, array $args = [] ) {
# Case sensitive functions
if ( isset( $this->mFunctionSynonyms[1][$function] ) ) {
$function = $this->mFunctionSynonyms[1][$function];
} else {
Method formatChangeLine
has 69 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function formatChangeLine( RecentChange $rc, array &$classes, $watched ) {
$html = '';
$unpatrolled = $this->showAsUnpatrolled( $rc );
if ( $rc->mAttribs['rc_log_type'] ) {
Method rebuildRecentChangesTablePass2
has 69 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function rebuildRecentChangesTablePass2() {
$dbw = $this->getPrimaryDB();
$this->output( "Updating links and size differences...\n" );
Method doMove
has 69 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function doMove( IDatabase $db, $ns, $title ) {
$char = mb_substr( $title, 0, 1 );
if ( !array_key_exists( $char, $this->charmap ) ) {
$this->error(
"Query returned NS$ns $title, which does not begin with a character in the charmap."
Method execute
has 69 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function execute() {
$dbw = $this->getPrimaryDB();
$dbr = $this->getReplicaDB();
$maxLtId = (int)$dbr->newSelectQueryBuilder()
->select( 'MAX(lt_id)' )
Method execute
has 69 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function execute() {
$this->init();
$batchSize = $this->getBatchSize();
if ( $this->targetTable ) {
Function addPortletLink
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
addPortletLink: function ( portletId, href, text, id, tooltip, accesskey, nextnode ) {
if ( !portletId ) {
// Avoid confusing id="undefined" lookup
return null;
}
- 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 set
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
set: function ( fn, delay ) {
let nativeId = null,
visibleId = nextId++,
lastStartedAt = mw.now();
- 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 initialize
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
Controller.prototype.initialize = function ( filterStructure, namespaceStructure, tagList, conditionalViews ) {
const displayConfig = mw.config.get( 'StructuredChangeFiltersDisplayConfig' ),
defaultSavedQueryExists = mw.config.get( 'wgStructuredChangeFiltersDefaultSavedQueryExists' ),
controller = this,
views = $.extend( true, {}, conditionalViews ),
- 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 getCascadeProtectionSourcesInternal
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
private function getCascadeProtectionSourcesInternal(
PageIdentity $page, bool $shortCircuit = false
) {
if ( !$page->canExist() ) {
return $shortCircuit ? false : [ [], [] ];
- 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 showMissingArticle
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
public function showMissingArticle() {
$context = $this->getContext();
$send404Code = $context->getConfig()->get( MainConfigNames::Send404Code );
$outputPage = $context->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 deleteInternal
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
public function deleteInternal(
WikiPage $page,
string $pageRole,
string $reason,
?string $webRequestId = null
- 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 getBody
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
public function getBody() {
$s = '';
$this->doQuery();
if ( count( $this->mHist ) ) {
if ( $this->mImg->isLocal() ) {
- 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 getGoodIDs
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
private function getGoodIDs( $titles ) {
$result = [];
if ( is_iterable( $titles ) ) {
if ( $titles instanceof TitleArrayFromResult ||
( is_array( $titles ) && reset( $titles ) instanceof Title
- 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 continueLinkAttempt
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
protected function continueLinkAttempt( $user, $key, array $reqs ) {
$req = ButtonAuthenticationRequest::getRequestByName( $reqs, 'linkOk' );
if ( $req ) {
return AuthenticationResponse::newPass();
}
- 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 processUser
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
private function processUser( string $value ): array {
// A user ID?
if ( preg_match( '/^#(\d+)$/D', $value, $m ) ) {
// This used to use the IP address of the current request if the
// id was 0, to match the behavior of User objects, but was switched
- 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"