Showing 188 of 604 total issues
Function getModel
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
function getModel(\SwaggerValidator\Common\Context $context, $listParameters)
{
foreach ($this->keys() as $key) {
$model = null;
$in = 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 checkConsume
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
protected function checkConsume(\SwaggerValidator\Common\Context $context)
{
if (!isset($this->consume)) {
return true;
}
- 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 apache_request_headers
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
function apache_request_headers()
{
$arh = array();
foreach ($_SERVER as $key => $val) {
- 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 validate
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function validate(\SwaggerValidator\Common\Context $context)
{
if ($context->getLocation() !== \SwaggerValidator\Common\FactorySwagger::LOCATION_FORM) {
return $context->setDataCheck('location/type')->setValidationError(\SwaggerValidator\Common\Context::VALIDATION_TYPE_SWAGGER_ERROR, null, __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 getExampleFormat
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
protected function getExampleFormat(\SwaggerValidator\Common\Context $context)
{
if ($this->format == 'byte') {
/**
* @see RFC 4648 : http://www.ietf.org/rfc/rfc4648.txt
- 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 formatModel
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
protected function formatModel(\SwaggerValidator\Common\Context $context, $value)
{
$keyIn = \SwaggerValidator\Common\FactorySwagger::KEY_IN;
$keyType = \SwaggerValidator\Common\FactorySwagger::KEY_IN;
- 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
Consider simplifying this complex logical expression. Open
if (!empty($originType) && !empty($originKey) && !in_array($originType, $notCustom) && substr($originKey, 0, strlen($keyCustom)) === $keyCustom) {
return $jsonData;
}
elseif (empty($originType) && !empty($originKey) && substr($originKey, 0, strlen($keyCustom)) === $keyCustom) {
return $jsonData;
Method logReference
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
public function logReference($type, $ref, $oldRef = null, $method = null, $line = null);
Method returnBuildObject
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
protected function returnBuildObject(\SwaggerValidator\Common\Context $context, \SwaggerValidator\Common\CollectionSwagger $object, $originType, $originKey, &$jsonData)
Method logReference
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
public function logReference($type, $ref, $oldRef = null, $method = null, $line = null)
Method getMethodGeneric
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
protected function getMethodGeneric(\SwaggerValidator\Common\Context $context, $method, $generalItems = array(), $typeKey = null, $params = array())
Function registerCallable
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function registerCallable(\SwaggerValidator\Common\Context $context, $type, $callable)
{
if (!$this->__isset($type)) {
$context->throwException('Cannot find type : "' . $type . '" (Normalized : "' . $this->normalizeType($type) . '" ', __FILE__, __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 extractReferenceArray
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
private function extractReferenceArray(\SwaggerValidator\Common\Context $context, array &$array)
{
$refList = array();
foreach ($array 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 getModel
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function getModel(\SwaggerValidator\Common\Context $context)
{
$result = new \stdClass();
foreach ($this->properties as $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 format
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
protected function format(\SwaggerValidator\Common\Context $context, $valueParams)
{
if (!isset($this->format)) {
return true;
}
- 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 getModelConsumeProduce
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
protected function getModelConsumeProduce($generalItems = array())
{
$list = array(
\SwaggerValidator\Common\FactorySwagger::KEY_CONSUMES,
\SwaggerValidator\Common\FactorySwagger::KEY_PRODUCES,
- 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 getModel
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function getModel(\SwaggerValidator\Common\Context $context, $globalResponse = array())
{
$headersKey = \SwaggerValidator\Common\FactorySwagger::KEY_HEADERS;
$schemaKey = \SwaggerValidator\Common\FactorySwagger::KEY_SCHEMA;
- 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 validate
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function validate(\SwaggerValidator\Common\Context $context)
{
if ($context->getType() !== \SwaggerValidator\Common\Context::TYPE_REQUEST) {
return true;
}
- 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 extractReferenceArray
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
private function extractReferenceArray(\SwaggerValidator\Common\Context $context, array &$array)
{
$refList = array();
foreach ($array 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 jsonUnSerialize
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function jsonUnSerialize(\SwaggerValidator\Common\Context $context, $jsonData)
{
$this->checkJsonObjectOrArray($context, $jsonData);
$keyType = \SwaggerValidator\Common\FactorySwagger::KEY_TYPE;
- 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"