php-yaoi/php-yaoi

View on GitHub

Showing 203 of 203 total issues

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 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 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

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

        public function rusDayMonthToDate($string)
        {
            if (null === $this->year || null === $this->month || null === $this->day) {
                list($this->year, $this->month, $this->day) = explode('/', $this->date('Y/m/d'));
            }
    Severity: Minor
    Found in src/Date/TimeMachine.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 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 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

    Method install has 43 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public function install()
        {
            $this->response->addContent('Installing');
    
            $request = Request::createAuto();
    Severity: Minor
    Found in src/Cli/Command/Runner.php - About 1 hr to fix

      Method run has 42 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public function run(Request $request = null)
          {
              if (null === $request) {
                  $request = Request::createAuto();
              }
      Severity: Minor
      Found in src/Cli/Command/Application/Runner.php - About 1 hr to fix

        Method getColumns has 42 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public function getColumns($tableName) {
                //echo PHP_EOL . 'table: ' . $tableName . PHP_EOL;
                $res = $this->database
                    ->select()
                    ->select('c.column_name, c.is_nullable, c.data_type, c.column_default, tc.constraint_type')
        Severity: Minor
        Found in src/Database/Pgsql/SchemaReader.php - About 1 hr to fix

          Method processToken has 42 lines of code (exceeds 25 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

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

              Method parseColumn has 41 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  private function parseColumn(Parser $parser) {
                      $columnName = $parser->inner(null, array(' ',"\r", "\n", "\t"));
                      $columnName = (string)$this->resolve(trim($columnName));
              
                      $type = (string)$parser->inner(null, ' ');
              Severity: Minor
              Found in src/Database/Mysql/CreateTableReader.php - About 1 hr to fix

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

                    public function build(Quoter $quoter = null)
                    {
                        if (null === $quoter) {
                            $quoter = $this->database()->getDriver();
                        }
                Severity: Minor
                Found in src/Sql/Statement.php - About 1 hr to fix

                  Method getTableDefinition has 40 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      public function getTableDefinition($tableName) {
                          $tableSymbol = new Symbol($tableName);
                          $res = $this->database->query("DESC ?", $tableSymbol);
                          $columns = new \stdClass();
                          while ($row = $res->fetchRow()) {
                  Severity: Minor
                  Found in src/Database/Mysql/SchemaReader.php - About 1 hr to fix

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

                      Function processIndexes has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
                      Open

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

                          public static function createFromFuncArguments($arguments, $operation = ' ')
                          {
                              if (empty($arguments)) {
                                  return new static();
                              }
                      Severity: Minor
                      Found in src/Sql/SimpleExpression.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 processColumns has 39 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          protected function processColumns()
                          {
                              $beforeColumns = $this->before->getColumns(true, true);
                              foreach ($this->after->getColumns(true, true) as $columnName => $afterColumn) {
                                  $afterTypeString = $afterColumn->getTypeString();
                      Severity: Minor
                      Found in src/Database/Pgsql/AlterTable.php - About 1 hr to fix

                        Method backTrace has 38 lines of code (exceeds 25 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 1 hr to fix
                          Severity
                          Category
                          Status
                          Source
                          Language