Function classes
has a Cognitive Complexity of 90 (exceeds 5 allowed). Consider refactoring. Open
public function classes($class_data, $class_name, $table_name = NULL, array $db_relations = NULL)
{
// Сюда соберем код для генерации классов ActiveRecord
$class_eval = '';
- 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 classes
has 138 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function classes($class_data, $class_name, $table_name = NULL, array $db_relations = NULL)
{
// Сюда соберем код для генерации классов ActiveRecord
$class_eval = '';
Function relations
has a Cognitive Complexity of 35 (exceeds 5 allowed). Consider refactoring. Open
public function relations($cachePath = '')
{
// Generate unique file name
$relations_file = $cachePath . '/relations/' . md5(serialize(TableRelation::$instances)) . '.php';
- 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 dbMySQLConnector.php
has 290 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
namespace samson\activerecord;
use samsonframework\orm\Database;
use samson\core\File;
Method relations
has 60 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function relations($cachePath = '')
{
// Generate unique file name
$relations_file = $cachePath . '/relations/' . md5(serialize(TableRelation::$instances)) . '.php';
Method generate
has 56 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function generate($force = false, $cachePath = '')
{
// Processed permanent table relations
$db_relations = array();
Function generate
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
public function generate($force = false, $cachePath = '')
{
// Processed permanent table relations
$db_relations = 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 __build_columns_map
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
private function __build_columns_map($table_name, array & $select = array(), array & $map = array(), array & $alias = array(), $alias_table_name = null)