Showing 693 of 740 total issues
Method equals
has 52 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function equals(self $crit): bool
{
if ($this === $crit) {
return true;
}
Method buildOrderByClause
has 52 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function buildOrderByClause(array &$params): array
{
$orderBy = $this->criteria->getOrderByColumns();
if (!$orderBy) {
return ['', ''];
Method addDoInsert
has 52 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function addDoInsert(string &$script): void
{
$table = $this->getTable();
$tableMapClass = $this->getTableMapClass();
Method addFKMutator
has 52 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function addFKMutator(string &$script, ForeignKey $fk): void
{
$fkTable = $fk->getForeignTable();
$interface = $fk->getInterface();
Method addFilterByRefFk
has 52 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function addFilterByRefFk(string &$script, ForeignKey $fk): void
{
$this->declareClasses(
'\Propel\Runtime\Collection\ObjectCollection',
'\Propel\Runtime\Exception\PropelException',
Method getAddTableDDL
has 52 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getAddTableDDL(Table $table): string
{
$lines = [];
foreach ($table->getColumns() as $column) {
Method parseTables
has 51 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function parseTables(Database $database, ?Table $filterTable = null): void
{
$sql = "
SELECT name
FROM sqlite_master
Method addIndexes
has 51 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function addIndexes(Table $table, int $oid): void
{
$stmt = $this->dbh->prepare("SELECT
DISTINCT ON(cls.relname)
cls.relname as idxname,
Method addCrossFKCreateQuery
has 51 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function addCrossFKCreateQuery(string &$script, CrossForeignKeys $crossFKs): void
{
if (1 <= count($crossFKs->getCrossForeignKeys()) && !$crossFKs->getUnclassifiedPrimaryKeys()) {
return;
}
Method addAddVersion
has 51 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function addAddVersion(string &$script): void
{
$versionTable = $this->behavior->getVersionTable();
$versionARClassName = $this->builder->getClassNameFromBuilder($this->builder->getNewStubObjectBuilder($versionTable));
Method addVersionTable
has 51 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function addVersionTable(): void
{
$table = $this->getTable();
$database = $table->getDatabase();
$versionTableName = $this->getParameter('version_table') ?: ($table->getOriginCommonName() . '_version');
Method addCrossFKSet
has 50 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function addCrossFKSet(string &$script, CrossForeignKeys $crossFKs): void
{
$scheduledForDeletionVarName = $this->getCrossScheduledForDeletionVarName($crossFKs);
$multi = 1 < count($crossFKs->getCrossForeignKeys()) || (bool)$crossFKs->getUnclassifiedPrimaryKeys();
Method addDoCount
has 50 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function addDoCount(string &$script): void
{
$script .= "
public function doCount(?ConnectionInterface \$con = null): \Propel\Runtime\DataFetcher\DataFetcherInterface
{
Method __call
has 49 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function __call(string $name, array $arguments)
{
// Maybe it's a magic call to one of the methods supporting it, e.g. 'findByTitle'
static $methods = ['findBy', 'findOneBy', 'requireOneBy', 'filterBy', 'orderBy', 'groupBy'];
foreach ($methods as $methodName) {
Method addColumns
has 49 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function addColumns(Table $table): void
{
/** @var \PDOStatement $stmt */
$stmt = $this->dbh->query("SELECT COLUMN_NAME, DATA_TYPE, NULLABLE, DATA_LENGTH, DATA_PRECISION, DATA_SCALE, DATA_DEFAULT FROM USER_TAB_COLS WHERE TABLE_NAME = '" . $table->getName() . "'");
while ($row = $stmt->fetch(PDO::FETCH_ASSOC)) {
Method addRefFKGet
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function addRefFKGet(string &$script, ForeignKey $refFK): void
{
$fkQueryClassName = $this->getClassNameFromBuilder($this->getNewStubQueryBuilder($refFK->getTable()));
$relCol = $this->getRefFKPhpNameAffix($refFK, true);
$collName = $this->getRefFKCollVarName($refFK);
Method isUnique
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function isUnique(array $keys): bool
{
if (count($keys) === 1) {
$column = $keys[0] instanceof Column ? $keys[0] : $this->getColumn($keys[0]);
if ($column) {
Function addMultipleJoin
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
public function addMultipleJoin(array $conditions, ?string $joinType = null)
{
$join = new Join();
$join->setIdentifierQuoting($this->isIdentifierQuotingEnabled());
$joinCondition = 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 cleanupSQL
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
public function cleanupSQL(string &$sql, array &$params, Criteria $values, DatabaseMap $dbMap): void
{
$i = 1;
$paramCols = [];
foreach ($params as $param) {
- 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 appendPsForUniqueClauseTo
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
protected function appendPsForUniqueClauseTo(string &$sb, array &$params): void
{
$field = ($this->table === null) ? $this->column : $this->table . '.' . $this->column;
// NULL VALUES need special treatment because the SQL syntax is different
// i.e. table.column IS NULL rather than table.column = 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"