Showing 22 of 38 total issues
Request
has 34 functions (exceeds 20 allowed). Consider refactoring. Open
class Request
{
const GZIP_UA = " (gzip)";
protected $queryParams;
- Create a ticketCreate a ticket
Client
has 24 functions (exceeds 20 allowed). Consider refactoring. Open
class Client
{
const LIBVER = "1.0.0";
const USER_AGENT_SUFFIX = "goracash-api-php-client/";
- Create a ticketCreate a ticket
Method executeRequest
has 65 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function executeRequest(Request $request)
{
$curl = curl_init();
if ($request->getPostBody()) {
- Create a ticketCreate a ticket
Config
has 22 functions (exceeds 20 allowed). Consider refactoring. Open
class Config
{
const GZIP_DISABLED = true;
const GZIP_ENABLED = false;
const GZIP_UPLOADS_ENABLED = true;
- Create a ticketCreate a ticket
Method __construct
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function __construct($iniFileLocation = null)
{
$this->configuration = array(
// The application_name is included in the User-Agent HTTP header.
'application_name' => '',
- Create a ticketCreate a ticket
Function checkFormFields
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
public function checkFormFields(array &$fields)
{
$requiredFields = array('gender', 'firstname', 'lastname', 'email', 'phone', 'offer');
foreach ($requiredFields as $requiredField) {
if ($this->utils->isEmpty($fields[$requiredField])) {
- 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 normalizeParams
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function normalizeParams(array &$params)
{
$availableParams = array(
'date_lbound' => '',
'date_ubound' => '',
- Create a ticketCreate a ticket
Function checkDates
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public function checkDates(array &$params)
{
if (!empty($params['dates'])) {
foreach ($params['dates'] as $date) {
if (!$this->utils->isSystemDate($date)) {
- 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 checkFormFields
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function checkFormFields(array &$fields)
{
$requiredFields = array('gender', 'firstname', 'lastname', 'email', 'phone', 'offer');
foreach ($requiredFields as $requiredField) {
if ($this->utils->isEmpty($fields[$requiredField])) {
- Create a ticketCreate a ticket
Function reverseJsonInContext
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
protected function reverseJsonInContext(array &$context)
{
if (!$context) {
return;
}
- 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 executeRequest
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public function executeRequest(Request $request)
{
$curl = curl_init();
if ($request->getPostBody()) {
- 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 __construct
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public function __construct($config = null)
{
if (is_string($config) && strlen($config)) {
$config = new Config($config);
}
- 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 parseStringHeaders
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
private function parseStringHeaders($rawHeaders)
{
$headers = array();
$responseHeaderLines = explode("\r\n", $rawHeaders);
foreach ($responseHeaderLines as $headerLine) {
- 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 parseHttpResponse
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function parseHttpResponse($respData, $headerSize)
{
// check proxy header
foreach (self::$connectionEstablishedHeaders as $establishedHeader) {
if (stripos($respData, $establishedHeader) !== false) {
- 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 export
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
protected function export($value)
{
if (is_string($value)) {
if ($this->allowNewLines) {
return $value;
- 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 __construct
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function __construct($iniFileLocation = null)
{
$this->configuration = array(
// The application_name is included in the User-Agent HTTP header.
'application_name' => '',
- 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 parseQuery
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
private function parseQuery($string)
{
$return = array();
$parts = explode("&", $string);
foreach ($parts as $part) {
- 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 buildQuery
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
private function buildQuery($parts)
{
$return = array();
foreach ($parts as $key => $value) {
if (is_array($value)) {
- 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
Avoid too many return
statements within this method. Open
return str_replace('\\/', '/', @json_encode($value));
- Create a ticketCreate a ticket
Avoid too many return
statements within this method. Open
return @json_encode($value, $options);
- Create a ticketCreate a ticket