NeroReflex/Gishiki

View on GitHub

Showing 48 of 176 total issues

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

    public function __construct(array $options)
    {
        $this->route = [
            "plugins" => [
                "deserializer" => DeserializerPlugin::class,
Severity: Minor
Found in src/Core/Router/Route.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 definedAs has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
Open

    public function &definedAs(array $columns) : SQLWrapperInterface
    {
        //mysql wants PRIMARY KEY(...) after column definitions
        $primaryKeyName = '';

Severity: Minor
Found in src/Database/Adapters/Utils/SQLGenerator/MySQLWrapper.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 definedAs has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
Open

    public function &definedAs(array $columns) : SQLWrapperInterface
    {
        $this->appendToQuery('(');

        $first = true;
Severity: Minor
Found in src/Database/Adapters/Utils/SQLGenerator/PostgreSQLWrapper.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 deserialize has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
Open

    public static function deserialize($message, $format = self::JSON)
    {
        if ((is_array($message)) || ($message instanceof CollectionInterface)) {
            return new self($message);
        } elseif ($format === self::JSON) {
Severity: Minor
Found in src/Algorithms/Collections/SerializableCollection.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 definedAs has 55 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function &definedAs(array $columns) : SQLWrapperInterface
    {
        //mysql wants PRIMARY KEY(...) after column definitions
        $primaryKeyName = '';

Severity: Major
Found in src/Database/Adapters/Utils/SQLGenerator/MySQLWrapper.php - About 2 hrs to fix

    Method __construct has 51 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public function __construct(array $options)
        {
            $this->route = [
                "plugins" => [
                    "deserializer" => DeserializerPlugin::class,
    Severity: Major
    Found in src/Core/Router/Route.php - About 2 hrs to fix

      Consider simplifying this complex logical expression.
      Open

              if (($relation != FieldRelation::EQUAL) &&
                  ($relation != FieldRelation::NOT_EQUAL) &&
                  ($relation != FieldRelation::LESS_THAN) &&
                  ($relation != FieldRelation::LESS_OR_EQUAL_THAN) &&
                  ($relation != FieldRelation::GREATER_THAN) &&
      Severity: Critical
      Found in src/Database/Runtime/SelectionCriteria.php - About 2 hrs to fix

        Method definedAs has 50 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public function &definedAs(array $columns) : SQLWrapperInterface
            {
                $this->appendToQuery('(');
        
                $first = true;
        Severity: Minor
        Found in src/Database/Adapters/Utils/SQLGenerator/PostgreSQLWrapper.php - About 2 hrs to fix

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

              public function &definedAs(array $columns) : SQLWrapperInterface
              {
                  $this->appendToQuery('(');
          
                  $first = true;
          Severity: Minor
          Found in src/Database/Adapters/Utils/SQLGenerator/SQLiteWrapper.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 loadErrorHandlers has 46 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              protected function loadErrorHandlers($method) : array
              {
                  $errorHandlers = [];
          
                  foreach ($this->routes[$method] as &$currentRoute) {
          Severity: Minor
          Found in src/Core/Router/Router.php - About 1 hr to fix

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

                public function &definedAs(array $columns) : SQLWrapperInterface
                {
                    $this->appendToQuery('(');
            
                    $first = true;
            Severity: Minor
            Found in src/Database/Adapters/Utils/SQLGenerator/SQLiteWrapper.php - About 1 hr to fix

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

                  public static function deserialize($message, $format = self::JSON)
                  {
                      if ((is_array($message)) || ($message instanceof CollectionInterface)) {
                          return new self($message);
                      } elseif ($format === self::JSON) {
              Severity: Minor
              Found in src/Algorithms/Collections/SerializableCollection.php - About 1 hr to fix

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

                    protected function parsePDOConnectionQuery($connection)
                    {
                        $rawParams = [];
                        $paramSplit = explode(';', $connection);
                
                

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

                    public function fromMixed($mixed, \DOMElement $domElement = null)
                    {
                        $domElement = is_null($domElement) ? $this : $domElement;
                
                        if (is_array($mixed)) {
                Severity: Minor
                Found in src/Algorithms/XmlDomConstructor.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 initTransitionSchema has 39 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    private function initTransitionSchema()
                    {
                        //table must have been already correctly parsed, so I know data is well-formed
                        if (!ActiveRecordTables::isRegistered(static::class)) {
                            throw new ActiveRecordException("Table definition for the current ActiveRecord object is missing.", 300);
                Severity: Minor
                Found in src/Core/MVC/Model/ActiveRecordSerializationTrait.php - About 1 hr to fix

                  Function matchCheck has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
                  Open

                      protected static function matchCheck($uriSplit, $urlSplit, array &$params) : bool
                      {
                          $result = false;
                  
                          if ((strlen($uriSplit) >= 7) && ($uriSplit[0] == '{') && ($uriSplit[strlen($uriSplit) - 1] == '}')) {
                  Severity: Minor
                  Found in src/Core/Router/MatchableRouteTrait.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 initialize has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
                  Open

                      public static function initialize($init = null)
                      {
                          if ((!is_null($init)) && (!is_array($init))) {
                              throw new \InvalidArgumentException('The initialization filter con only be null or a valid array');
                          }
                  Severity: Minor
                  Found in src/Database/Runtime/ResultModifier.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 where has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      public function &where(SelectionCriteria $where) : SQLWrapperInterface
                      {
                          //execute the private function 'export'
                          $exportMethod = new \ReflectionMethod($where, 'export');
                          $exportMethod->setAccessible(true);
                  Severity: Minor
                  Found in src/Database/Adapters/Utils/SQLGenerator/SQLWrapper.php - About 1 hr to fix

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

                        protected function parsePDOConnectionQuery($connection)
                        {
                            $rawParams = [];
                            $paramSplit = explode(';', $connection);
                    
                    

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

                          public function __construct(RequestInterface &$request, ResponseInterface &$response, Application $app = null)
                          {
                              //this is important, NEVER forget!
                              parent::__construct($request, $response, $app);
                      
                      
                      Severity: Minor
                      Found in src/Core/MVC/Controller/Plugins/RequestDeserializer.php - About 1 hr to fix
                        Severity
                        Category
                        Status
                        Source
                        Language