class/pear/Calendar/Engine/PearDate.php
Calendar_Engine_PearDate
has 25 functions (exceeds 20 allowed). Consider refactoring. Open
Open
class Calendar_Engine_PearDate /* implements Calendar_Engine_Interface */
{
/**
* Makes sure a given timestamp is only ever parsed once
* Uses a static variable to prevent date() being used twice
Function adjustDate
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
Open
public function adjustDate(&$y, &$m, &$d, &$h, &$i, &$s)
{
if ($s < 0) {
$m -= floor($s / _EXTCAL_TS_MINUTE);
$s = -$s % _EXTCAL_TS_MINUTE;
- 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 adjustDate
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function adjustDate(&$y, &$m, &$d, &$h, &$i, &$s)
{
if ($s < 0) {
$m -= floor($s / _EXTCAL_TS_MINUTE);
$s = -$s % _EXTCAL_TS_MINUTE;
Method dateToStamp
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
public function dateToStamp($y, $m, $d, $h = 0, $i = 0, $s = 0)
Method adjustDate
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
public function adjustDate(&$y, &$m, &$d, &$h, &$i, &$s)
Method getSecondsInMinute
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
public function getSecondsInMinute($y = null, $m = null, $d = null, $h = null, $i = null)