Function run
has a Cognitive Complexity of 59 (exceeds 5 allowed). Consider refactoring. Open
private function run( $resultPageSet = null ) {
$this->params = $this->extractRequestParams( false );
$this->redirect = isset( $this->params['redirect'] ) && $this->params['redirect'];
$userMax = ( $this->redirect ? ApiBase::LIMIT_BIG1 / 2 : ApiBase::LIMIT_BIG1 );
$botMax = ( $this->redirect ? ApiBase::LIMIT_BIG2 / 2 : ApiBase::LIMIT_BIG2 );
- 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 ApiQueryBacklinks.php
has 463 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* Copyright © 2006 Yuri Astrakhan "<Firstname><Lastname>@gmail.com"
*
* This program is free software; you can redistribute it and/or modify
Method run
has 132 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function run( $resultPageSet = null ) {
$this->params = $this->extractRequestParams( false );
$this->redirect = isset( $this->params['redirect'] ) && $this->params['redirect'];
$userMax = ( $this->redirect ? ApiBase::LIMIT_BIG1 / 2 : ApiBase::LIMIT_BIG1 );
$botMax = ( $this->redirect ? ApiBase::LIMIT_BIG2 / 2 : ApiBase::LIMIT_BIG2 );
Function runSecondQuery
has a Cognitive Complexity of 34 (exceeds 5 allowed). Consider refactoring. Open
private function runSecondQuery( $resultPageSet = null ) {
$db = $this->getDB();
if ( isset( $this->linksMigration::$mapping[$this->bl_table] ) ) {
$queryInfo = $this->linksMigration->getQueryInfo( $this->bl_table, $this->bl_table );
$this->addTables( $queryInfo['tables'] );
- 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 runFirstQuery
has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring. Open
private function runFirstQuery( $resultPageSet = null ) {
$this->addTables( [ $this->bl_table, 'page' ] );
$this->addWhere( "{$this->bl_from}=page_id" );
if ( $resultPageSet === null ) {
$this->addFields( [ 'page_id', 'page_title', 'page_namespace' ] );
- 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 runSecondQuery
has 102 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function runSecondQuery( $resultPageSet = null ) {
$db = $this->getDB();
if ( isset( $this->linksMigration::$mapping[$this->bl_table] ) ) {
$queryInfo = $this->linksMigration->getQueryInfo( $this->bl_table, $this->bl_table );
$this->addTables( $queryInfo['tables'] );
Method runFirstQuery
has 74 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function runFirstQuery( $resultPageSet = null ) {
$this->addTables( [ $this->bl_table, 'page' ] );
$this->addWhere( "{$this->bl_from}=page_id" );
if ( $resultPageSet === null ) {
$this->addFields( [ 'page_id', 'page_title', 'page_namespace' ] );
Method getAllowedParams
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getAllowedParams() {
$retval = [
'title' => [
ParamValidator::PARAM_TYPE => 'string',
],