speedworks/speedy

View on GitHub

Showing 27 of 149 total issues

Method set has 7 arguments (exceeds 4 allowed). Consider refactoring.
Open

    public static function set($cookieName, $cookieValue=null, $expiryDays=365, $path=null, $domain=null, $secure=null, $httpOnly=null)
Severity: Major
Found in Core/Classes/Cookie.php - About 50 mins to fix

    Function MakeLog has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
    Open

        public static function MakeLog($logdir, $filename, $logstr)
        {
            $logstr .= "\n";
            if(is_dir($logdir.date('Y')))
            {
    Severity: Minor
    Found in Core/Classes/System.php - About 45 mins 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

    Function Pass has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
    Open

        public static function Pass($requestUri, $requestMethod, $requestData, $rawData)
        {
            if(!array_key_exists($requestMethod,Route::$URLS))
            {
                System::GiveError(405,"Method not allowed");
    Severity: Minor
    Found in Core/Bridge.php - About 45 mins 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 setEngine has 6 arguments (exceeds 4 allowed). Consider refactoring.
    Open

        public function setEngine($engine, $host=null, $port=null, $user=null, $password=null, $encryption=null)
    Severity: Minor
    Found in Core/Classes/Mailer.php - About 45 mins to fix

      Function DBD has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
      Open

          public static function DBD($inData, $die=false) //DEBUG AND DIE
          {
              if(is_array($inData))
              {
                  echo "<pre><br/>\n";
      Severity: Minor
      Found in Core/Classes/System.php - About 35 mins 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

      Function corePHPMailer has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
      Open

          private function corePHPMailer($options)
          {
              $options = null;
              $this->mailHeaders[] = "MIME-Version: 1.0";
              $this->mailHeaders[] = "Content-Type: ".$this->mailContentType;
      Severity: Minor
      Found in Core/Classes/Mailer.php - About 35 mins 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

      Function delete has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
      Open

          public static function delete($cookieName = null)
          {
              if($cookieName == null)
              {
                  if (isset($_SERVER['HTTP_COOKIE']))
      Severity: Minor
      Found in Core/Classes/Cookie.php - About 25 mins 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

      Severity
      Category
      Status
      Source
      Language