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
File class.symphony.php
has 312 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* @package core
*/
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);
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) {
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;
}
- 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 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);
- 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 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())
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') {
- 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"