Showing 17 of 17 total issues
Request
has 34 functions (exceeds 20 allowed). Consider refactoring. Open
class Request
{
private static $cookie = null;
private static $cookieFile = null;
private static $curlOpts = array();
- Create a ticketCreate a ticket
File Request.php
has 297 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
namespace Unirest;
class Request
- Create a ticketCreate a ticket
Method send
has 74 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function send($method, $url, $body = null, $headers = array(), $username = null, $password = null)
{
self::$handle = curl_init();
if ($method !== Method::GET) {
- Create a ticketCreate a ticket
Function parseHeaders
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
private function parseHeaders($raw_headers)
{
if (function_exists('http_parse_headers')) {
return http_parse_headers($raw_headers);
} else {
- Read upRead up
- Create a ticketCreate a ticket
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 18 (exceeds 5 allowed). Consider refactoring. Open
public static function send($method, $url, $body = null, $headers = array(), $username = null, $password = null)
{
self::$handle = curl_init();
if ($method !== Method::GET) {
- Read upRead up
- Create a ticketCreate a ticket
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 parseHeaders
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function parseHeaders($raw_headers)
{
if (function_exists('http_parse_headers')) {
return http_parse_headers($raw_headers);
} else {
- Create a ticketCreate a ticket
Method send
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
public static function send($method, $url, $body = null, $headers = array(), $username = null, $password = null)
- Create a ticketCreate a ticket
Function buildHTTPCurlQuery
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public static function buildHTTPCurlQuery($data, $parent = false)
{
$result = array();
if (is_object($data)) {
- Read upRead up
- Create a ticketCreate a ticket
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 post
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
public static function post($url, $headers = array(), $body = null, $username = null, $password = null)
- Create a ticketCreate a ticket
Method trace
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
public static function trace($url, $headers = array(), $body = null, $username = null, $password = null)
- Create a ticketCreate a ticket
Method patch
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
public static function patch($url, $headers = array(), $body = null, $username = null, $password = null)
- Create a ticketCreate a ticket
Method head
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
public static function head($url, $headers = array(), $parameters = null, $username = null, $password = null)
- Create a ticketCreate a ticket
Method options
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
public static function options($url, $headers = array(), $parameters = null, $username = null, $password = null)
- Create a ticketCreate a ticket
Method put
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
public static function put($url, $headers = array(), $body = null, $username = null, $password = null)
- Create a ticketCreate a ticket
Method connect
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
public static function connect($url, $headers = array(), $parameters = null, $username = null, $password = null)
- Create a ticketCreate a ticket
Method delete
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
public static function delete($url, $headers = array(), $body = null, $username = null, $password = null)
- Create a ticketCreate a ticket
Method get
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
public static function get($url, $headers = array(), $parameters = null, $username = null, $password = null)
- Create a ticketCreate a ticket