Request
has 48 functions (exceeds 20 allowed). Consider refactoring. Open
class Request
implements RequestInterface
{
/**
File Request.php
has 374 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* This file is part of the Library package.
*
* Copyleft (ↄ) 2013-2016 Pierre Cassat <me@e-piwi.fr> and contributors
Function buildUrl
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
public function buildUrl()
{
$url = UrlHelper::parse($this->getUrl());
$get = $this->getArguments();
- 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 _extractSegments
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
protected function _extractSegments(&$arguments)
{
if (is_string($arguments)) $this->_extractArguments($arguments);
foreach ($arguments as $var=>$val) {
if (empty($val) && strpos($var, '/')!==false) {
- 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 create
has 10 arguments (exceeds 4 allowed). Consider refactoring. Open
$url = null, $flag = self::NO_REWRITE,
$protocol = 'http', $method = 'get', array $headers = null,
array $arguments = null, array $data = null,
array $session = null, array $files = null, array $cookies = null
Method buildUrl
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function buildUrl()
{
$url = UrlHelper::parse($this->getUrl());
$get = $this->getArguments();
Function getallheaders
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public static function getallheaders()
{
if (function_exists('getallheaders')) {
$return = getallheaders();
} else {
- 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 create
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public static function create(
$url = null, $flag = self::NO_REWRITE,
$protocol = 'http', $method = 'get', array $headers = null,
array $arguments = null, array $data = null,
array $session = null, array $files = null, array $cookies = null
- 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 getData
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
public function getData($param = null, $default = false, $clean = true, $clean_flags = ENT_COMPAT, $clean_encoding = 'UTF-8')
Method getArgument
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
public function getArgument($param = null, $default = false, $clean = true, $clean_flags = ENT_COMPAT, $clean_encoding = 'UTF-8')