Showing 27 of 27 total issues
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
File dbMySQL.php
has 401 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
namespace samson\activerecord;
use samsonframework\orm\QueryInterface;
use samsonframework\orm\ConditionInterface;
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 toRecords
has a Cognitive Complexity of 36 (exceeds 5 allowed). Consider refactoring. Open
protected function &toRecords($class_name, array & $response, array $join = array(), array $virtual_fields = array())
{
// Сформируем правильное имя класса
$class_name = strpos($class_name, '\\') !== false ? $class_name : '\\samson\activerecord\\'.$class_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 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 toRecords
has 62 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function &toRecords($class_name, array & $response, array $join = array(), array $virtual_fields = array())
{
// Сформируем правильное имя класса
$class_name = strpos($class_name, '\\') !== false ? $class_name : '\\samson\activerecord\\'.$class_name;
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';
Function prepareSQL
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
protected function prepareSQL($class_name, QueryInterface $query)
{
//elapsed( 'dbMySQL::find() Начало');
$params = $this->__get_table_data($class_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
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 __construct
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
public function __construct( $base_class, $table_name_simple, $relation_class = null, $ignore = false )
{
// If table name passed without namespace consider it as activerecord namespace
$table_name = \samson\core\AutoLoader::className( $table_name_simple, 'samson\activerecord');
- 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 parseCondition
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
protected function parseCondition($class_name, & $arg)
{
// Получим переменные для запроса
extract($this->__get_table_data($class_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
Method prepareSQL
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function prepareSQL($class_name, QueryInterface $query)
{
//elapsed( 'dbMySQL::find() Начало');
$params = $this->__get_table_data($class_name);
// Получим переменные для запроса
Function migration
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
public function migration($classname, $version_handler)
{
if (!is_callable($version_handler)) {
return e('No version handler is passed', E_SAMSON_ACTIVERECORD_ERROR);
}
- 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 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 __get_table_data
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function __get_table_data($class_name)
{
// Remove table prefix
$class_name = str_replace(self::$prefix, '', $class_name);
Method parseCondition
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function parseCondition($class_name, & $arg)
{
// Получим переменные для запроса
extract($this->__get_table_data($class_name));
Function createObject
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public function &createObject(
$className,
$identifier,
array & $attributes,
array & $dbData,
- 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 __construct
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
public function __construct( $p, $c, $pf = null, $rt = self::T_ONE_TO_ONE, $cf = null, $a = null )
Function createField
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function createField($object, $table, $field, $type = 'INT')
{
// Check if db identifier field is configured
if (class_exists($table)) {
if (strlen($object->$field)) {
- 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"