Showing 30 of 41 total issues
File HttpClient.php
has 280 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
namespace Zendesk\API;
/*
Method send
has 63 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function send(
HttpClient $client,
$endPoint,
$options = []
) {
Method getValidSubResources
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function getValidSubResources()
{
return [
'apps' => Apps::class,
'activities' => Activities::class,
Function send
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
public static function send(
HttpClient $client,
$endPoint,
$options = []
) {
- 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 upload
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function upload(array $params, $routeKey = __FUNCTION__)
{
if (! array_key_exists('file', $params)) {
throw new MissingParametersException(__METHOD__, ['file']);
}
Function getRoute
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
public function getRoute($name, array $params = [])
{
$lastChained = $this->getLatestChainedParameter([self::class]);
if ((empty($lastChained)) || ! (in_array($name, ['findAll', 'find', 'create', 'delete']))) {
- 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 upload
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function upload(array $params)
{
if (! $this->hasKeys($params, ['file'])) {
throw new MissingParametersException(__METHOD__, ['file']);
}
Method __construct
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function __construct(
$subdomain,
$username = '',
$scheme = "https",
$hostname = "zendesk.com",
Function getRoute
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public function getRoute($name, array $params = [])
{
$lastChained = $this->getLatestChainedParameter();
$params = $this->addChainedParametersToParams($params, [
'section_id' => Sections::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 getRoute
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public function getRoute($name, array $params = [])
{
$lastChained = $this->getLatestChainedParameter([self::class]);
$chainableRoutes = ['findAll', 'find', 'create', 'delete', 'assignable'];
- 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 getRoute
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public function getRoute($name, array $params = [])
{
$lastChained = $this->getLatestChainedParameter();
$params = $this->addChainedParametersToParams($params, [
'category_id' => Categories::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
Method updateMany
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function updateMany(array $params, $key = 'ids')
{
try {
$route = $this->getRoute(__FUNCTION__);
} catch (RouteException $e) {
Function pageSize
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
protected function pageSize()
{
if (isset($this->pageSize)) {
return $this->pageSize;
} else if (isset($this->params['page[size]'])) {
- 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 __construct
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
$subdomain,
$username = '',
$scheme = "https",
$hostname = "zendesk.com",
$port = 443,
Function __construct
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function __construct($strategy, array $options)
{
if (! in_array($strategy, self::getValidAuthStrategies())) {
throw new AuthException('Invalid auth strategy set, please use `'
. implode('` or `', self::getValidAuthStrategies())
- 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 upload
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function upload(array $params)
{
if (! $this->hasKeys($params, ['file'])) {
throw new MissingParametersException(__METHOD__, ['file']);
}
- 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 upload
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function upload(array $params, $routeKey = __FUNCTION__)
{
if (! array_key_exists('file', $params)) {
throw new MissingParametersException(__METHOD__, ['file']);
}
- 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 getMatches
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function getMatches(array $tokens, array $info = [])
{
$input = $this->getInput($tokens);
array_shift($tokens);
- 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 setDebug
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
$lastRequestHeaders,
$lastRequestBody,
$lastResponseCode,
$lastResponseHeaders,
$lastResponseError
Function getRoute
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function getRoute($name, array $params = [])
{
$lastChained = $this->getLatestChainedParameter();
if (empty($lastChained) || $name !== 'findAll') {
- 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"