Showing 46 of 46 total issues
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');
}
Method execute
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function execute(InputInterface $input, OutputInterface $output)
{
$schemas = $this->getSchemas($this->getSchemaPath());
// Generating SQL
Method addColumn
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
public function addColumn($name, $phpName, $type, $size = null, $decimal = 0, array $values = null, $default = null, $isRequired = false)
Function pluralize
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public static function pluralize($word)
{
static $plurals = [
'/(quiz)$/i' => '\1zes',
'/^(ox)$/i' => '\1en',
- 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 join
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
protected function join($relation, $alias, $joinType = self::JOIN_TYPE_INNER, $with = false)
{
$relationTable = $relation;
$from = null;
- 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 getDefault
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function getDefault($raw = false)
{
if (TableMap::COLUMN_TYPE_ENUM == $this->type) {
if ($raw) {
return $this->default;
- 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 addRelation
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
public function addRelation($classNamespace, $phpName, $type, $local, $foreign)
Function delete
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function delete(\PDO $con = null)
{
if ($this->_isNew) {
throw new \LogicException('Cannot delete a new 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
Function getSqlQuery
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function getSqlQuery()
{
$query = $this->buildQuery();
if (0 < sizeof($this->clauses)) {
foreach ($this->clauses as $i => $clauseParams) {
- 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 transform
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function transform(Table $table, array $schemas)
{
$relations = $table->getRelations();
foreach ($relations as $relation) {
// Check if local column exists
- 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 hydrate
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function hydrate(\PDOStatement $stmt)
{
while ($row = $stmt->fetch(\PDO::FETCH_ASSOC)) {
$data = $this->getRowDataByAlias($row);
- 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
case 'double': return self::COLUMN_TYPE_DOUBLE;
Avoid too many return
statements within this method. Open
case 'float': return self::COLUMN_TYPE_FLOAT;
Avoid too many return
statements within this method. Open
case TableMap::COLUMN_TYPE_TEXT: return 'string';
Avoid too many return
statements within this method. Open
case 'enum': return self::COLUMN_TYPE_ENUM;
Avoid too many return
statements within this method. Open
return 'mixed';
Avoid too many return
statements within this method. Open
case 'date': return self::COLUMN_TYPE_DATE;