File Yee.php
has 608 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* Yee - a tiny PHP 5 framework
*
* @author Andreas Maier <info@yeephp.com>
Yee
has 65 functions (exceeds 20 allowed). Consider refactoring. Open
class Yee
{
/**
* @const string
*/
Function call
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
public function call()
{
try {
if (isset($this->environment['yee.flash'])) {
$this->view()->setData('flash', $this->environment['yee.flash']);
- 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 __construct
has 51 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function __construct(array $userSettings = array())
{
// Setup IoC container
$this->container = new \Yee\Helper\Set();
$this->container['settings'] = array_merge(static::getDefaultSettings(), $userSettings);
Function applyHook
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
public function applyHook($name, $hookArg = null)
{
if (!isset($this->hooks[$name])) {
$this->hooks[$name] = array(array());
}
- 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 call
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function call()
{
try {
if (isset($this->environment['yee.flash'])) {
$this->view()->setData('flash', $this->environment['yee.flash']);
Function execute
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
public function execute()
{
set_error_handler(array('\Yee\Yee', 'handleErrors'));
//Apply final outer middleware layers
- 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 setEncryptedCookie
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
public function setEncryptedCookie($name, $value, $expires = null, $path = null, $domain = null, $secure = false, $httponly = false)
Method setCookie
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
public function setCookie($name, $value, $time = null, $path = null, $domain = null, $secure = null, $httponly = null)
Method deleteCookie
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
public function deleteCookie($name, $path = null, $domain = null, $secure = null, $httponly = null)
Avoid too many return
statements within this method. Open
return is_object($logWriter) ? $logWriter : new \Yee\LogWriter($c['environment']['yee.errors']);
Avoid too many return
statements within this method. Open
return $mode;
Avoid too many return
statements within this method. Open
return $view;
Avoid too many return
statements within this method. Open
return $log;
Function config
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function config($name, $value = null)
{
$c = $this->container;
if (is_array($name)) {
- 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 etag
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function etag($value, $type = 'strong')
{
//Ensure type is correct
if (!in_array($type, array('strong', 'weak'))) {
throw new \InvalidArgumentException('Invalid Yee::etag type. Expected "strong" or "weak".');
- 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"