Showing 693 of 740 total issues
Method execute
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
protected function execute(InputInterface $input, OutputInterface $output): int
{
$configOptions = [];
if ($this->hasInputOption('connection', $input)) {
Method addDoInsertBodyWithIdMethod
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
protected function addDoInsertBodyWithIdMethod(): string
{
$table = $this->getTable();
$script = '';
foreach ($table->getPrimaryKey() as $col) {
Method addBuildRelations
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
protected function addBuildRelations(string &$script): void
{
$script .= "
/**
* Build the RelationMap objects for this table relationships
Method buildModel
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
protected function buildModel(): Database
{
/** @var \Propel\Generator\Config\GeneratorConfig $config */
$config = $this->getGeneratorConfig();
$connection = $this->getConnection();
Method getClassesForTable
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function getClassesForTable(Table $table, ?array $classTargets = null): string
{
$classTargets = $classTargets ?? $this->classTargets;
$script = '';
Method addPrune
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
protected function addPrune(string &$script): void
{
$table = $this->getTable();
$class = $this->getObjectClassName();
$objectName = '$' . $table->getCamelCaseName();
Method getDefaultValueString
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
protected function getDefaultValueString(Column $column): string
{
$defaultValue = var_export(null, true);
$val = $column->getPhpDefaultValue();
if ($val === null) {
Method addTemporalMutator
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
protected function addTemporalMutator(string &$script, Column $col): void
{
$clo = $col->getLowercasedName();
$dateTimeClass = $this->getDateTimeClass($col);
Method getAddTableDDL
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function getAddTableDDL(Table $table): string
{
$ret = $this->getUseSchemaDDL($table);
$ret .= $this->getAddSequenceDDL($table);
Method setRelationMap
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function setRelationMap(RelationMap $relationMap, ?string $leftTableAlias = null, ?string $relationAlias = null)
{
$leftCols = $relationMap->getLeftColumns();
$rightCols = $relationMap->getRightColumns();
$leftValues = $relationMap->getLocalValues();
Method getCriterionForClause
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
protected function getCriterionForClause(string $clause, $value, ?int $bindingType = null): AbstractCriterion
{
$origin = $clause = trim($clause);
if ($this->replaceNames($clause)) {
// at least one column name was found and replaced in the clause
Method buildLogger
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
protected function buildLogger(string $name = 'defaultLogger'): LoggerInterface
{
if (!isset($this->loggerConfigurations[$name])) {
return $name !== 'defaultLogger' ? $this->getLogger() : new NullLogger();
}
Method execute
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
protected function execute(InputInterface $input, OutputInterface $output): int
{
$configOptions = [];
$connection = (string)$input->getArgument('connection');
Method compareColumns
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function compareColumns(bool $caseInsensitive = false): int
{
$fromTableColumns = $this->getFromTable()->getColumns();
$toTableColumns = $this->getToTable()->getColumns();
$columnDifferences = 0;
Method getAddTableDDL
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function getAddTableDDL(Table $table): string
{
$table = clone $table;
$tableDescription = $table->hasDescription() ? $this->getCommentLineDDL($table->getDescription()) : '';
Method addPopulateObjects
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
protected function addPopulateObjects(string &$script): void
{
$table = $this->getTable();
$script .= "
/**
Method addDoOnDeleteSetNull
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
protected function addDoOnDeleteSetNull(string &$script): void
{
$table = $this->getTable();
$script .= "
/**
Method addDoOnDeleteCascade
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
protected function addDoOnDeleteCascade(string &$script): void
{
$table = $this->getTable();
$script .= "
/**
Method addColumnAccessorMethods
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
protected function addColumnAccessorMethods(string &$script): void
{
$table = $this->getTable();
foreach ($table->getColumns() as $col) {
Function getTemplatePath
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
Open
protected function getTemplatePath(string $path): string
{
$srcPos = strrpos($path, DIRECTORY_SEPARATOR . 'src' . DIRECTORY_SEPARATOR);
if ($srcPos === false) {
// BC shim for old template paths
- 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"