Showing 18 of 18 total issues
Request
has 49 functions (exceeds 20 allowed). Consider refactoring. Open
class Request
implements RequestInterface
{
/**
File Request.php
has 397 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* This file is part of the HTTP Fundamental package.
*
* Copyright (c) 2013-2016 Pierre Cassat <me@e-piwi.fr> and contributors
Cookie
has 37 functions (exceeds 20 allowed). Consider refactoring. Open
class Cookie
{
/**
* Transform array values as flatten string (`serialize` like)
Response
has 27 functions (exceeds 20 allowed). Consider refactoring. Open
class Response
implements ResponseInterface
{
/**
File Cookie.php
has 272 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* This file is part of the HTTP Fundamental package.
*
* Copyright (c) 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);
}
- 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();
Method create
has 27 lines of code (exceeds 25 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
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
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 send
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function send($cookie_name = null, $cookie_value = null)
{
if (!empty($cookie_name)) {
$this->setName($cookie_name);
}
- 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 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')
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')
Function loadClass
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function loadClass($className)
{
if ($filePath = $this->resolveFileName($className)) {
if ($this->getFailureFlag() & self::FAIL_GRACEFULLY) {
if ($this->classFileExists($filePath)) {
- 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 _organizeCookieFuncArguments
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
protected function _organizeCookieFuncArguments()
{
$original_args = $this->_arguments;
$this->_arguments = array();
$missing_var = $missing_index = 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
Function prepareContent
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function prepareContent($content)
{
if (is_array($content)) {
$ctt = '';
foreach ($content as $key=>$ctt) {
- 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"