Showing 56 of 58 total issues
Method getDistributionFunctions
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected static function getDistributionFunctions()
{
return array(
// function ptg args class vol
'CONFIDENCE' => array(277, 3, 1, 0),
Method saveSmallData
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function saveSmallData(&$list)
{
$result = '';
$iSmBlk = 0;
foreach ($list as $item) {
Method fact
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function fact()
{
if ($this->currentToken == Token::TOKEN_OPEN) {
$this->advance(); // eat the "("
Method save
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function save($filePath)
{
if ($this->saved) {
throw new \Exception('Workbook was already saved!');
}
Method saveHeader
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function saveHeader($numSbBlocks, $numBbBlocks, $numPpsBlocks)
{
$info = $this->calcBigBlockChain($numSbBlocks, $numBbBlocks, $numPpsBlocks);
$headerEntriesCount = $info["header_list_entries"];
$entriesCount = $info["list_entries"];
Method __construct
has 9 arguments (exceeds 4 allowed). Consider refactoring. Open
$index = null,
$name = null,
$type = null,
$prev = null,
$next = null,
Method getData
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getData($sheet)
{
$printSetup = $sheet->getPrintSetup();
$iPaperSize = $printSetup->getPaperSize(); // Paper size
Function getRangeSheets
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
protected function getRangeSheets($extRef)
{
$extRef = $this->removeTrailingQuotes($extRef);
// Check if there is a sheet range eg., Sheet1:Sheet2.
- 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 func
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function func()
{
$numArgs = 0; // number of arguments received
$function = strtoupper($this->currentToken);
$result = ''; // initialize result
Method getData
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getData($objectId, Range $area, Margin $margin)
{
$objCount = 0x01; // Count of objects in file (set to 1)
$grbit = 0x0614; // Option flags
$data = pack("Vv3", $objCount, static::TYPE, $objectId, $grbit);
Method getData
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getData(XlsFont $font)
{
$dyHeight = $font->getSize() * 20; // Height of font (1/20 of a point)
$icv = $font->getColor(); // Index to color palette
$bls = $font->getBold(); // Bold style
Function advance
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
protected function advance()
{
$token = '';
$position = $this->eatWhitespace();
- 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 func
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
protected function func()
{
$numArgs = 0; // number of arguments received
$function = strtoupper($this->currentToken);
$result = ''; // initialize result
- 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 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 convert
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
protected function convert($token)
{
if (Token::isString($token)) {
return $this->convertString($token);
} elseif (is_numeric($token)) {
- 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 saveBigData
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function saveBigData($iStBlk, &$list)
{
foreach ($list as $item) {
$size = $item->getSize();
if ($size >= self::DATA_SIZE_SMALL
- 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 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,
Consider simplifying this complex logical expression. Open
if ($this->isReference($token)
|| $this->isExternalReference($token)
|| $this->isAnyRange($token)
|| $this->isNumber($token)
|| Token::isString($token)