File ContribsPager.php
has 572 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
Method formatRow
has 162 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function formatRow( $row ) {
$ret = '';
$classes = [];
$attribs = [];
Function formatRow
has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring. Open
public function formatRow( $row ) {
$ret = '';
$classes = [];
$attribs = [];
- 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
ContribsPager
has 25 functions (exceeds 20 allowed). Consider refactoring. Open
class ContribsPager extends RangeChronologicalPager {
public $mGroupByDate = true;
/**
Method getQueryInfo
has 57 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getQueryInfo() {
$revQuery = $this->revisionStore->getQueryInfo( [ 'page', 'user' ] );
$queryInfo = [
'tables' => $revQuery['tables'],
'fields' => array_merge( $revQuery['fields'], [ 'page_is_new' ] ),
Method __construct
has 52 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function __construct(
IContextSource $context,
array $options,
LinkRenderer $linkRenderer = null,
LinkBatchFactory $linkBatchFactory = null,
Method reallyDoQuery
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function reallyDoQuery( $offset, $limit, $order ) {
[ $tables, $fields, $conds, $fname, $options, $join_conds ] = $this->buildQueryInfo(
$offset,
$limit,
$order
Method doBatchLookups
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function doBatchLookups() {
# Do a link batch query
$this->mResult->seek( 0 );
$parentRevIds = [];
$this->mParentLens = [];
Method __construct
has 10 arguments (exceeds 4 allowed). Consider refactoring. Open
IContextSource $context,
array $options,
LinkRenderer $linkRenderer = null,
LinkBatchFactory $linkBatchFactory = null,
HookContainer $hookContainer = null,
Function __construct
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public function __construct(
IContextSource $context,
array $options,
LinkRenderer $linkRenderer = null,
LinkBatchFactory $linkBatchFactory = 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 getQueryInfo
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public function getQueryInfo() {
$revQuery = $this->revisionStore->getQueryInfo( [ 'page', 'user' ] );
$queryInfo = [
'tables' => $revQuery['tables'],
'fields' => array_merge( $revQuery['fields'], [ 'page_is_new' ] ),
- 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 doBatchLookups
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
protected function doBatchLookups() {
# Do a link batch query
$this->mResult->seek( 0 );
$parentRevIds = [];
$this->mParentLens = [];
- 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 reallyDoQuery
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function reallyDoQuery( $offset, $limit, $order ) {
[ $tables, $fields, $conds, $fname, $options, $join_conds ] = $this->buildQueryInfo(
$offset,
$limit,
$order
- 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"