Showing 30 of 30 total issues
Method drawRect
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
public function drawRect($x, $y, $width, $height, array $attrs = array())
Method drawLine
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
public function drawLine($x1, $y1, $x2, $y2, array $attrs = array())
Method drawEllipse
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
public function drawEllipse($cx, $cy, $rx, $ry, array $attrs = array())
Avoid too many return
statements within this method. Open
return true;
Function parse
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function parse(Layout $layout)
{
$svg = preg_replace('<%.+?%>', '', $layout->getSVG());
$xml = new \SimpleXMLElement($svg);
- 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 getBounds
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function getBounds()
{
$svg_attrs = $this->getSVGAttributes();
switch (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
Function renderBasicItem
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function renderBasicItem(Item\BasicItem $item)
{
switch (true) {
case $item->isImage():
$this->renderImageItem($item);
- 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 extractItemFormats
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
static public function extractItemFormats($layout_format)
{
preg_match_all('/<!--SHAPE(.*?)SHAPE-->/',
$layout_format, $matched_items, PREG_SET_ORDER);
- 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 createItem
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function createItem(Page $owner, $id)
{
if (!$this->hasItem($id)) {
throw new Exception\StandardException('Item Not Found', $id);
}
- 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 render
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function render(Item\AbstractItem $item)
{
if (!$this->isRenderable($item)) {
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"