Showing 52 of 52 total issues
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
*/
Request
has 40 functions (exceeds 20 allowed). Consider refactoring. Open
class Request
{
const METHOD_HEAD = 'HEAD';
const METHOD_GET = 'GET';
const METHOD_POST = 'POST';
Response
has 33 functions (exceeds 20 allowed). Consider refactoring. Open
class Response implements \ArrayAccess, \Countable, \IteratorAggregate
{
/**
* @var int HTTP status code
*/
Function setCookieHeader
has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring. Open
public static function setCookieHeader(&$header, $name, $value)
{
//Build cookie header
if (is_array($value)) {
$domain = '';
- 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
Route
has 27 functions (exceeds 20 allowed). Consider refactoring. Open
class Route
{
/**
* @var string The route pattern (e.g. "/books/:id")
*/
File Request.php
has 272 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* Yee - a tiny PHP 5 framework
*
* @author Andreas Maier <info@yeephp.com>
Set
has 22 functions (exceeds 20 allowed). Consider refactoring. Open
class Set implements \ArrayAccess, \Countable, \IteratorAggregate
{
/**
* Key-value array of arbitrary data
* @var array
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
Function readdir
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
protected static function readdir($dir)
{
$entries = array();
foreach (scandir($dir) as $entry) {
if(($entry != '.') && ($entry != '..')){
- 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
Log
has 21 functions (exceeds 20 allowed). Consider refactoring. Open
class Log
{
const EMERGENCY = 1;
const ALERT = 2;
const CRITICAL = 3;
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 post
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
public function post($key = null, $default = null)
{
if (!isset($this->env['yee.input'])) {
throw new \RuntimeException('Missing Yee.input in environment variables');
}
- 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 log
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
public function log($level, $object, $context = array())
{
if (!isset(self::$levels[$level])) {
throw new \InvalidArgumentException('Invalid log level supplied to function');
} else if ($this->enabled && $this->writer && $level <= $this->level) {
- 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 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']);
Method setCookieHeader
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function setCookieHeader(&$header, $name, $value)
{
//Build cookie header
if (is_array($value)) {
$domain = '';
Function processClass
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
protected function processClass($classFile)
{
$className = '';
$content = file_get_contents($classFile);
$result = '';
- 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 getMatchedRoutes
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
public function getMatchedRoutes($httpMethod, $resourceUri, $reload = false)
{
if ($reload || is_null($this->matchedRoutes)) {
$this->matchedRoutes = array();
foreach ($this->routes as $route) {
- 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 processClass
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function processClass($classFile)
{
$className = '';
$content = file_get_contents($classFile);
$result = '';