Showing 51 of 51 total issues
Function set
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public static function set(array $available_locales)
{
// Переберем локализации
foreach ($available_locales as $locale) {
$_locale = strtolower($locale);
- 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
Avoid too many return
statements within this method. Open
return sizeof($var);
Avoid too many return
statements within this method. Open
return (!isset($value) && isset($var{0})) ||
(isset($value) && $var === strval($value));
Avoid too many return
statements within this method. Open
return false;
Avoid too many return
statements within this method. Open
return true;
Function viewContext
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
protected function viewContext($view_path)
{
// Pointer to NEW view data context
$new = &$this->view_data[$view_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
Function __set
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function __set($value, $field = null)
{
if (is_object($field) || is_array($field)) {
$tempValue = $field;
$field = $value;
- 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 view
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function view($viewPath)
{
if (is_a($viewPath, ViewInterface::class)) {
$this->view_path = $viewPath;
return $this;
- 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 createMetadata
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function createMetadata($class, $name, $path, $scope = 'module') : ClassMetadata
{
$metadata = new ClassMetadata();
$class = ltrim($class, '\\');
$name = strtolower(ltrim($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 isval
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
function isval($name, $value = null, $success = null, $failure = null, $inverse = false)
{
// Pointer to current module
$m = m();
- 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 clear
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public static function clear($path, $type = NULL, $ignoreFolders = array())
{
// Если передан путь к папке то удалим все файлы в ней
if (is_dir($path)) {
$files = 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"