php-yaoi/php-yaoi

View on GitHub

Showing 197 of 203 total issues

Function castField has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
Open

    public static function castField($value, $columnFlags, $import = true)
    {
        if (!($columnFlags & self::NOT_NULL) && $value === null) {
            return null;
        }
Severity: Minor
Found in src/Database/Definition/Column.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 parseLines has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
Open

    private function parseLines() {
        $this->columns = new \stdClass();
        $this->indexes = array();
        $this->foreignKeys = array();

Severity: Minor
Found in src/Database/Mysql/CreateTableReader.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 backTrace has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
Open

    public static function backTrace($skip = 0, $return = self::TRACE_HTML)
    {
        //if (!self::$isActive) {
//            return '';
//        }
Severity: Minor
Found in src/Debug.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

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

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

        public function build(Quoter $quoter = null) {
            if ($this->binds) {
                if ($quoter === null && $this->quoter !== null) {
                    $quoter = $this->quoter;
                }
    Severity: Minor
    Found in src/String/Expression.php - About 1 hr to fix

      Function read has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
      Open

          public function read(Request $request, array $options)
          {
              $this->def = new PrepareDefinition($options);
      
              $tokens = $request->server()->argv;
      Severity: Minor
      Found in src/Cli/Command/RequestMapper.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 perform has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
      Open

          public function perform(Migration $migration, $action = Migration::APPLY)
          {
              if ($action === Migration::SKIP) {
                  return $this;
              }
      Severity: Minor
      Found in src/Migration/Manager.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 quote has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
      Open

          public function quote($value)
          {
              if (null === $value) {
                  return 'NULL';
              } elseif (is_int($value)) {
      Severity: Minor
      Found in src/Database/Driver.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 processToken has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
      Open

          private function processToken()
          {
              $optionFound = null;
              if (($optionName = $this->token->afterStarts(Runner::OPTION_NAME)) && isset($this->def->byName[$optionName])) {
                  $optionFound = $this->def->byName[$optionName];
      Severity: Minor
      Found in src/Cli/Command/RequestMapper.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 __construct has 46 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public function __construct($options)
          {
              $this->optionsArray = $options;
      
              /** @var Option $hasVariadicArgument */
      Severity: Minor
      Found in src/Cli/Command/PrepareDefinition.php - About 1 hr to fix

        Method findSaved has 46 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public function findSaved()
            {
                $table = $this->table();
                $statement = self::statement();
                $data = $this->toArray(true);
        Severity: Minor
        Found in src/Database/Entity.php - About 1 hr to fix

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

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

                public function fetchAll($keyField = null, $valueField = null)
                {
                    if (!$this->executed) {
                        $this->execute();
                    }
            Severity: Minor
            Found in src/Database/Query.php - About 1 hr to fix

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

                  private function parseLines() {
                      $this->columns = new \stdClass();
                      $this->indexes = array();
                      $this->foreignKeys = array();
              
              
              Severity: Minor
              Found in src/Database/Mysql/CreateTableReader.php - About 1 hr to fix

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

                    public function makeAnchor(State $commandState)
                    {
                        $commandClass = $commandState->commandClass;
                        $commandClasses = array();
                        if ($commandClass !== $this->definition->commandClass) {
                Severity: Minor
                Found in src/Command/Io.php - About 1 hr to fix

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

                      public function get($key = null, Closure $addOnMiss = null)
                      {
                          if (null === $addOnMiss && $this->mode === self::MODE_CAPTURE) {
                              throw new Mock\Exception('Reading disabled in capture mode', Mock\Exception::PLAY_REQUIRED);
                          }
                  Severity: Minor
                  Found in src/Mock.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 getUsage has a Cognitive Complexity of 14 (exceeds 5 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

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

                      public function addContent($message)
                      {
                          if ($message instanceof Progress) {
                              if ($this->console->attached()) {
                                  if ($this->progressStartedLength) {
                  Severity: Minor
                  Found in src/Cli/Response.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 processColumns has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
                  Open

                      protected function processColumns()
                      {
                          $this->alterLines->disable();
                  
                          $intersect = array();
                  Severity: Minor
                  Found in src/Database/Sqlite/AlterTable.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 findLines has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
                  Open

                      private function findLines()
                      {
                          foreach ($this->rows as $rowIndex => $row) {
                              foreach ($row as $key => $value) {
                                  if (!$value instanceof Content\Text) {
                  Severity: Minor
                  Found in src/Cli/View/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