Showing 13 of 13 total issues
RequestParameters
has 21 functions (exceeds 20 allowed). Consider refactoring. Open
class RequestParameters
{
const DEFAULT_PAGE = 1;
const DEFAULT_MAX_RESULTS = 25;
ContentApiSdk
has 21 functions (exceeds 20 allowed). Consider refactoring. Open
class ContentApiSdk
{
/**
* Items endpoint
*/
Function getAssociationsFromPackage
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
public function getAssociationsFromPackage(Package $package)
{
$associations = new stdClass();
if (property_exists($package, 'associations')) {
- 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 parseHttpHeaders
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
private function parseHttpHeaders($headerString)
{
$headers = array();
$key = '';
- 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 processRawBody
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
private function processRawBody()
{
switch ($this->contentType) {
case self::CONTENT_TYPE_JSON:
- 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 processRawBody
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function processRawBody()
{
switch ($this->contentType) {
case self::CONTENT_TYPE_JSON:
Method makeCall
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function makeCall(
$url,
array $headers = array(),
array $options = array(),
$method = 'GET',
Method getAuthenticationTokens
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getAuthenticationTokens()
{
try {
$response = $this->client->makeCall(
$this->getAuthenticationUrl(),
Function __construct
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function __construct(
$hostname = null,
$uri = null,
RequestParameters $parameters = null,
$port = 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 __construct
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
$hostname = null,
$uri = null,
RequestParameters $parameters = null,
$port = null,
$protocol = null
Method makeCall
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
$url,
array $headers = array(),
array $options = array(),
$method = 'GET',
$content = null
Method makeCall
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
$url,
array $headers = array(),
array $options = array(),
$method = 'GET',
$content = null
Function getAuthenticationTokens
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function getAuthenticationTokens()
{
try {
$response = $this->client->makeCall(
$this->getAuthenticationUrl(),
- 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"