File rebuildrecentchanges.php
has 397 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* Rebuild recent changes from scratch. This takes several hours,
* depending on the database size and server configuration.
*
Method rebuildRecentChangesTablePass1
has 93 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function rebuildRecentChangesTablePass1() {
$dbw = $this->getPrimaryDB();
$commentStore = $this->getServiceContainer()->getCommentStore();
if ( $this->hasOption( 'from' ) && $this->hasOption( 'to' ) ) {
Method rebuildRecentChangesTablePass3
has 77 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function rebuildRecentChangesTablePass3() {
global $wgLogRestrictions, $wgFilterLogTypes;
$dbw = $this->getDB( DB_PRIMARY );
$commentStore = $this->getServiceContainer()->getCommentStore();
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" );
Function rebuildRecentChangesTablePass4
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
private function rebuildRecentChangesTablePass4() {
global $wgUseRCPatrol, $wgUseNPPatrol, $wgUseFilePatrol, $wgMiserMode;
$dbw = $this->getPrimaryDB();
- 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 rebuildRecentChangesTablePass4
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function rebuildRecentChangesTablePass4() {
global $wgUseRCPatrol, $wgUseNPPatrol, $wgUseFilePatrol, $wgMiserMode;
$dbw = $this->getPrimaryDB();
Function rebuildRecentChangesTablePass2
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
private function rebuildRecentChangesTablePass2() {
$dbw = $this->getPrimaryDB();
$this->output( "Updating links and size differences...\n" );
- 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 rebuildRecentChangesTablePass5
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function rebuildRecentChangesTablePass5() {
$dbw = $this->getPrimaryDB();
$this->output( "Removing duplicate revision and logging entries...\n" );
Function rebuildRecentChangesTablePass1
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
private function rebuildRecentChangesTablePass1() {
$dbw = $this->getPrimaryDB();
$commentStore = $this->getServiceContainer()->getCommentStore();
if ( $this->hasOption( 'from' ) && $this->hasOption( 'to' ) ) {
- 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 execute
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function execute() {
if (
( $this->hasOption( 'from' ) && !$this->hasOption( 'to' ) ) ||
( !$this->hasOption( 'from' ) && $this->hasOption( 'to' ) )
) {
- 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"