mambax7/extcal

View on GitHub
class/pear/Calendar/Engine/PearDate.php

Summary

Maintainability
C
1 day
Test Coverage

Calendar_Engine_PearDate has 25 functions (exceeds 20 allowed). Consider refactoring.
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
Severity: Minor
Found in class/pear/Calendar/Engine/PearDate.php - About 2 hrs to fix

    Function adjustDate has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
    Open

        public function adjustDate(&$y, &$m, &$d, &$h, &$i, &$s)
        {
            if ($s < 0) {
                $m -= floor($s / _EXTCAL_TS_MINUTE);
                $s = -$s % _EXTCAL_TS_MINUTE;
    Severity: Minor
    Found in class/pear/Calendar/Engine/PearDate.php - About 2 hrs to fix

    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

        public function adjustDate(&$y, &$m, &$d, &$h, &$i, &$s)
        {
            if ($s < 0) {
                $m -= floor($s / _EXTCAL_TS_MINUTE);
                $s = -$s % _EXTCAL_TS_MINUTE;
    Severity: Minor
    Found in class/pear/Calendar/Engine/PearDate.php - About 1 hr to fix

      Method dateToStamp has 6 arguments (exceeds 4 allowed). Consider refactoring.
      Open

          public function dateToStamp($y, $m, $d, $h = 0, $i = 0, $s = 0)
      Severity: Minor
      Found in class/pear/Calendar/Engine/PearDate.php - About 45 mins to fix

        Method adjustDate has 6 arguments (exceeds 4 allowed). Consider refactoring.
        Open

            public function adjustDate(&$y, &$m, &$d, &$h, &$i, &$s)
        Severity: Minor
        Found in class/pear/Calendar/Engine/PearDate.php - About 45 mins to fix

          Method getSecondsInMinute has 5 arguments (exceeds 4 allowed). Consider refactoring.
          Open

              public function getSecondsInMinute($y = null, $m = null, $d = null, $h = null, $i = null)
          Severity: Minor
          Found in class/pear/Calendar/Engine/PearDate.php - About 35 mins to fix

            There are no issues that match your filters.

            Category
            Status