Showing 740 of 740 total issues
Function build
has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring. Open
public function build(): void
{
foreach ($this->getDatabases() as $database) {
$dotSyntax = "digraph G {\n";
- 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 addDoInsertBodyRaw
has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring. Open
protected function addDoInsertBodyRaw(): string
{
$this->declareClasses(
'\Propel\Runtime\Propel',
'\PDO',
- 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 addColumns
has 93 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function addColumns(Table $table, int $oid): void
{
// Get the columns, types, etc.
// Based on code from pgAdmin3 (http://www.pgadmin.org/)
Method addHydrateBody
has 93 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function addHydrateBody(string &$script): void
{
$table = $this->getTable();
$platform = $this->getPlatform();
QuickBuilder
has 30 functions (exceeds 20 allowed). Consider refactoring. Open
class QuickBuilder
{
use VfsTrait;
/**
DatabaseDiff
has 30 functions (exceeds 20 allowed). Consider refactoring. Open
class DatabaseDiff
{
/**
* @var array<string, \Propel\Generator\Model\Table>
*/
NestedSetBehaviorQueryBuilderModifier
has 30 functions (exceeds 20 allowed). Consider refactoring. Open
class NestedSetBehaviorQueryBuilderModifier
{
/**
* @var \Propel\Generator\Behavior\NestedSet\NestedSetBehavior
*/
VersionableBehaviorObjectBuilderModifier
has 30 functions (exceeds 20 allowed). Consider refactoring. Open
class VersionableBehaviorObjectBuilderModifier
{
/**
* @var \Propel\Generator\Behavior\Versionable\VersionableBehavior
*/
Function addColumns
has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring. Open
protected function addColumns(Table $table): void
{
$tableName = $table->getName();
/** @var \PDOStatement $stmt */
- 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 joinSchemas
has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring. Open
public function joinSchemas(array $schemas): void
{
foreach ($schemas as $schema) {
foreach ($schema->getDatabases(false) as $addDb) {
$addDbName = $addDb->getName();
- 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 applyLimit
has 89 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function applyLimit(string &$sql, int $offset, int $limit, ?Criteria $criteria = null): void
{
// split the select and from clauses out of the original query
$selectStatement = '';
$fromStatement = '';
Method addSaveBody
has 89 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function addSaveBody(string &$script): void
{
$table = $this->getTable();
$reloadOnUpdate = $table->isReloadOnUpdate();
$reloadOnInsert = $table->isReloadOnInsert();
File OraclePlatform.php
has 313 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* MIT License. This file is part of the Propel package.
* For the full copyright and license information, please view the LICENSE
PropelModelPager
has 29 functions (exceeds 20 allowed). Consider refactoring. Open
class PropelModelPager implements IteratorAggregate, Countable
{
/**
* @var \Propel\Runtime\ActiveQuery\ModelCriteria
*/
PdoAdapter
has 29 functions (exceeds 20 allowed). Consider refactoring. Open
abstract class PdoAdapter
{
/**
* Indicates if the database system can process DELETE statements with
* aliases like 'DELETE t FROM my_table t JOIN my_other_table o ON ...'
StatementWrapper
has 29 functions (exceeds 20 allowed). Consider refactoring. Open
class StatementWrapper implements StatementInterface, IteratorAggregate
{
/**
* The wrapped statement class
*
Similar blocks of code found in 2 locations. Consider refactoring. Open
protected function configure()
{
parent::configure();
$this
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 152.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 2 locations. Consider refactoring. Open
protected function configure()
{
parent::configure();
$this
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 152.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Function simpleXmlToArray
has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring. Open
protected static function simpleXmlToArray(SimpleXMLElement $xml): array
{
$ar = [];
foreach ($xml->children() as $k => $v) {
// recurse the child
- 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 parseTables
has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring. Open
protected function parseTables(Database $database, ?Table $filterTable = null): void
{
$sql = "
SELECT name
FROM sqlite_master
- 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"