File Utils2.php
has 307 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* Get difference time entities between two dates
*
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 date_format_ru
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
function date_format_ru($date)
{
$date = strtotime($date);
$day = date("d", $date);
$month_en = date("F", $date);
Function array_power_set
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
function array_power_set(array $array, $size = null)
{
// initialize by adding the empty set
$results = 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 time_difference
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
function time_difference($enddate, $startdate = null)
{
// Get current timestamp
if (!isset($startdate)) $startdate = time();
else $startdate = strtotime($startdate);
Method debug_parse_args
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
function & debug_parse_args(array $args)
{
// Соберем сюда описание аргументов функции
$result = array();
Method debug_to_string
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
function debug_to_string($errno = NULL, $file = NULL, $line = NULL, $class = NULL, $function = NULL, $args = NULL)
Method mail_send
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
function mail_send($to, $from = 'info@samsonos.com', $message = '', $subject = '', $from_user = '')
Function debug_to_string
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
function debug_to_string($errno = NULL, $file = NULL, $line = NULL, $class = NULL, $function = NULL, $args = NULL)
{
// Если первым аргументом передан массив, создадим из него переменные
if (is_array($errno)) {
extract($errno);
- 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 debug_parse_markers
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
function debug_parse_markers($pattern, array & $args = NULL)
{
// Текущий номер аргумента для подмены
$a_ind = 0;
- 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"