symphonycms/symphony-2

View on GitHub
symphony/lib/core/class.symphony.php

Summary

Maintainability
C
1 day
Test Coverage

Symphony has 31 functions (exceeds 20 allowed). Consider refactoring.
Open

abstract class Symphony implements Singleton
{
    /**
     * An instance of the Symphony class, either `Administration` or `Frontend`.
     * @var Symphony
Severity: Minor
Found in symphony/lib/core/class.symphony.php - About 3 hrs to fix

    File class.symphony.php has 312 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    <?php
    
    /**
     * @package core
     */
    Severity: Minor
    Found in symphony/lib/core/class.symphony.php - About 3 hrs to fix

      Method login has 33 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public static function login($username, $password, $isHash = false)
          {
              $username = trim($username);
              $password = trim($password);
      
      
      Severity: Minor
      Found in symphony/lib/core/class.symphony.php - About 1 hr to fix

        Method loginFromToken has 28 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public static function loginFromToken($token)
            {
                $token = trim($token);
        
                if (strlen($token) === 0) {
        Severity: Minor
        Found in symphony/lib/core/class.symphony.php - About 1 hr to fix

          Function getPageNamespace has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
          Open

              public static function getPageNamespace()
              {
                  if (self::$namespace !== false) {
                      return self::$namespace;
                  }
          Severity: Minor
          Found in symphony/lib/core/class.symphony.php - About 1 hr 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 login has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
          Open

              public static function login($username, $password, $isHash = false)
              {
                  $username = trim($username);
                  $password = trim($password);
          
          
          Severity: Minor
          Found in symphony/lib/core/class.symphony.php - About 1 hr 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 throwCustomError has 5 arguments (exceeds 4 allowed). Consider refactoring.
          Open

              public static function throwCustomError($message, $heading = 'Symphony Fatal Error', $status = Page::HTTP_STATUS_ERROR, $template = 'generic', array $additional = array())
          Severity: Minor
          Found in symphony/lib/core/class.symphony.php - About 35 mins to fix

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

                public static function Engine()
                {
                    if (defined('APP_MODE') && APP_MODE === 'administration') {
                        return Administration::instance();
                    } elseif (defined('APP_MODE') && APP_MODE === 'frontend') {
            Severity: Minor
            Found in symphony/lib/core/class.symphony.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

            There are no issues that match your filters.

            Category
            Status