File ContributionsPager.php
has 585 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 232 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function formatRow( $row ) {
$ret = '';
$classes = [];
$attribs = [];
$authority = $this->getAuthority();
Function formatRow
has a Cognitive Complexity of 48 (exceeds 5 allowed). Consider refactoring. Open
public function formatRow( $row ) {
$ret = '';
$classes = [];
$attribs = [];
$authority = $this->getAuthority();
- 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
ContributionsPager
has 21 functions (exceeds 20 allowed). Consider refactoring. Open
abstract class ContributionsPager extends RangeChronologicalPager {
/** @inheritDoc */
public $mGroupByDate = true;
Method __construct
has 54 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function __construct(
LinkRenderer $linkRenderer,
LinkBatchFactory $linkBatchFactory,
HookContainer $hookContainer,
RevisionStore $revisionStore,
Function doBatchLookups
has a Cognitive Complexity of 16 (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
Method doBatchLookups
has 50 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 getQueryInfo
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getQueryInfo() {
$queryInfo = $this->getRevisionQuery();
if ( $this->deletedOnly ) {
$queryInfo['conds'][] = $this->revisionDeletedField . ' != 0';
Method reallyDoQuery
has 39 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 __construct
has 10 arguments (exceeds 4 allowed). Consider refactoring. Open
LinkRenderer $linkRenderer,
LinkBatchFactory $linkBatchFactory,
HookContainer $hookContainer,
RevisionStore $revisionStore,
NamespaceInfo $namespaceInfo,
Function getQueryInfo
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public function getQueryInfo() {
$queryInfo = $this->getRevisionQuery();
if ( $this->deletedOnly ) {
$queryInfo['conds'][] = $this->revisionDeletedField . ' != 0';
- 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 __construct
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public function __construct(
LinkRenderer $linkRenderer,
LinkBatchFactory $linkBatchFactory,
HookContainer $hookContainer,
RevisionStore $revisionStore,
- 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"