Showing 188 of 604 total issues
Function buildObjectFromOriginObject
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
protected function buildObjectFromOriginObject(\SwaggerValidator\Common\Context $context, $originType, $originKey, &$jsonData)
{
$keyIn = self::KEY_IN;
$keyName = self::KEY_NAME;
$object = 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 jsonSerialize
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
public function jsonSerialize()
{
if (parent::__isset(\SwaggerValidator\Common\FactorySwagger::KEY_SCHEMA)) {
return parent::jsonSerialize();
}
- 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 13 (exceeds 5 allowed). Consider refactoring. Open
protected function format(\SwaggerValidator\Common\Context $context, $valueParams)
{
if (!$this->__isset('format') || empty($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
Method getMethodGeneric
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function getMethodGeneric(\SwaggerValidator\Common\Context $context, $method, $generalItems = array(), $typeKey = null, $params = array())
{
if (!is_array($generalItems) && empty($typeKey)) {
$generalItems = array(
\SwaggerValidator\Common\FactorySwagger::KEY_PARAMETERS => array(),
Method format
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function format(\SwaggerValidator\Common\Context $context, $valueParams)
{
if (!$this->__isset('format') || empty($this->format)) {
return true;
}
Method __construct
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function __construct(\SwaggerValidator\Common\Context $context, $filepath)
{
$this->fileUri = $filepath;
$urlPart = parse_url($filepath);
Method dataLoad
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function dataLoad()
{
$paramName = $this->__get('DataPath');
$paramName = array_pop($paramName);
Function dataLoad
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
public function dataLoad()
{
$paramName = $this->__get('DataPath');
$paramName = array_pop($paramName);
- 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 getMethodGeneric
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
protected function getMethodGeneric(\SwaggerValidator\Common\Context $context, $method, $generalItems = array(), $typeKey = null, $params = array())
{
if (!is_array($generalItems) && empty($typeKey)) {
$generalItems = array(
\SwaggerValidator\Common\FactorySwagger::KEY_PARAMETERS => array(),
- 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 format
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function format(\SwaggerValidator\Common\Context $context, $valueParams)
{
if (!isset($this->format)) {
return true;
}
Method validate
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function validate(\SwaggerValidator\Common\Context $context, $valueParams = null)
{
$result = true;
$lastKey = null;
$keySchema = \SwaggerValidator\Common\FactorySwagger::KEY_SCHEMA;
Method validate
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function validate(\SwaggerValidator\Common\Context $context)
{
if (!isset($this->type)) {
return $context->setValidationError(\SwaggerValidator\Common\Context::VALIDATION_TYPE_SWAGGER_ERROR, null, __METHOD__, __LINE__);
}
Method jsonSerialize
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function jsonSerialize()
{
if (parent::__isset(\SwaggerValidator\Common\FactorySwagger::KEY_SCHEMA)) {
return parent::jsonSerialize();
}
Method jsonUnSerialize
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function jsonUnSerialize(\SwaggerValidator\Common\Context $context, $jsonData)
{
$this->checkJsonObjectOrArray($context, $jsonData);
$keyType = \SwaggerValidator\Common\FactorySwagger::KEY_TYPE;
Method jsonUnSerialize
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function jsonUnSerialize(\SwaggerValidator\Common\Context $context, $originType, $originKey, &$jsonData)
{
$keyType = self::KEY_TYPE;
$keyCustom = self::KEY_CUSTOM_PATTERN;
$notCustom = array(
Method getExampleFormat
has 33 lines of code (exceeds 25 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
Method buildObjectFromOriginKey
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function buildObjectFromOriginKey(\SwaggerValidator\Common\Context $context, $originType, $originKey, &$jsonData)
{
$object = null;
if (!empty(self::$keyToObject[$originKey])) {
Function getReference
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
public function getReference(\SwaggerValidator\Common\Context $context, $ref)
{
$obj = $this->fileObj;
$propertiesList = explode('/', $ref);
array_shift($propertiesList);
- 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 parseQueryAsMulti
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
protected function parseQueryAsMulti($queryString)
{
$params = explode('&', $queryString);
$result = array();
- 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 11 (exceeds 5 allowed). Consider refactoring. Open
public function validate(\SwaggerValidator\Common\Context $context)
{
if (!$this->__isset('type')) {
return $context->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"