Showing 188 of 604 total issues
Function logReference
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function logReference($type, $ref, $oldRef = null, $method = null, $line = null)
{
if (self::getConfig('log', 'reference') || self::getConfig('log', $type . 'Ref')) {
switch ($type) {
case 'replace':
- 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 setSandBox
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function setSandBox()
{
if ($this->getType() !== self::TYPE_REQUEST) {
return $this;
}
- 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 extractReferenceObject
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
private function extractReferenceObject(\SwaggerValidator\Common\Context $context, \stdClass &$stdClass)
{
$refList = array();
foreach (get_object_vars($stdClass) as $key => $value) {
- 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 extractReferenceObject
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
private function extractReferenceObject(\SwaggerValidator\Common\Context $context, \stdClass &$stdClass)
{
$refList = array();
foreach (get_object_vars($stdClass) as $key => $value) {
- 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 registerRecursiveDefinitionsFromObject
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
protected function registerRecursiveDefinitionsFromObject(\SwaggerValidator\Common\Context $context, \stdClass &$jsonData)
{
if (!is_object($jsonData) || !($jsonData instanceof \stdClass)) {
return;
}
- 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 jsonUnSerialize
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function jsonUnSerialize(\SwaggerValidator\Common\Context $context, $jsonData)
{
parent::checkJsonObject($context, $jsonData);
if (count(get_object_vars($jsonData)) > 1) {
- 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 registerRecursiveDefinitionsFromArray
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
protected function registerRecursiveDefinitionsFromArray(\SwaggerValidator\Common\Context $context, array &$jsonData)
{
if (!is_array($jsonData) || empty($jsonData)) {
return;
}
- 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 loadBodyByContent
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function loadBodyByContent($headers, $rawBody)
{
$contentType = null;
$contentLength = 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 getFileLink
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
private function getFileLink(\SwaggerValidator\Common\Context $context, $uri)
{
$scheme = parse_url($uri, PHP_URL_SCHEME);
if (strtolower($scheme) == '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 setLocation
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function setLocation($value = null)
{
switch (strtolower($value)) {
case \SwaggerValidator\Common\FactorySwagger::LOCATION_BODY:
case 'body':
- 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 jsonUnSerialize
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function jsonUnSerialize(\SwaggerValidator\Common\Context $context, $jsonData)
{
if (!is_object($jsonData)) {
$context->throwException('Mismatching type of JSON Data received', __METHOD__, __LINE__);
}
- 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 unserialize
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function unserialize($data)
{
if (!is_array($data)) {
$data = unserialize($data);
}
- 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
Avoid too many return
statements within this method. Open
return $this->buildPrimitive($context, $originType, $originKey, $jsonData);
Avoid too many return
statements within this method. Open
return $context->setDataCheck('maximum')->setValidationError(\SwaggerValidator\Common\Context::VALIDATION_TYPE_DATASIZE, null, __METHOD__, __LINE__);
Avoid too many return
statements within this method. Open
return $context->setDataCheck('enum')->setValidationError(\SwaggerValidator\Common\Context::VALIDATION_TYPE_DATAVALUE, null, __METHOD__, __LINE__);
Avoid too many return
statements within this method. Open
return $this->validateAllOf($context, $valueParams);
Avoid too many return
statements within this method. Open
return $result;
Avoid too many return
statements within this method. Open
return $this->loadRequestPath($paramName);
Avoid too many return
statements within this method. Open
return $this->loadRequestQuery($paramName);
Avoid too many return
statements within this method. Open
return $context->setValidationError(\SwaggerValidator\Common\Context::VALIDATION_TYPE_SWAGGER_ERROR, $keyOneOf . ' Combined Object Type cannot be empty !', __METHOD__, __LINE__);