includes/api/ApiQueryBase.php
ApiQueryBase
has 32 functions (exceeds 20 allowed). Consider refactoring. Open
Open
abstract class ApiQueryBase extends ApiBase {
use ApiQueryBlockInfoTrait;
private ApiQuery $mQueryModule;
private ?IReadableDatabase $mDb;
File ApiQueryBase.php
has 255 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
<?php
/**
* Copyright © 2006 Yuri Astrakhan "<Firstname><Lastname>@gmail.com"
*
* This program is free software; you can redistribute it and/or modify
Method select
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
protected function select( $method, $extraQuery = [], array &$hookData = null ) {
$queryBuilder = clone $this->getQueryBuilder();
if ( isset( $extraQuery['tables'] ) ) {
$queryBuilder->rawTables( (array)$extraQuery['tables'] );
}
Function select
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
Open
protected function select( $method, $extraQuery = [], array &$hookData = null ) {
$queryBuilder = clone $this->getQueryBuilder();
if ( isset( $extraQuery['tables'] ) ) {
$queryBuilder->rawTables( (array)$extraQuery['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
Method addTimestampWhereRange
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
protected function addTimestampWhereRange( $field, $dir, $start, $end, $sort = true ) {
Method addWhereRange
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
protected function addWhereRange( $field, $dir, $start, $end, $sort = true ) {
Function executeGenderCacheFromResultWrapper
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
Open
protected function executeGenderCacheFromResultWrapper(
IResultWrapper $res, $fname = __METHOD__, $fieldPrefix = 'page'
) {
if ( !$res->numRows() ) {
return;
- 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"