Showing 51 of 51 total issues
Function replaceInterfaceDependencies
has a Cognitive Complexity of 54 (exceeds 5 allowed). Consider refactoring. Open
public function replaceInterfaceDependencies(array $metadataCollection) {
$list = [];
$listPath = [];
/** @var ClassMetadata $classMetadata */
- 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 dir
has a Cognitive Complexity of 42 (exceeds 5 allowed). Consider refactoring. Open
public static function dir($path, $type = null, $modifier = '', & $result = array(), $max_level = NULL, $level = 0, $restrict = array('.git', '.svn', '.hg', '.settings'))
{
// Если установлено ограничение на глубину - выйдем
if (isset($max_level) && $level > $max_level) return $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 handler
has a Cognitive Complexity of 35 (exceeds 5 allowed). Consider refactoring. Open
public function handler($errno, $error_msg, $errfile = NULL, $errline = NULL, $errcontext = NULL, $backtrace = NULL)
{
// Если вывод ошибок включен
if (!self::$OUTPUT) 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 init
has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring. Open
public function init()
{
$containerPath = __DIR__ . '/../../../../../www/cache';
$containerName = 'ContainerCore';
$containerNamespace = 'samsonphp\core\loader';
- 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 handler
has 97 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function handler($errno, $error_msg, $errfile = NULL, $errline = NULL, $errcontext = NULL, $backtrace = NULL)
{
// Если вывод ошибок включен
if (!self::$OUTPUT) return NULL;
File Utils2.php
has 307 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* Get difference time entities between two dates
*
Method init
has 78 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function init()
{
$containerPath = __DIR__ . '/../../../../../www/cache';
$containerName = 'ContainerCore';
$containerNamespace = 'samsonphp\core\loader';
Module
has 25 functions (exceeds 20 allowed). Consider refactoring. Open
class Module implements \ArrayAccess, iModule
{
/** Static module instances collection */
public static $instances = array();
Function oldModule
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
protected static function oldModule($className, $nameSpace, & $file = null)
{
//elapsed('++ Autoloading '.$value.' from '.$nameSpace);
// Convert to linux path, windows will convert it automatically if necessary
- 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 replaceInterfaceDependencies
has 61 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function replaceInterfaceDependencies(array $metadataCollection) {
$list = [];
$listPath = [];
/** @var ClassMetadata $classMetadata */
Function buildXMLConfig
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
public function buildXMLConfig(array $classesMetadata, string $path)
{
foreach ($classesMetadata as $alias => $classMetadata) {
$dom = new \DOMDocument("1.0", "utf-8");
$dom->preserveWhiteSpace = false;
- 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
Consider simplifying this complex logical expression. Open
if (file_exists($classPath)
&& !preg_match('/\/api\/generated\//', $className)
&& !preg_match('/activerecord\/dbQuery/', $className)
&& !preg_match('/samson\/activerecord\//', $className)
&& !preg_match('/Field.php$/', $classPath)
Function getModule
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
public function getModule(string $moduleName) : Module
{
// Check if module exists
if (!array_key_exists($moduleName, $this->composerModules)) {
throw new \Exception(sprintf('Module with name "%s" not found', $moduleName));
- 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 buildXMLConfig
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function buildXMLConfig(array $classesMetadata, string $path)
{
foreach ($classesMetadata as $alias => $classMetadata) {
$dom = new \DOMDocument("1.0", "utf-8");
$dom->preserveWhiteSpace = false;
Function prepareModules
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
protected function prepareModules(array $modules, $container)
{
foreach ($modules as $module) {
$identifier = $module->name;
if ($module->className) {
- 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 copy
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
public static function copy($path, $dest)
{
// Если это папка
if (is_dir($path)) {
// Создадим папку в том месте куда нужно копировать, если её там нет
- 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 oldModule
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected static function oldModule($className, $nameSpace, & $file = null)
{
//elapsed('++ Autoloading '.$value.' from '.$nameSpace);
// Convert to linux path, windows will convert it automatically if necessary
Function debug_parse_args
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
function & debug_parse_args(array $args)
{
// Соберем сюда описание аргументов функции
$result = 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 render
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function render($view, $data = array())
{
// TODO: Make rendering as external system, to split up these 3 rendering options
// Объявить ассоциативный массив переменных в данном контексте
Method getModule
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getModule(string $moduleName) : Module
{
// Check if module exists
if (!array_key_exists($moduleName, $this->composerModules)) {
throw new \Exception(sprintf('Module with name "%s" not found', $moduleName));