File UrlArchiveTrait.php
has 331 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* @license see LICENSE
*/
Function resolveAsAlterableUrl
has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring. Open
private function resolveAsAlterableUrl($url, $as)
{
$delta = call_user_func([$as, 'fromString'], $url);
if (!($scheme = $delta->getScheme())) {
- 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 resolveAsAlterableUrl
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function resolveAsAlterableUrl($url, $as)
{
$delta = call_user_func([$as, 'fromString'], $url);
if (!($scheme = $delta->getScheme())) {
Function getAuthority
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
public function getAuthority()
{
$authority = '';
if ($host = $this->getHost()) {
- 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 parseStr
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function parseStr($str)
{
if (!$str) {
return [];
Method cloneAs
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function cloneAs($as = null)
{
if (null === $as) {
$as = static::class;
Method initWithDefaults
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
$scheme = null,
$host = null,
$path = null,
array $query = [],
$hash = null,
Function resolve
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public function resolve($url, $as = null)
{
if (null === $as) {
$as = static::class;
$implements = class_implements($as, true);
- 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 initWithDefaults
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
private function initWithDefaults(
$scheme = null,
$host = null,
$path = null,
array $query = [],
- 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 cloneAs
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function cloneAs($as = null)
{
if (null === $as) {
$as = static::class;
- 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 buildUrl
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function buildUrl()
{
$scheme = $this->getScheme();
if ($scheme) {
$uri = $scheme . ':';
- 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"