Showing 21 of 50 total issues
Function _inlineEscape
has a Cognitive Complexity of 78 (exceeds 5 allowed). Consider refactoring. Open
private function _inlineEscape($inline)
{
// There's gotta be a cleaner way to do this...
// While pure sequences seem to be nesting just fine,
// pure mappings and mappings with sequences inside can't go very
- 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
Yaml
has 56 functions (exceeds 20 allowed). Consider refactoring. Open
class Yaml
{
// SETTINGS
const REMPTY = "\0\0\0\0\0";
Function _toType
has a Cognitive Complexity of 44 (exceeds 5 allowed). Consider refactoring. Open
private function _toType($value)
{
if ($value === '') {
return "";
}
- 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 addArray
has a Cognitive Complexity of 34 (exceeds 5 allowed). Consider refactoring. Open
private function addArray($incoming_data, $incoming_indent)
{
// print_r($incoming_data);
if (\count($incoming_data) > 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
Consider simplifying this complex logical expression. Open
if (
\is_string($value)
&& ((\strpos($value, "\n") !== false || \strpos($value, ": ") !== false || \strpos($value, "- ") !== false
|| \strpos($value, "*") !== false || \strpos($value, "#") !== false || \strpos($value, "<") !== false
|| \strpos($value, ">") !== false || \strpos($value, '%') !== false || \strpos($value, ' ') !== false
Method _inlineEscape
has 101 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function _inlineEscape($inline)
{
// There's gotta be a cleaner way to do this...
// While pure sequences seem to be nesting just fine,
// pure mappings and mappings with sequences inside can't go very
Function loadWithSource
has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring. Open
private function loadWithSource($Source)
{
if (empty($Source)) {
return 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 _dumpNode
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
private function _dumpNode($key, $value, $indent, $previous_key = -1, $first_key = 0, $source_array = null): string
{
// do some folding here, for blocks
if (
\is_string($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 _doLiteralBlock
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
private function _doLiteralBlock($value, int $indent): string
{
if ($value === "\n") {
return '\n';
}
- 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 dump
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public function dump($array, int $indent = null, int $wordwrap = null): string
{
// Dumps to some very clean YAML. We'll have to add some more features
// and options soon. And better support for folding.
- 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 returnKeyValuePair
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
private function returnKeyValuePair($line)
{
$array = array();
$key = '';
if (\strpos($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
Method _yamlize
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
private function _yamlize($key, $value, $indent, $previous_key = -1, $first_key = 0, $source_array = null): string
Method _dumpNode
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
private function _dumpNode($key, $value, $indent, $previous_key = -1, $first_key = 0, $source_array = null): string
Function coerceValue
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
private function coerceValue(&$value)
{
if (self::isTrueWord($value)) {
$value = true;
} else if (self::isFalseWord($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 _parseLine
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
private function _parseLine($line)
{
if (!$line) {
return 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 nodeContainsGroup
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
private function nodeContainsGroup($line)
{
$symbolsForReference = 'A-z0-9_\-';
if (\strpos($line, '&') === false && \strpos($line, '*') === false) {
return false;
- 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 _doFolding
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
private function _doFolding($value, $indent)
{
// Don't do anything if wordwrap is set to 0
if ($this->_dumpWordWrap !== 0 && \is_string($value) && \strlen($value) > $this->_dumpWordWrap) {
$indent += $this->_dumpIndent;
- 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 _yamlizeArray
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
private function _yamlizeArray($array, $indent): string
{
if (\is_array($array)) {
$string = '';
$previous_key = -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
Function revertLiteralPlaceHolder
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
private function revertLiteralPlaceHolder($lineArray, $literalBlock)
{
foreach ($lineArray as $k => $_) {
if (\is_array($_)) {
$lineArray[$k] = $this->revertLiteralPlaceHolder($_, $literalBlock);
- 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 addLiteralLine
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
private function addLiteralLine($literalBlock, $line, $literalBlockStyle, $indent = -1)
{
$line = self::stripIndent($line, $indent);
if ($literalBlockStyle !== '|') {
$line = self::stripIndent($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"