Function findOrphanBlobs
has a Cognitive Complexity of 35 (exceeds 5 allowed). Consider refactoring. Open
private function findOrphanBlobs() {
if ( !extension_loaded( 'gmp' ) ) {
echo "Can't find orphan blobs, need bitfield support provided by GMP.\n";
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"
Further reading
File trackBlobs.php
has 332 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* Adds blobs from a given external storage cluster to the blob_tracking table.
*
* This program is free software; you can redistribute it and/or modify
Method findOrphanBlobs
has 83 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function findOrphanBlobs() {
if ( !extension_loaded( 'gmp' ) ) {
echo "Can't find orphan blobs, need bitfield support provided by GMP.\n";
return;
Method trackRevisions
has 76 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function trackRevisions() {
$dbw = $this->getPrimaryDB();
$dbr = $this->getReplicaDB();
$textClause = $this->getTextClause();
Method trackOrphanText
has 71 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function trackOrphanText() {
# Wait until the blob_tracking table is available in the replica DB
$dbw = $this->getPrimaryDB();
$dbr = $this->getReplicaDB();
$this->getServiceContainer()->getDBLoadBalancerFactory()->waitForReplication( [ 'timeout' => 100_000 ] );
Function trackOrphanText
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
private function trackOrphanText() {
# Wait until the blob_tracking table is available in the replica DB
$dbw = $this->getPrimaryDB();
$dbr = $this->getReplicaDB();
$this->getServiceContainer()->getDBLoadBalancerFactory()->waitForReplication( [ 'timeout' => 100_000 ] );
- 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 trackRevisions
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
private function trackRevisions() {
$dbw = $this->getPrimaryDB();
$dbr = $this->getReplicaDB();
$textClause = $this->getTextClause();
- 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"