propelorm/Propel2

View on GitHub

Showing 740 of 740 total issues

Method getIdentifierPhp has 5 arguments (exceeds 4 allowed). Consider refactoring.
Open

        string $columnValueMutator,
        string $connectionVariableName = '$con',
        string $sequenceName = '',
        string $tab = '            ',
        ?string $phpType = null
Severity: Minor
Found in src/Propel/Generator/Platform/OraclePlatform.php - About 35 mins to fix

    Method getMigrationClassBody has 5 arguments (exceeds 4 allowed). Consider refactoring.
    Open

        public function getMigrationClassBody(array $migrationsUp, array $migrationsDown, int $timestamp, string $comment = '', string $suffix = ''): string
    Severity: Minor
    Found in src/Propel/Generator/Manager/MigrationManager.php - About 35 mins to fix

      Method getIdentifierPhp has 5 arguments (exceeds 4 allowed). Consider refactoring.
      Open

              string $columnValueMutator,
              string $connectionVariableName = '$con',
              string $sequenceName = '',
              string $tab = '            ',
              ?string $phpType = null
      Severity: Minor
      Found in src/Propel/Generator/Platform/PgsqlPlatform.php - About 35 mins to fix

        Similar blocks of code found in 2 locations. Consider refactoring.
        Open

                $supportedOptions = [
                    'AutoIncrement' => 'AUTO_INCREMENT',
                    'AvgRowLength' => 'AVG_ROW_LENGTH',
                    'Charset' => 'CHARACTER SET',
                    'Checksum' => 'CHECKSUM',
        Severity: Minor
        Found in src/Propel/Generator/Platform/MysqlPlatform.php and 1 other location - About 35 mins to fix
        src/Propel/Common/Pluralizer/StandardEnglishPluralizer.php on lines 79..98

        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 92.

        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

        Further Reading

        Similar blocks of code found in 2 locations. Consider refactoring.
        Open

                if ($this->withUpdatedAt()) {
                    $valueSource = strtoupper($this->getTable()->getColumn($this->getParameter('update_column'))->getType()) === 'INTEGER'
                        ? '$time'
                        : '$highPrecision';
                    $script .= "
        src/Propel/Generator/Behavior/Timestampable/TimestampableBehavior.php on lines 128..136

        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 92.

        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

        Further Reading

        Similar blocks of code found in 2 locations. Consider refactoring.
        Open

            protected $irregular = [
                'leaf' => 'leaves',
                'loaf' => 'loaves',
                'move' => 'moves',
                'foot' => 'feet',
        Severity: Minor
        Found in src/Propel/Common/Pluralizer/StandardEnglishPluralizer.php and 1 other location - About 35 mins to fix
        src/Propel/Generator/Platform/MysqlPlatform.php on lines 377..396

        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 92.

        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

        Further Reading

        Similar blocks of code found in 2 locations. Consider refactoring.
        Open

                if ($this->withCreatedAt()) {
                    $valueSource = strtoupper($this->getTable()->getColumn($this->getParameter('create_column'))->getType()) === 'INTEGER'
                        ? '$time'
                        : '$highPrecision';
                    $script .= "
        src/Propel/Generator/Behavior/Timestampable/TimestampableBehavior.php on lines 138..146

        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 92.

        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

        Further Reading

        Function count has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
        Open

            public function count(): int
            {
                if ($this->dataObject && $this->dataObject->getConnection()->getAttribute(PDO::ATTR_DRIVER_NAME) === 'sqlite') {
                    $lastQuery = $this->dataObject->getStatement()->queryString;
                    if (substr(trim(strtoupper($lastQuery)), 0, 7) === 'SELECT ') {
        Severity: Minor
        Found in src/Propel/Runtime/DataFetcher/PDODataFetcher.php - About 35 mins to fix

        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 addSelectQuery has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
        Open

            public function addSelectQuery(Criteria $subQueryCriteria, ?string $alias = null, bool $addAliasAndSelectColumns = true)
            {
                if (!$subQueryCriteria->hasSelectClause()) {
                    $subQueryCriteria->addSelfSelectColumns();
                }
        Severity: Minor
        Found in src/Propel/Runtime/ActiveQuery/ModelCriteria.php - About 35 mins to fix

        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 groupByClass has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
        Open

            public function groupByClass(string $class)
            {
                if ($class == $this->getModelAliasOrName()) {
                    // column of the Criteria's model
                    $tableMap = $this->getTableMap();
        Severity: Minor
        Found in src/Propel/Runtime/ActiveQuery/ModelCriteria.php - About 35 mins to fix

        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 initConnection has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
        Open

            public function initConnection(ConnectionInterface $con, array $settings): void
            {
                $con->exec("ALTER SESSION SET NLS_DATE_FORMAT='YYYY-MM-DD'");
                $con->exec("ALTER SESSION SET NLS_TIMESTAMP_FORMAT='YYYY-MM-DD HH24:MI:SS'");
                if (isset($settings['queries']) && is_array($settings['queries'])) {
        Severity: Minor
        Found in src/Propel/Runtime/Adapter/Pdo/OracleAdapter.php - About 35 mins to fix

        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 getPlainSelectedColumns has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
        Open

            public function getPlainSelectedColumns(Criteria $criteria): array
            {
                $selected = [];
                foreach ($criteria->getSelectColumns() as $columnName) {
                    if (strpos($columnName, '(') === false) {
        Severity: Minor
        Found in src/Propel/Runtime/Adapter/Pdo/PdoAdapter.php - About 35 mins to fix

        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 setMaxPerPage has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
        Open

            public function setMaxPerPage(int $max): void
            {
                if ($max > 0) {
                    $this->maxPerPage = $max;
                    if ($this->page === 0) {
        Severity: Minor
        Found in src/Propel/Runtime/Util/PropelModelPager.php - About 35 mins to fix

        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 build has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
        Open

            public function build(array &$params): PreparedStatementDto
            {
                $sourceTableNamesCollector = [];
        
                $selectSql = $this->buildSelectClause($sourceTableNamesCollector);
        Severity: Minor
        Found in src/Propel/Runtime/ActiveQuery/SqlBuilder/SelectQuerySqlBuilder.php - About 35 mins to fix

        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 __construct has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
        Open

            public function __construct(array $errors)
            {
                $numErrors = count($errors);
        
                $message = '';
        Severity: Minor
        Found in src/Propel/Common/Config/Exception/XmlParseException.php - About 35 mins to fix

        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 combine has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
        Open

            public function combine(array $criterions = [], string $operator = self::LOGICAL_AND, ?string $name = null)
            {
                $operatorMethod = (strtoupper($operator) === self::LOGICAL_AND) ? 'addAnd' : 'addOr';
                $namedCriterions = [];
                foreach ($criterions as $key) {
        Severity: Minor
        Found in src/Propel/Runtime/ActiveQuery/Criteria.php - About 35 mins to fix

        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 cleanupSQL has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
        Open

            public function cleanupSQL(string &$sql, array &$params, Criteria $values, DatabaseMap $dbMap): void
            {
                $i = 1;
                foreach ($params as $param) {
                    $tableName = $param['table'];
        Severity: Minor
        Found in src/Propel/Runtime/Adapter/Pdo/SqlsrvAdapter.php - About 35 mins to fix

        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 bindValues has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
        Open

            public function bindValues(StatementInterface $stmt, array $params, DatabaseMap $dbMap): void
            {
                $position = 0;
                foreach ($params as $param) {
                    $position++;
        Severity: Minor
        Found in src/Propel/Runtime/Adapter/Pdo/PdoAdapter.php - About 35 mins to fix

        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 rollBack has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
        Open

            public function rollBack(): bool
            {
                $return = true;
                $opcount = $this->getNestedTransactionCount();
                if ($opcount > 0) {
        Severity: Minor
        Found in src/Propel/Runtime/Adapter/MSSQL/MssqlPropelPDO.php - About 35 mins to fix

        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 getReadConnection has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
        Open

            public function getReadConnection(?AdapterInterface $adapter = null): ConnectionInterface
            {
                if ($this->writeConnection && $this->writeConnection->inTransaction()) {
                    return $this->writeConnection;
                }
        Severity: Minor
        Found in src/Propel/Runtime/Connection/ConnectionManagerPrimaryReplica.php - About 35 mins to fix

        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

        Severity
        Category
        Status
        Source
        Language