Showing 89 of 92 total issues
Function padLines
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public static function padLines($with, $text, $skipFirst = true)
{
$lines = explode("\n", $text);
foreach ($lines as $index => $line) {
if ($skipFirst && !$index) {
- 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 makeObjectItem
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function makeObjectItem(Context $options = null)
{
if (null === $this->objectItemClass) {
return new ObjectItem();
} else {
- 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 processIf
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
private function processIf($data, Context $options, $path)
{
$valid = true;
try {
self::unboolSchema($this->if)->process($data, $options, $path . '->if');
- 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 7 (exceeds 5 allowed). Consider refactoring. Open
#[\ReturnTypeWillChange]
public function jsonSerialize()
{
if ($this->__nestedObjects) {
$result = $this->__arrayOfData;
- 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 toArray
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function &toArray()
{
if (!isset($this->__propertyToData[Schema::DEFAULT_MAPPING])) {
return $this->__arrayOfData;
}
- 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 getDataKeyMap
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function getDataKeyMap($mapping = Schema::DEFAULT_MAPPING)
{
if (!isset($this->__dataKeyMaps[$mapping])) {
$map = array();
foreach ($this->__arrayOfData as $propertyName => $property) {
- 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 Iri::validationError($data);
Avoid too many return
statements within this method. Open
return Iri::validationError($data, Uri::IS_URI_REFERENCE);
Avoid too many return
statements within this method. Open
return count(explode('@', $data, 3)) === 2 ? null : 'Invalid email';
Avoid too many return
statements within this method. Open
return filter_var($data, FILTER_VALIDATE_EMAIL) ? null : 'Invalid email';
Avoid too many return
statements within this method. Open
return preg_match(Uri::HOSTNAME_REGEX, $data) ? null : 'Invalid hostname';
Avoid too many return
statements within this method. Open
return null;
Avoid too many return
statements within this method. Open
return self::jsonPointerError($data, true);
Avoid too many return
statements within this method. Open
return 'Missing scheme in URI';
Avoid too many return
statements within this method. Open
return filter_var($data, FILTER_VALIDATE_IP, FILTER_FLAG_IPV4) ? null : 'Invalid ipv4';
Avoid too many return
statements within this method. Open
return Uri::validationError($data, Uri::IS_URI_REFERENCE);
Avoid too many return
statements within this method. Open
return self::jsonPointerError($data);
Avoid too many return
statements within this method. Open
return 'Invalid hostname (too long)';
Avoid too many return
statements within this method. Open
return IdnHostname::validationError($data);
Avoid too many return
statements within this method. Open
return filter_var($data, FILTER_VALIDATE_IP, FILTER_FLAG_IPV6) ? null : 'Invalid ipv6';