Showing 188 of 604 total issues
File Context.php
has 642 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/*
* Copyright 2016 Nicolas JUHEL <swaggervalidator@nabbar.com>.
*
ContextBase
has 51 functions (exceeds 20 allowed). Consider refactoring. Open
class ContextBase implements \SwaggerValidator\Interfaces\ContextBase
{
/**
*
Context
has 42 functions (exceeds 20 allowed). Consider refactoring. Open
class Context extends ContextBase implements \SwaggerValidator\Interfaces\ContextLog, \SwaggerValidator\Interfaces\ContextDataLoader, \SwaggerValidator\Interfaces\ContextDataParser
{
/*
* Mode Constants
*/
Function validate
has a Cognitive Complexity of 37 (exceeds 5 allowed). Consider refactoring. Open
public function validate(\SwaggerValidator\Common\Context $context)
{
foreach ($this->keys() as $key) {
if (is_object($this->$key) && ($this->$key instanceof \SwaggerValidator\Object\PathItem)) {
continue;
- 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
File ContextBase.php
has 389 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/*
* Copyright 2016 Nicolas JUHEL<swaggervalidator@nabbar.com>.
*
Sandbox
has 32 functions (exceeds 20 allowed). Consider refactoring. Open
class Sandbox
{
/**
*
Function validate
has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring. Open
public function validate(\SwaggerValidator\Common\Context $context)
{
$keyRequired = \SwaggerValidator\Common\FactorySwagger::KEY_REQUIRED;
$keyAdditional = \SwaggerValidator\Common\FactorySwagger::KEY_ADDPROPERTIES;
- 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
File FactorySwagger.php
has 327 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/*
* Copyright 2016 Nicolas JUHEL <swaggervalidator@nabbar.com>.
*
TypeCommon
has 28 functions (exceeds 20 allowed). Consider refactoring. Open
abstract class TypeCommon extends \SwaggerValidator\Common\CollectionSwagger
{
abstract protected function type(\SwaggerValidator\Common\Context $context, $valueParams);
Function getModel
has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring. Open
public function getModel(\SwaggerValidator\Common\Context $context)
{
$result = new \stdClass();
$keyAnyOf = \SwaggerValidator\Common\FactorySwagger::KEY_ANYOF;
$keyAllOf = \SwaggerValidator\Common\FactorySwagger::KEY_ALLOF;
- 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 buildBodyXml
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
public function buildBodyXml($contents)
{
$this->contextDataType = self::CONTENT_TYPE_XML;
$this->contextDataExists = (bool) (strlen($contents) > 0);
$this->contextDataValue = simplexml_load_string($contents);
- 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 19 (exceeds 5 allowed). Consider refactoring. Open
public function validate(\SwaggerValidator\Common\Context $context, $valueParams = null)
{
$result = true;
$lastKey = null;
$keySchema = \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 jsonUnSerialize
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
public function jsonUnSerialize(\SwaggerValidator\Common\Context $context, $jsonData)
{
$this->checkJsonObject($context, $jsonData);
if (property_exists($jsonData, \SwaggerValidator\Common\FactorySwagger::KEY_REFERENCE) && 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
Method setValidationError
has 64 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function setValidationError($valitionType, $messageException = null, $method = null, $line = null)
{
$this->logValidationError($valitionType, $messageException, $method, $line);
if ($this->__get('IsCombined')) {
Collection
has 23 functions (exceeds 20 allowed). Consider refactoring. Open
class Collection implements \Countable, \IteratorAggregate, \ArrayAccess, \Serializable, \JsonSerializable
{
/**
*
CollectionReference
has 22 functions (exceeds 20 allowed). Consider refactoring. Open
class CollectionReference extends \SwaggerValidator\Common\Collection
{
const ID_PREFIX = 'id:';
File TypeCommon.php
has 261 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/*
* Copyright 2016 Nicolas JUHEL <swaggervalidator@nabbar.com>.
*
Function validateTooMany
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
protected function validateTooMany(\SwaggerValidator\Common\Context $context)
{
$sandBox = $context->getSandBoxKeys();
foreach ($context->getRequestDataKeys() as $location => $list) {
- 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 17 (exceeds 5 allowed). Consider refactoring. Open
public function validate(\SwaggerValidator\Common\Context $context)
{
$keyType = \SwaggerValidator\Common\FactorySwagger::KEY_TYPE;
$keyItems = \SwaggerValidator\Common\FactorySwagger::KEY_ITEMS;
$keyAdditional = \SwaggerValidator\Common\FactorySwagger::KEY_ADDITEMS;
- 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 validate
has 53 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function validate(\SwaggerValidator\Common\Context $context)
{
foreach ($this->keys() as $key) {
if (is_object($this->$key) && ($this->$key instanceof \SwaggerValidator\Object\PathItem)) {
continue;