Showing 30 of 30 total issues
Method buildTextStyles
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function buildTextStyles(array $attrs)
{
$font_style = array();
foreach ($attrs['font_style'] ?: array() as $style) {
Method drawTextBox
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function drawTextBox($content, $x, $y, $width, $height, array $attrs = array())
{
$styles = $this->buildTextBoxStyles($height, $attrs);
if ($styles['color'] === null) {
Function buildTextStyles
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
public function buildTextStyles(array $attrs)
{
$font_style = array();
foreach ($attrs['font_style'] ?: array() as $style) {
- 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 buildTextBoxStyles
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function buildTextBoxStyles($box_height, array $attrs)
{
$is_single = array_key_exists('single_row', $attrs)
&& $attrs['single_row'] === true;
Method getBounds
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getBounds()
{
$svg_attrs = $this->getSVGAttributes();
switch (true) {
Method renderTextBlockItem
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function renderTextBlockItem(Item\TextBlockItem $item)
{
$format = $item->getFormat();
$bounds = $item->getBounds();
$styles = $this->buildTextStyles($item->exportStyles());
Method buildPageFormat
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function buildPageFormat(Layout $layout)
{
$orientation = $layout->isPortraitPage() ? 'P' : 'L';
if ($layout->isUserPaperType()) {
Function buildGraphicStyles
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public function buildGraphicStyles(array $attrs)
{
if (empty($attrs['stroke_width']) || $attrs['stroke_color'] == 'none') {
$stroke_style = null;
} 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 setTextDecoration
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
private function setTextDecoration($underline = null, $linethrough = null)
{
$decorations = array();
if ($underline === null) {
- 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 drawImage
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
public function drawImage($filename, $x, $y, $width, $height, array $attrs = array())
Method drawBase64Image
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
public function drawBase64Image($base64_string, $x, $y, $width, $height, array $attrs = array())
Function padChars
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
private function padChars($direction, $string, $padstr, $length)
{
while (mb_strlen($string, 'UTF-8') < $length) {
if ($direction == 'L') {
$string = $padstr . $string;
- 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 drawTextBox
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
public function drawTextBox($content, $x, $y, $width, $height, array $attrs = array())
Function format
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function format($value)
{
if ($value === null || $value === '') {
return $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 isRenderable
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function isRenderable(Item\AbstractItem $item)
{
if (!$item->isVisible()) {
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 buildTextBoxStyles
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function buildTextBoxStyles($box_height, array $attrs)
{
$is_single = array_key_exists('single_row', $attrs)
&& $attrs['single_row'] === 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 buildFontStyle
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function buildFontStyle(array $svg_attrs)
{
$styles = array();
if ($svg_attrs['font-weight'] === 'bold') {
- 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 drawText
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
public function drawText($content, $x, $y, $width, $height, array $attrs = array())
Function render
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function render()
{
foreach ($this->items as $attributes) {
$type_name = $attributes['class'];
- 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 buildPageFormat
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function buildPageFormat(Layout $layout)
{
$orientation = $layout->isPortraitPage() ? 'P' : 'L';
if ($layout->isUserPaperType()) {
- 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"