propelorm/Propel2

View on GitHub

Showing 754 of 754 total issues

Method build has 45 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function build()
    {
        $count = 0;

        foreach ($this->getDatabases() as $database) {
Severity: Minor
Found in src/Propel/Generator/Manager/GraphvizManager.php - About 1 hr to fix

    Method getColumnFromName has 45 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        protected function getColumnFromName($phpName, $failSilently = true)
        {
            if (false === strpos($phpName, '.')) {
                $prefix = $this->getModelAliasOrName();
            } else {
    Severity: Minor
    Found in src/Propel/Runtime/ActiveQuery/ModelCriteria.php - About 1 hr to fix

      Method replaceNames has 45 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public function replaceNames(&$sql)
          {
              $this->replacedColumns = [];
              $this->currentAlias = '';
              $this->foundMatch = false;
      Severity: Minor
      Found in src/Propel/Runtime/ActiveQuery/Criteria.php - About 1 hr to fix

        Method addMultipleJoin has 45 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public function addMultipleJoin($conditions, $joinType = null)
            {
                $join = new Join();
                $join->setIdentifierQuoting($this->isIdentifierQuotingEnabled());
                $joinCondition = null;
        Severity: Minor
        Found in src/Propel/Runtime/ActiveQuery/Criteria.php - About 1 hr to fix

          Method generateBlockStorage has 44 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              public function generateBlockStorage($object, $isPrimaryKey = false)
              {
                  $vendorSpecific = $object->getVendorInfoForType('oracle');
                  if ($vendorSpecific->isEmpty()) {
                      return '';
          Severity: Minor
          Found in src/Propel/Generator/Platform/OraclePlatform.php - About 1 hr to fix

            Method addFilterByPrimaryKeys has 44 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                protected function addFilterByPrimaryKeys(&$script)
                {
                    $script .= "
                /**
                 * Filter the query by a list of primary keys
            Severity: Minor
            Found in src/Propel/Generator/Builder/Om/QueryBuilder.php - About 1 hr to fix

              Method addClear has 44 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  protected function addClear(&$script)
                  {
                      $table = $this->getTable();
              
                      $script .= "
              Severity: Minor
              Found in src/Propel/Generator/Builder/Om/ObjectBuilder.php - About 1 hr to fix

                Method addComputeDiff has 44 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    protected function addComputeDiff(&$script)
                    {
                        $script .= "
                /**
                 * Computes the diff between two versions.

                  Function generateBlockStorage has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
                  Open

                      public function generateBlockStorage($object, $isPrimaryKey = false)
                      {
                          $vendorSpecific = $object->getVendorInfoForType('oracle');
                          if ($vendorSpecific->isEmpty()) {
                              return '';
                  Severity: Minor
                  Found in src/Propel/Generator/Platform/OraclePlatform.php - About 1 hr 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 getCrossFKsPhpNameAffix has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
                  Open

                      protected function getCrossFKsPhpNameAffix(CrossForeignKeys $crossFKs, $plural = true)
                      {
                          $names = [];
                  
                          if ($plural) {
                  Severity: Minor
                  Found in src/Propel/Generator/Builder/Om/AbstractOMBuilder.php - About 1 hr 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 buildClasses has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
                  Open

                      public function buildClasses(array $classTargets = null, $separate = false)
                      {
                          $classes = $classTargets === null ? ['tablemap', 'object', 'query', 'objectstub', 'querystub'] : $classTargets;
                  
                          $dirHash = substr(sha1(getcwd()), 0, 10);
                  Severity: Minor
                  Found in src/Propel/Generator/Util/QuickBuilder.php - About 1 hr 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 getColumnDDL has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
                  Open

                      public function getColumnDDL(Column $col)
                      {
                          $domain = $col->getDomain();
                  
                          $ddl = [$this->quoteIdentifier($col->getName())];
                  Severity: Minor
                  Found in src/Propel/Generator/Platform/PgsqlPlatform.php - About 1 hr 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 appendDatabaseNode has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
                  Open

                      private function appendDatabaseNode(Database $database, \DOMNode $parentNode)
                      {
                          $databaseNode = $parentNode->appendChild($this->document->createElement('database'));
                          $databaseNode->setAttribute('name', $database->getName());
                          $databaseNode->setAttribute('defaultIdMethod', $database->getDefaultIdMethod());
                  Severity: Minor
                  Found in src/Propel/Generator/Schema/Dumper/XmlDumper.php - About 1 hr 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 addCopyInto has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
                  Open

                      protected function addCopyInto(&$script)
                      {
                          $table = $this->getTable();
                  
                          $script .= "
                  Severity: Minor
                  Found in src/Propel/Generator/Builder/Om/ObjectBuilder.php - About 1 hr 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 addIndexes has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
                  Open

                      protected function addIndexes(Table $table)
                      {
                          $dataFetcher = $this->dbh->query("sp_indexes_rowset '" . $table->getName() . "'");
                          $dataFetcher->setStyle(\PDO::FETCH_ASSOC);
                  
                  
                  Severity: Minor
                  Found in src/Propel/Generator/Reverse/MssqlSchemaParser.php - About 1 hr 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 parse has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
                  Open

                      public function parse(Database $database, array $additionalTables = [])
                      {
                          $tables = [];
                          $stmt = $this->dbh->query("SELECT OBJECT_NAME FROM USER_OBJECTS WHERE OBJECT_TYPE = 'TABLE'");
                  
                  
                  Severity: Minor
                  Found in src/Propel/Generator/Reverse/OracleSchemaParser.php - About 1 hr 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 parseTables has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
                  Open

                      protected function parseTables(Database $database, $filterTable = null)
                      {
                          $sql = 'SHOW FULL TABLES';
                  
                          if ($filterTable) {
                  Severity: Minor
                  Found in src/Propel/Generator/Reverse/MysqlSchemaParser.php - About 1 hr 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 modifyTable has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
                  Open

                      public function modifyTable()
                      {
                          $table = $this->getTable();
                          $database = $table->getDatabase();
                          $delegates = explode(',', $this->parameters['to']);
                  Severity: Minor
                  Found in src/Propel/Generator/Behavior/Delegate/DelegateBehavior.php - About 1 hr 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 getCrossFks has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
                  Open

                      public function getCrossFks()
                      {
                          $crossFks = [];
                          foreach ($this->referrers as $refFK) {
                              if ($refFK->getTable()->isCrossRef()) {
                  Severity: Minor
                  Found in src/Propel/Generator/Model/Table.php - About 1 hr 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 addExtraIndices has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
                  Open

                      public function addExtraIndices()
                      {
                          /**
                           * A collection of indexed columns. The keys is the column name
                           * (concatenated with a comma in the case of multi-col index), the value is
                  Severity: Minor
                  Found in src/Propel/Generator/Model/Table.php - About 1 hr 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