File namespaceDupes.php
has 503 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* Check for articles to fix after adding/deleting namespaces
*
* Copyright © 2005-2007 Brooke Vibber <bvibber@wikimedia.org>
Function checkNamespace
has a Cognitive Complexity of 39 (exceeds 5 allowed). Consider refactoring. Open
private function checkNamespace( $ns, $name, $options ) {
$targets = $this->getTargetList( $ns, $name, $options );
$count = $targets->numRows();
$this->totalPages += $count;
if ( $count == 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 checkLinkTable
has a Cognitive Complexity of 38 (exceeds 5 allowed). Consider refactoring. Open
private function checkLinkTable( $table, $fieldPrefix, $ns, $name, $options,
$extraConds = []
) {
$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 checkLinkTable
has 124 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function checkLinkTable( $table, $fieldPrefix, $ns, $name, $options,
$extraConds = []
) {
$dbw = $this->getPrimaryDB();
Function checkAll
has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring. Open
private function checkAll( $options ) {
$contLang = $this->getServiceContainer()->getContentLanguage();
$spaces = [];
// List interwikis first, so they'll be overridden
- 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 checkNamespace
has 80 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function checkNamespace( $ns, $name, $options ) {
$targets = $this->getTargetList( $ns, $name, $options );
$count = $targets->numRows();
$this->totalPages += $count;
if ( $count == 0 ) {
Method checkAll
has 70 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function checkAll( $options ) {
$contLang = $this->getServiceContainer()->getContentLanguage();
$spaces = [];
// List interwikis first, so they'll be overridden
Method movePage
has 49 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function movePage( $id, LinkTarget $newLinkTarget ) {
$dbw = $this->getPrimaryDB();
$dbw->newUpdateQueryBuilder()
->update( 'page' )
Method mergePage
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function mergePage( $row, Title $newTitle ) {
$dbw = $this->getPrimaryDB();
$updateRowsPerQuery = $this->getConfig()->get( MainConfigNames::UpdateRowsPerQuery );
$id = $row->page_id;
Function movePage
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
private function movePage( $id, LinkTarget $newLinkTarget ) {
$dbw = $this->getPrimaryDB();
$dbw->newUpdateQueryBuilder()
->update( 'page' )
- 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 checkLinkTable
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
private function checkLinkTable( $table, $fieldPrefix, $ns, $name, $options,
$extraConds = []