Showing 148 of 159 total issues
Function remove
has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring. Open
public static function remove($path = null, array &$logs = array())
{
if (is_null($path)) {
return null;
}
- 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 __construct
has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring. Open
public function __construct(array $options = array())
{
// if (!isset($this->options)) $this->options = array();
$this
->_initOptions()
- 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 getHelpInfo
has 80 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function getHelpInfo(array $options = array(), Formater $formater, $caller)
{
if (!is_object($caller) || !($caller instanceof CommandLineControllerInterface)) {
throw new InvalidArgumentException(
sprintf('Argument 3 for method "%s::getHelpInfo" must be an object and implement the "CommandLineControllerInterface" interface!', __CLASS__)
Response
has 27 functions (exceeds 20 allowed). Consider refactoring. Open
class Response
implements ResponseInterface
{
/**
File Factory.php
has 297 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* This file is part of the Library package.
*
* Copyleft (ↄ) 2013-2016 Pierre Cassat <me@e-piwi.fr> and contributors
Function _parseTableSizes
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
protected function _parseTableSizes($reset = false)
{
if ($reset) $this->_resetSizes();
$this->line_size = count($this->tbody);
foreach (self::$_table_parts as $part) {
- 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 generateUrl
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
public function generateUrl($route_infos, $base_uri = null, $hash = null, $separator = '&')
{
$url_args = $this->getArgumentsMap()->getCollection();
$url = $base_uri;
- 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 organizeArguments
has 69 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function organizeArguments($method_name = null, $arguments = null, $class_name = null, &$logs = array())
{
if (empty($method_name)) {
return;
}
Function __getMethods
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
private function __getMethods($object)
{
$reflection = new ReflectionClass($object);
//get all methods
- 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 findBuilder
has 68 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function findBuilder($name, $flag = self::ERROR_ON_FAILURE, array &$logs = array())
{
$this->flag($flag);
$cc_name = array(TextHelper::toCamelCase($name));
if (!$this->_findClasses($cc_name)) {
Method build
has 67 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function build($name, array $parameters = null, $flag = self::ERROR_ON_FAILURE, array &$logs = array())
{
$this->flag($flag);
$object = null;
$builder_class_name = $this->findBuilder($name, $flag, $logs);
Pagination
has 24 functions (exceeds 20 allowed). Consider refactoring. Open
class Pagination
implements \Iterator
{
/**
Function getRequestUrl
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
public static function getRequestUrl($entities = false, $base = false, $no_file = false, $no_rewrite = false)
{
$protocol = self::getHttpProtocol();
if ($no_rewrite) {
$url = $protocol.'://'.$_SERVER['HTTP_HOST'].$_SERVER['SCRIPT_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
File Cookie.php
has 272 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* This file is part of the Library package.
*
* Copyleft (ↄ) 2013-2016 Pierre Cassat <me@e-piwi.fr> and contributors
Session
has 23 functions (exceeds 20 allowed). Consider refactoring. Open
class Session
implements SessionInterface
{
/**
Router
has 23 functions (exceeds 20 allowed). Consider refactoring. Open
class Router
implements RouterInterface
{
/**
Method render
has 57 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function render($str_pad_flag = STR_PAD_RIGHT)
{
$stacks = array();
if ($this->column_size===0 && $this->line_size===0 && $this->cell_size===0) {
$this->_parseTableSizes();
Function init
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
public function init(
array $initial_services = array(),
array $services_providers = array(),
array $services_protected = 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
Function __getReflection
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
private function __getReflection()
{
if (self::get_objectType() & self::PARSE_FUNC) {
if (function_exists(self::get_objectName()))
$this->reflection = new ReflectionFunction( self::get_objectName() );
- 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 renderTag
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
public function renderTag($content, $tag_type = 'default', array $args = array())
{
switch($tag_type) {
// case of the tables ($content is an array of lines that are an array of cells)
- 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"