Showing 42 of 46 total issues
Query
has 23 functions (exceeds 20 allowed). Consider refactoring. Open
abstract class Query implements QueryInterface
{
const JOIN_TYPE_INNER = 'INNER';
const JOIN_TYPE_LEFT = 'LEFT';
Function transformColumns
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
public function transformColumns(array $columns)
{
foreach ($columns as $column) {
if (null == $column->phpName) {
$column->phpName = StringUtil::camelize($column->name, 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
TableMap
has 22 functions (exceeds 20 allowed). Consider refactoring. Open
abstract class TableMap implements TableMapInterface
{
const COLUMN_TYPE_INTEGER = 1;
const COLUMN_TYPE_STRING = 2;
const COLUMN_TYPE_DOUBLE = 3;
Method getTableColumnConfigurationNode
has 58 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function getTableColumnConfigurationNode()
{
$builder = new TreeBuilder();
$columnsNode = $builder->root('columns');
$columnsNode
Method pluralize
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function pluralize($word)
{
static $plurals = [
'/(quiz)$/i' => '\1zes',
'/^(ox)$/i' => '\1en',
Method execute
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function execute(InputInterface $input, OutputInterface $output)
{
$schemas = $this->getSchemas($this->getSchemaPath());
$connections = [];
$pendingDatabaseCount = 0;
Function execute
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
protected function execute(InputInterface $input, OutputInterface $output)
{
$schemas = $this->getSchemas($this->getSchemaPath());
$connections = [];
$pendingDatabaseCount = 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"
Further reading
Method getTableRelationConfigurationNode
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function getTableRelationConfigurationNode()
{
$onActionBehaviors = ['CASCADE', 'NO ACTION', 'RESTRICT', 'SET NULL', 'SET DEFAULT'];
$builder = new TreeBuilder();
Method hydrateRelation
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function hydrateRelation(array $data, array $item, $alias)
{
$hash = Rocket::getTableMap($this->joins[$alias]['relation']['namespace'])->getPrimaryKeysHash($item);
$relationFrom = $this->joins[$alias]['from'];
$relationPhpName = $this->joins[$alias]['relation']['phpName'];
Function buildClauses
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
protected function buildClauses()
{
$query = ' WHERE ';
// FIXME handle the case when a clause need to be encapsulated by parentheses
- 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 save
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
public function save(\PDO $con = null)
{
if ($this->_isDeleted) {
throw new \LogicException('Cannot save a deleted object');
}
- 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 load
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function load($path, array $options)
{
if (null != $path) {
if (!is_file($path)) {
throw new ConfigurationFileNotFoundException('The rocket configuration file is not found in the selected folder "' . $path . '"');
Function load
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
protected function load($path, array $options)
{
if (null != $path) {
if (!is_file($path)) {
throw new ConfigurationFileNotFoundException('The rocket configuration file is not found in the selected folder "' . $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 transformColumns
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function transformColumns(array $columns)
{
foreach ($columns as $column) {
if (null == $column->phpName) {
$column->phpName = StringUtil::camelize($column->name, false);
Method join
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function join($relation, $alias, $joinType = self::JOIN_TYPE_INNER, $with = false)
{
$relationTable = $relation;
$from = null;
Function validateRelations
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
protected function validateRelations(array $normalizedSchemas)
{
$transformerClass = $this->options['transformer']['relation']['class'];
if (is_object($transformerClass)) {
$schemaRelationTransformer = $transformerClass;
- 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 hydrateRelation
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
protected function hydrateRelation(array $data, array $item, $alias)
{
$hash = Rocket::getTableMap($this->joins[$alias]['relation']['namespace'])->getPrimaryKeysHash($item);
$relationFrom = $this->joins[$alias]['from'];
$relationPhpName = $this->joins[$alias]['relation']['phpName'];
- 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 validate
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function validate(array $schemas)
{
$processor = new Processor();
$configuration = new SchemaConfiguration();
Method validateRelations
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function validateRelations(array $normalizedSchemas)
{
$transformerClass = $this->options['transformer']['relation']['class'];
if (is_object($transformerClass)) {
$schemaRelationTransformer = $transformerClass;
Method save
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function save(\PDO $con = null)
{
if ($this->_isDeleted) {
throw new \LogicException('Cannot save a deleted object');
}