php-yaoi/php-yaoi

View on GitHub

Showing 203 of 203 total issues

Function load has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

    protected function load()
    {
        $this->fileName = $this->settings->path;

        if (file_exists($this->fileName)) {
Severity: Minor
Found in src/Storage/Driver/SerializedFile.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 delete has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

    public function delete($key)
    {
        if (is_array($key)) {
            $kk = & $this->data;
            $lastKey = null;
Severity: Minor
Found in src/Storage/Driver/PhpVar.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

Method parseResponseCookies has 31 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    protected function parseResponseCookies()
    {
        $cookies = array();
        $this->parsedHeaders = array();
        foreach ($this->responseHeaders as $hdr) {
Severity: Minor
Found in src/Http/Client.php - About 1 hr to fix

    Method makeAnchor has 31 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public function makeAnchor(array $properties)
        {
            if (!$properties) {
                throw new Command\Exception('Unable to make anchor, no properties');
            }
    Severity: Minor
    Found in src/Command/Web/RequestMapper.php - About 1 hr to fix

      Method prepareCommand has 30 lines of code (exceeds 25 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 1 hr to fix

        Method getUsage has 30 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public function getUsage() {
                $usage = '';
                if (!$this->isUnnamed) {
                    if ($this->shortName) {
                        $usage = Runner::OPTION_SHORT . $this->shortName;
        Severity: Minor
        Found in src/Cli/Option.php - About 1 hr to fix

          Method readForeignKeys has 29 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              private function readForeignKeys(Table $def) {
                  $res = $this->database
                      ->select()
                      ->select('tc.constraint_name, kcu.column_name')
                      ->select('ccu.table_name  AS foreign_table_name, ccu.column_name AS foreign_column_name')
          Severity: Minor
          Found in src/Database/Pgsql/SchemaReader.php - About 1 hr to fix

            Method echoLines has 29 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                public function echoLines()
                {
                    foreach ($this->lines as $rowIndex => $rowData) {
                        foreach ($rowData as $lineIndex => $row) {
                            $line = '';
            Severity: Minor
            Found in src/Cli/View/Table.php - About 1 hr to fix

              Method render has 28 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  public function render()
                  {
                      $def = $this->command->definition();
                      $bashFunction = str_replace('-', '_', $def->name);
              
              
              Severity: Minor
              Found in src/Cli/Command/Application/Completion.php - About 1 hr to fix

                Function makeDefinitionsTree has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                Open

                    private function makeDefinitionsTree(Definition $definition)
                    {
                        foreach ($definition->optionsArray() as $option) {
                            if ($option->type === Option::TYPE_ENUM) {
                                foreach ($option->enumValues as $enumName => $value) {
                Severity: Minor
                Found in src/Command/Io.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 getTypeByString has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                Open

                    public function getTypeByString($type) {
                        $phpType = Column::STRING;
                        $type = strtoupper($type);
                        switch (true) {
                            case 'BIGINT' === substr($type, 0, 6):
                Severity: Minor
                Found in src/Database/Mysql/CreateTableReader.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 buildSelect has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                Open

                    protected function buildSelect(Quoter $quoter)
                    {
                        $columns = '';
                        if ($this->select) {
                            foreach ($this->select as $column) {
                Severity: Minor
                Found in src/Sql/Statement.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 getName has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                Open

                    public function getName() {
                        if (null === $this->name) {
                            $this->name = 'fk';
                            foreach ($this->localColumns as $column) {
                                $this->name .= '_' . $column->table->schemaName;
                Severity: Minor
                Found in src/Database/Definition/ForeignKey.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 set has a Cognitive Complexity of 10 (exceeds 5 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

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

                    public function keyExists($key)
                    {
                        if (is_array($key)) {
                            $kk = & $this->data;
                            foreach ($key as $k) {
                Severity: Minor
                Found in src/Storage/Driver/PhpVar.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 query has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                Open

                    public function query($statement = null, $binds = null)
                    {
                        if ($statement instanceof Batch) {
                            $statements = $statement->get();
                        }
                Severity: Minor
                Found in src/Database.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 get has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                Open

                    public function get($key)
                    {
                        if (is_array($key)) {
                            $kk = & $this->data;
                            foreach ($key as $k) {
                Severity: Minor
                Found in src/Storage/Driver/PhpVar.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

                Method __toString has 27 lines of code (exceeds 25 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 1 hr to fix

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

                      public function initOptions()
                      {
                          foreach ($this->optionsArray as $name => $option) {
                              if ($option instanceof Option) {
                                  if ($option->isUnnamed || $option->isRequired) {
                  Severity: Minor
                  Found in src/Cli/Command/PrepareDefinition.php - About 1 hr to fix

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

                        public function getStatementTokenizer() {
                            if (null === $this->tokenizer) {
                                $this->tokenizer = $tokenizer = new Lexer\Parser();
                    
                                $tokenizer
                    Severity: Minor
                    Found in src/Database/Mysql/Utility.php - About 1 hr to fix
                      Severity
                      Category
                      Status
                      Source
                      Language