php-yaoi/php-yaoi

View on GitHub

Showing 203 of 203 total issues

Method set has 27 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function set($expression, $binds = null)
    {
        if (null === $expression) {
            return $this;
        }
Severity: Minor
Found in src/Sql/ComplexStatement.php - About 1 hr to fix

    Method connect has 26 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        protected function connect()
        {
            $host = $this->dsn->hostname;
            if ($this->dsn->persistent) {
                if (is_null($host)) {
    Severity: Minor
    Found in src/Database/Driver/Mysqli.php - About 1 hr to fix

      Method buildForeignKeys has 26 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          private function buildForeignKeys() {
              foreach ($this->foreignKeys as $data) {
                  $name = $data[0];
                  $localColumnNames = $data[1];
                  $localColumns = array();
      Severity: Minor
      Found in src/Database/Mysql/CreateTableReader.php - About 1 hr to fix

        Method getColumnFlagsByString has 26 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public function getColumnFlagsByString($typeString) {
                $phpType = Column::AUTO_TYPE;
        
                switch (true) {
                    case 'integer' === substr($typeString, 0, 7):
        Severity: Minor
        Found in src/Database/Pgsql/SchemaReader.php - About 1 hr to fix

          Method parseConstraint has 26 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              private function parseConstraint(Parser $parser) {
                  $indexName = $this->resolve($parser->inner('CONSTRAINT', 'FOREIGN KEY', false, true));
                  $indexColumns = $parser->inner('(', ')')->explode(',');
                  foreach ($indexColumns as &$columnName) {
                      $columnName = $this->resolve($columnName);
          Severity: Minor
          Found in src/Database/Mysql/CreateTableReader.php - About 1 hr to fix

            Function parseConstraint has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
            Open

                private function parseConstraint(Parser $parser) {
                    $indexName = $this->resolve($parser->inner('CONSTRAINT', 'FOREIGN KEY', false, true));
                    $indexColumns = $parser->inner('(', ')')->explode(',');
                    foreach ($indexColumns as &$columnName) {
                        $columnName = $this->resolve($columnName);
            Severity: Minor
            Found in src/Database/Mysql/CreateTableReader.php - About 55 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 renderContentChunk has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
            Open

                protected function renderContentChunk($content)
                {
                    $contentExists = false;
                    if (($content instanceof IsEmpty) && !$content->isEmpty()) {
                        $contentExists = true;
            Severity: Minor
            Found in src/View/HTML/Element.php - About 55 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 readIndexes has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
            Open

                private function readIndexes(Table $def) {
                    $res = $this->database->select()
                        ->select('t.relname as table_name, i.relname as index_name, a.attname as column_name')
                        ->select('ix.indisunique::int as is_unique,ix.indisprimary::int as is_primary')
                        ->from('pg_class t, pg_class i, pg_index ix, pg_attribute a')
            Severity: Minor
            Found in src/Database/Pgsql/SchemaReader.php - About 55 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 run has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
            Open

                public function run(Request $request = null)
                {
                    if (null === $request) {
                        $request = Request::createAuto();
                    }
            Severity: Minor
            Found in src/Cli/Command/Runner.php - About 55 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 processIndexes has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
            Open

                protected function processIndexes() {
                    /** @var Index[] $beforeIndexes */
                    $beforeIndexes = array();
                    foreach ($this->before->indexes as $index) {
                        $beforeIndexes [$index->getName()]= $index;
            Severity: Minor
            Found in src/Database/Pgsql/AlterTable.php - About 55 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 parseUrl has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
            Open

                private function parseUrl() {
                    $p = $this->prepareParseUrl();
            
                    if (isset($p['query'])) {
                        parse_str($p['query'], $parsed);
            Severity: Minor
            Found in src/String/Dsn.php - About 55 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 prepareCommand has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
            Open

                protected function prepareCommand(Command\Definition $definition)
                {
                    $commandClass = $definition->commandClass;
            
                    /** @var Command $command */
            Severity: Minor
            Found in src/Command/Io.php - About 55 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 fetchColumns has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
            Open

                public function fetchColumns($key = null, $value = null)
                {
                    $this->rewind();
            
                    $result = array();
            Severity: Minor
            Found in src/Database/Query.php - About 55 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 processOption has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
            Open

                private function processOption()
                {
                    if ($this->option->isRequired) {
                        unset($this->def->requiredOptions[$this->option->name]);
                    }
            Severity: Minor
            Found in src/Cli/Command/RequestMapper.php - About 55 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 buildForeignKeys has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
            Open

                private function buildForeignKeys() {
                    foreach ($this->foreignKeys as $data) {
                        $name = $data[0];
                        $localColumnNames = $data[1];
                        $localColumns = array();
            Severity: Minor
            Found in src/Database/Mysql/CreateTableReader.php - About 55 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 processForeignKeys has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
            Open

                protected function processForeignKeys()
                {
                    /** @var ForeignKey[] $beforeForeignKeys */
                    $beforeForeignKeys = array();
                    if (!$this->before->disableForeignKeys) {
            Severity: Minor
            Found in src/Sql/AlterTable.php - About 55 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 __toString has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
            Open

                public function __toString()
                {
                    // http://user:password@host:port/path?query
                    $result = $this->scheme;
            
            
            Severity: Minor
            Found in src/String/Dsn.php - About 55 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 toArray has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
            Open

                public function toArray($skipNotSetProperties = false, $skipCast = false)
                {
                    $result = array();
                    foreach (static::table()->getColumns(true) as $column) {
                        $value = $this->{$column->propertyName};
            Severity: Minor
            Found in src/Database/Entity.php - About 55 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 decodeContent has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
            Open

                private function decodeContent($response)
                {
                    if (!empty($this->parsedHeaders['content-encoding'])) {
                        if ($response && 'gzip' == strtolower($this->parsedHeaders['content-encoding']['value'])) {
                            if (!function_exists('gzdecode')) {
            Severity: Minor
            Found in src/Http/Client.php - About 55 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 processForeignKeys has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
            Open

                protected function processForeignKeys()
                {
                    /** @var ForeignKey[] $beforeForeignKeys */
                    $beforeForeignKeys = array();
                    if (!$this->before->disableForeignKeys) {
            Severity: Minor
            Found in src/Database/Pgsql/AlterTable.php - About 55 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