FlameCore/Infernum

View on GitHub

Showing 41 of 43 total issues

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

final class Kernel implements \ArrayAccess
{
    /**
     * @var string
     */
Severity: Minor
Found in libraries/Kernel.php - About 3 hrs to fix

    Method getDefinitionTree has 76 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        protected function getDefinitionTree()
        {
            $treeBuilder = new TreeBuilder();
            $rootNode = $treeBuilder->root('settings');
    
    
    Severity: Major
    Found in libraries/Configuration/SiteSettings.php - About 3 hrs to fix

      Form has 24 functions (exceeds 20 allowed). Consider refactoring.
      Open

      class Form implements \IteratorAggregate, \Countable
      {
          /**
           * @var string
           */
      Severity: Minor
      Found in libraries/UI/Form/Form.php - About 2 hrs to fix

        Application has 22 functions (exceeds 20 allowed). Consider refactoring.
        Open

        final class Application implements \ArrayAccess
        {
            /**
             * @var \FlameCore\Infernum\Container
             */
        Severity: Minor
        Found in libraries/Application.php - About 2 hrs to fix

          MySQLDriver has 22 functions (exceeds 20 allowed). Consider refactoring.
          Open

          class MySQLDriver extends AbstractDriver
          {
              /**
               * The link identifier of the connection
               *
          Severity: Minor
          Found in libraries/Database/MySQL/MySQLDriver.php - About 2 hrs to fix

            File Kernel.php has 255 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            <?php
            /**
             * Infernum
             * Copyright (C) 2015 IceFlame.net
             *
            Severity: Minor
            Found in libraries/Kernel.php - About 2 hrs to fix

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

                  public function locate($template)
                  {
                      $template = preg_replace('#/{2,}#', '/', strtr((string) $template, '\\', '/'));
              
                      if (strpos($template, "\0") !== false) {
              Severity: Minor
              Found in libraries/Template/TemplateLocator.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 execute has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
              Open

                  public function execute(array $parameters = null)
                  {
                      if (!empty($this->parameters)) {
                          $length = count($this->parameters);
              
              
              Severity: Minor
              Found in libraries/Database/MySQL/MySQLStatement.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 locate has 39 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  public function locate($template)
                  {
                      $template = preg_replace('#/{2,}#', '/', strtr((string) $template, '\\', '/'));
              
                      if (strpos($template, "\0") !== false) {
              Severity: Minor
              Found in libraries/Template/TemplateLocator.php - About 1 hr to fix

                Method getDefinitionTree has 36 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    protected function getDefinitionTree()
                    {
                        $treeBuilder = new TreeBuilder();
                        $rootNode = $treeBuilder->root('module');
                
                
                Severity: Minor
                Found in libraries/Configuration/ModuleMetadata.php - About 1 hr to fix

                  Method execute has 35 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      public function execute(array $parameters = null)
                      {
                          if (!empty($this->parameters)) {
                              $length = count($this->parameters);
                  
                  
                  Severity: Minor
                  Found in libraries/Database/MySQL/MySQLStatement.php - About 1 hr to fix

                    Method handle has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        public function handle(Request $request, Application $app)
                        {
                            if (!$this->isReady()) {
                                throw new \LogicException('Kernel must be booted to handle requests.');
                            }
                    Severity: Minor
                    Found in libraries/Kernel.php - About 1 hr to fix

                      Function boot has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                      Open

                          public function boot(Request $request)
                          {
                              $this->domain = $request->server->get('SERVER_NAME');
                              $this->secure = $request->isSecure();
                      
                      
                      Severity: Minor
                      Found in libraries/Kernel.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 30 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          public function __construct(Site $site, Kernel $kernel)
                          {
                              $this->site = $site;
                              $this->kernel = $kernel;
                      
                      
                      Severity: Minor
                      Found in libraries/Application.php - About 1 hr to fix

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

                            public function boot(Request $request)
                            {
                                $this->domain = $request->server->get('SERVER_NAME');
                                $this->secure = $request->isSecure();
                        
                        
                        Severity: Minor
                        Found in libraries/Kernel.php - About 1 hr to fix

                          Method getDefinitionTree has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              protected function getDefinitionTree()
                              {
                                  $treeBuilder = new TreeBuilder();
                                  $rootNode = $treeBuilder->root('theme');
                          
                          
                          Severity: Minor
                          Found in libraries/Configuration/ThemeMetadata.php - About 1 hr to fix

                            Function log has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                            Open

                                public function log($severity, $message, array $context = [])
                                {
                                    if (!$this->active) {
                                        return true;
                                    }
                            Severity: Minor
                            Found in libraries/Logger.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 set has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                            Open

                                public function set($name, $data, $lifetime)
                                {
                                    if (!$this->validateName($name)) {
                                        throw new \InvalidArgumentException(sprintf('Given cache name "%s" is invalid.', $name));
                                    }
                            Severity: Minor
                            Found in libraries/Cache.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 27 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                public function __construct($identifier, DriverInterface $database)
                                {
                                    $table = static::getTable();
                                    $fields = static::getFields();
                                    $columns = array_keys($fields);
                            Severity: Minor
                            Found in libraries/Resource/AbstractResource.php - About 1 hr to fix

                              Method log has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                  public function log($severity, $message, array $context = [])
                                  {
                                      if (!$this->active) {
                                          return true;
                                      }
                              Severity: Minor
                              Found in libraries/Logger.php - About 1 hr to fix
                                Severity
                                Category
                                Status
                                Source
                                Language