File Worksheet.php
has 617 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
namespace Xls;
class Worksheet extends BIFFwriter
Worksheet
has 70 functions (exceeds 20 allowed). Consider refactoring. Open
class Worksheet extends BIFFwriter
{
const BOF_TYPE = 0x0010;
const STATE_VISIBLE = 0x00;
Method positionImage
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function positionImage($colStart, $rowStart, $x1, $y1, $width, $height)
{
// Initialise end cell to the same as the start cell
$colEnd = $colStart; // Col containing lower right corner of object
$rowEnd = $rowStart; // Row containing bottom right corner of object
Method insertBitmap
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
public function insertBitmap($row, $col, $path, $x = 0, $y = 0, $scaleX = 1, $scaleY = 1)
Function writeRow
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function writeRow($row, $col, $val, $format = null)
{
if (is_array($val)) {
foreach ($val as $v) {
if (is_array($v)) {
- 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 positionImage
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
protected function positionImage($colStart, $rowStart, $x1, $y1, $width, $height)
Method __construct
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
$name,
$index,
$workbook,
$sst,
$urlFormat,
Method writeUrl
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
public function writeUrl($row, $col, $url, $label = '', $format = null)
Method setValidation
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
public function setValidation($row1, $col1, $row2, $col2, $validator)
Avoid too many return
statements within this method. Open
return null;
Function calculateActivePane
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
protected function calculateActivePane($x, $y)
{
if ($x != 0 && $y != 0) {
return 0; // Bottom right
} elseif ($x != 0 && $y == 0) {
- 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 positionImage
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
protected function positionImage($colStart, $rowStart, $x1, $y1, $width, $height)
{
// Initialise end cell to the same as the start cell
$colEnd = $colStart; // Col containing lower right corner of object
$rowEnd = $rowStart; // Row containing bottom right corner of object
- 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"