Showing 87 of 92 total issues
Function processObject
has a Cognitive Complexity of 271 (exceeds 5 allowed). Consider refactoring. Open
private function processObject($data, Context $options, $path, $result = null)
{
$import = $options->import;
$hasMapping = $this->properties !== null && isset($this->properties->__dataToProperty[$options->mapping]);
- 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 unicodeValidationError
has 625 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function unicodeValidationError($data, &$sanitized = null)
{
static $excluded = array(
"\xD9\x80" => '\u0640',
"\xDF\xBA" => '\u07FA',
File Schema.php
has 1068 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
namespace Swaggest\JsonSchema;
File Iri.php
has 664 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
namespace Swaggest\JsonSchema\Constraint\Format;
class Iri
Method processObject
has 293 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function processObject($data, Context $options, $path, $result = null)
{
$import = $options->import;
$hasMapping = $this->properties !== null && isset($this->properties->__dataToProperty[$options->mapping]);
Function process
has a Cognitive Complexity of 57 (exceeds 5 allowed). Consider refactoring. Open
public function process($data, Context $options, $path = '#', $result = null)
{
$origData = $data;
$import = $options->import;
- 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 resolveReference
has a Cognitive Complexity of 49 (exceeds 5 allowed). Consider refactoring. Open
public function resolveReference($referencePath)
{
if ($this->resolutionScope) {
$referencePath = Helper::resolveURI($this->resolutionScope, $referencePath);
}
- 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 provider
has a Cognitive Complexity of 43 (exceeds 5 allowed). Consider refactoring. Open
private static function provider($path)
{
$testCases = array();
if ($handle = opendir($path)) {
- 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 provider
has a Cognitive Complexity of 43 (exceeds 5 allowed). Consider refactoring. Open
private static function provider($path)
{
$testCases = array();
if ($handle = opendir($path)) {
- 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 validationError
has a Cognitive Complexity of 39 (exceeds 5 allowed). Consider refactoring. Open
public static function validationError($data, $options = 0)
{
if ($options === Uri::IS_URI_TEMPLATE) {
$opened = false;
for ($i = 0; $i < strlen($data); ++$i) {
- 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
Schema
has 42 functions (exceeds 20 allowed). Consider refactoring. Open
class Schema extends JsonSchema implements MetaHolder, SchemaContract, HasDefault
{
const ENUM_NAMES_PROPERTY = 'x-enum-names';
const CONST_PROPERTY = 'const';
const DEFAULT_PROPERTY = 'default';
Function processArray
has a Cognitive Complexity of 35 (exceeds 5 allowed). Consider refactoring. Open
private function processArray($data, Context $options, $path, $result)
{
$count = count($data);
if (!$options->skipValidation) {
if ($this->minItems !== null && $count < $this->minItems) {
- 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 process
has a Cognitive Complexity of 32 (exceeds 5 allowed). Consider refactoring. Open
public static function process(Context $options, $encoding, $mediaType, $data, $import = true)
{
if ($import) {
if ($encoding !== null) {
switch ($encoding) {
- 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 processNumeric
has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring. Open
private function processNumeric($data, $path)
{
if ($this->multipleOf !== null) {
$div = $data / $this->multipleOf;
if ($div != (int)$div && ($div = $data * (1 / $this->multipleOf)) && ($div != (int)$div)) {
- 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 process
has 107 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function process($data, Context $options, $path = '#', $result = null)
{
$origData = $data;
$import = $options->import;
Function jsonSerialize
has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring. Open
#[\ReturnTypeWillChange]
public function jsonSerialize()
{
$result = new \stdClass();
$schema = static::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
Method processArray
has 69 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function processArray($data, Context $options, $path, $result)
{
$count = count($data);
if (!$options->skipValidation) {
if ($this->minItems !== null && $count < $this->minItems) {
Function getSchemaPointers
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
public static function getSchemaPointers($path, $isURIFragmentId = false)
{
$items = explode('->', $path);
unset($items[0]);
$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 processEnum
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
private function processEnum($data, $path = '#')
{
$enumOk = false;
foreach ($this->enum as $item) {
if ($item === $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
Method resolveReference
has 64 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function resolveReference($referencePath)
{
if ($this->resolutionScope) {
$referencePath = Helper::resolveURI($this->resolutionScope, $referencePath);
}