php-yaoi/php-yaoi

View on GitHub

Showing 203 of 203 total issues

Method fetch has 88 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function fetch($url = null)
    {
        if (null !== $url) {
            if (strpos($url, '://') === false) {
                $url = $this->getAbsoluteUrl($url);
Severity: Major
Found in src/Http/Client.php - About 3 hrs to fix

    Function rollback has a Cognitive Complexity of 24 (exceeds 5 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: Minor
    Found in src/Database/Entity/Migration.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 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 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 __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 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 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

        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

        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

            Identical blocks of code found in 2 locations. Consider refactoring.
            Open

                public static $errorLevels = array(
                    E_ERROR => 'error',
                    E_WARNING => 'warning',
                    E_PARSE => 'parse',
                    E_NOTICE => 'notice',
            Severity: Major
            Found in src/Debug.php and 1 other location - About 2 hrs to fix
            src/App/Conf.php on lines 25..42

            Duplicated Code

            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

            Tuning

            This issue has a mass of 130.

            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

            Refactorings

            Further Reading

            Identical blocks of code found in 2 locations. Consider refactoring.
            Open

                    $errorLevels = array(
                        E_ERROR => 'error',
                        E_WARNING => 'warning',
                        E_PARSE => 'parse',
                        E_NOTICE => 'notice',
            Severity: Major
            Found in src/App/Conf.php and 1 other location - About 2 hrs to fix
            src/Debug.php on lines 12..29

            Duplicated Code

            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

            Tuning

            This issue has a mass of 130.

            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

            Refactorings

            Further Reading

            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
                  Severity
                  Category
                  Status
                  Source
                  Language