php-yaoi/php-yaoi

View on GitHub

Showing 197 of 203 total issues

Function initOptions has a Cognitive Complexity of 23 (exceeds 5 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 3 hrs 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

ComplexStatement has 27 functions (exceeds 20 allowed). Consider refactoring.
Open

abstract class ComplexStatement extends Expression implements
    SelectInterface,
    InsertInterface,
    UpdateInterface,
    DeleteInterface
Severity: Minor
Found in src/Sql/ComplexStatement.php - About 3 hrs to fix

    Function __construct has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
    Open

        public function __construct($options)
        {
            $this->optionsArray = $options;
    
            /** @var Option $hasVariadicArgument */
    Severity: Minor
    Found in src/Cli/Command/PrepareDefinition.php - About 3 hrs 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 getByColumn has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
    Open

        public function getByColumn(Column $column)
        {
            $flags = $column->flags;
    
            $typeString = $this->getBaseType($column);
    Severity: Minor
    Found in src/Database/Mysql/TypeString.php - About 3 hrs 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 buildValues has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
    Open

        protected function buildValues(Quoter $quoter)
        {
            $result = '';
            if ($this->values) {
                $fields = array();
    Severity: Minor
    Found in src/Sql/ComplexStatement.php - About 3 hrs 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 tokenize has 76 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public function tokenize($string)
        {
            $quoteStarted = false;
            $escape = array();
            $start = false;
    Severity: Major
    Found in src/String/Tokenizer.php - About 3 hrs to fix

      Function render has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
      Open

          public function render()
          {
              if ($this->withJsonZoom) {
                  $this->addCallbackOption('xAxis', 'events', 'afterSetExtremes', 'loadPoints');
                  $this->addCallbackOption('xAxis', 'events', 'setExtremes', 'setExtremesCallback');
      Severity: Minor
      Found in src/View/HighCharts.php - About 2 hrs 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 current has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
      Open

          public function current()
          {
              $row = parent::current();
              if ($this->callback) {
                  $row = $this->callback->__invoke($row);
      Severity: Minor
      Found in src/Rows/Processor.php - About 2 hrs 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 makeExpression has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
      Open

          private function makeExpression(Parsed $parsed, &$binds, &$index) {
              $statement = '';
      
              foreach ($parsed->tokens as $token) {
                  if ($token instanceof Token) {
      Severity: Minor
      Found in src/String/Lexer/Renderer.php - About 2 hrs 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 apply has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
      Open

          public function apply()
          {
              if (self::$enableStateCache && isset(self::$applied[$this->table->entityClassName])) {
                  if ($this->log) {
                      $this->log->push(Expression::create(
      Severity: Minor
      Found in src/Database/Entity/Migration.php - About 2 hrs 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 parseResponseCookies has a Cognitive Complexity of 19 (exceeds 5 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 2 hrs 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

      File ComplexStatement.php has 272 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      <?php
      /*
       *
       * create table test1 select * from sources
      ###
      Severity: Minor
      Found in src/Sql/ComplexStatement.php - About 2 hrs to fix

        Method rollback has 61 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public function rollback()
            {
                if (self::$enableStateCache && isset(self::$rolledBack[$this->table->entityClassName])) {
                    if ($this->log) {
                        $this->log->push(Expression::create(
        Severity: Major
        Found in src/Database/Entity/Migration.php - About 2 hrs to fix

          File CreateTableReader.php has 267 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          <?php
          
          namespace Yaoi\Database\Mysql;
          
          use Yaoi\BaseClass;
          Severity: Minor
          Found in src/Database/Mysql/CreateTableReader.php - About 2 hrs to fix

            File Entity.php has 267 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            <?php
            
            namespace Yaoi\Database;
            
            use Yaoi\BaseClass;
            Severity: Minor
            Found in src/Database/Entity.php - About 2 hrs to fix

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

                  public function build(Quoter $quoter = null)
                  {
                      if ($this->isEmpty()) {
                          return '';
                      }
              Severity: Major
              Found in src/Sql/Expression.php - About 2 hrs to fix

                HighCharts has 21 functions (exceeds 20 allowed). Consider refactoring.
                Open

                class HighCharts extends BaseClass implements Renderer
                {
                
                    public function isEmpty()
                    {
                Severity: Minor
                Found in src/View/HighCharts.php - About 2 hrs to fix

                  Method makeExpression has 54 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      private function makeExpression(Parsed $parsed, &$binds, &$index) {
                          $statement = '';
                  
                          foreach ($parsed->tokens as $token) {
                              if ($token instanceof Token) {
                  Severity: Major
                  Found in src/String/Lexer/Renderer.php - About 2 hrs to fix

                    Method varExportString has 54 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        public function varExportString($string, $usePhpEol = true) {
                            static $specialChars = array(
                                "\r" => '\r',
                                "\n" => '\n',
                                "\t" => '\t',
                    Severity: Major
                    Found in src/Test/PHPUnit/TestCase.php - About 2 hrs to fix

                      Method findOrCreateInstance has 54 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          private static function findOrCreateInstance($serviceClassName, $identifier, $idIsSettings = false) {
                              //var_dump('=-=-=-=-=-=-=-=-=-=-=-=-=-=',$serviceClassName, $identifier, $idIsSettings);
                      
                              if ($identifier instanceof Closure) {
                                  $identifier = self::resolveClosure($identifier);
                      Severity: Major
                      Found in src/Service.php - About 2 hrs to fix
                        Severity
                        Category
                        Status
                        Source
                        Language