Showing 12 of 12 total issues
Method request
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function request($options = [])
{
$curl = curl_init();
$caPathOrFile = CaBundle::getSystemCaRootBundlePath();
// Set default cURL options
Method cron
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function cron($timeLimit = self::CRON_EXEC_TIME, $workerID = self::WORKER_ID)
{
$start = microtime(true);
$workerID = $this->setWorkerID($workerID);
$log = [];
Method refresh
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function refresh()
{
$client = new UriClient($this->base, $this->curlOptions, $this->byteLimit);
$effective = $client->getEffectiveUri();
if ($effective == $this->base) {
Method client
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function client()
{
$query = $this->pdo->prepare(<<<SQL
SELECT
content,
Method displacePush
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function displacePush($nextUpdate)
{
$query = $this->pdo->prepare(<<<SQL
SELECT
validUntil,
Function arrayDiffAssocRecursive
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
private function arrayDiffAssocRecursive(array &$array1, array &$array2)
{
$difference = [];
foreach ($array1 as $key => &$value) {
if (is_array($value)) {
- 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 cron
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function cron($timeLimit = self::CRON_EXEC_TIME, $workerID = self::WORKER_ID)
{
$start = microtime(true);
$workerID = $this->setWorkerID($workerID);
$log = [];
- 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 __construct
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
$baseUri,
$statusCode,
$content,
$encoding = self::ENCODING,
$effectiveUri = null,
Method callback
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
public function callback($errno, $errstr, $errfile = '', $errline = 0, $errcontext = [])
Function determine
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
private function determine($timestamp)
{
$values = [];
foreach ($this->rates as $array) {
if (!isset($array['from']) ||
- 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 lineBreak
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
private function lineBreak()
{
if ($this->previousRoot !== $this->directive &&
in_array($this->directive, array_keys(RobotsTxtParser::TOP_LEVEL_DIRECTIVES)) ||
$this->previous !== self::DIRECTIVE_USER_AGENT &&
- 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 arrayMergeRecursiveEx
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
private function arrayMergeRecursiveEx(array $array1, array &$array2)
{
foreach ($array2 as $key => &$value) {
if (is_array($value) &&
isset($array1[$key]) &&
- 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"