Formula9/Framework

View on GitHub

Showing 120 of 487 total issues

File Container.php has 547 lines of code (exceeds 250 allowed). Consider refactoring.
Open

<?php namespace Nine\Containers;

/**
 * **A Dependency Injection and Service Locator container.**
 *
Severity: Major
Found in Nine/Containers/Container.php - About 1 day to fix

    Container has 62 functions (exceeds 20 allowed). Consider refactoring.
    Open

    class Container implements ArrayAccess, ContainerContract
    {
        /**
         * The contextual binding map.
         *
    Severity: Major
    Found in Nine/Containers/Container.php - About 1 day to fix

      Method register has 192 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public function register(Container $app)
          {
              $app['profiler.mount_prefix'] = '/_profiler';
              $app->extend('dispatcher', function ($dispatcher, $app) {
                  return new TraceableEventDispatcher($dispatcher, $app['stopwatch'], $app['logger']);
      Severity: Major
      Found in F9/Providers/F9WebProfilerServiceProvider.php - About 7 hrs to fix

        File Arrays.php has 391 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        <?php namespace Nine\Library;
        
        /**
         * @package Nine Library
         * @version 0.3.1
        Severity: Minor
        Found in Nine/Library/Arrays.php - About 5 hrs to fix

          Function register has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring.
          Open

              public function register(Container $app)
              {
                  // only register if twig templates are enabled by the framework
                  if ($this->config['view.twig.enabled']) {
          
          
          Severity: Minor
          Found in F9/Providers/TwigViewServiceProvider.php - About 4 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 data_set has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring.
          Open

              public static function data_set(&$target, $key, $value, $overwrite = TRUE)
              {
                  $segments = is_array($key) ? $key : explode('.', $key);
          
                  if (($segment = array_shift($segments)) === '*') {
          Severity: Minor
          Found in Nine/Library/Support.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 register has 91 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              public function register(Container $app)
              {
                  // only register if twig templates are enabled by the framework
                  if ($this->config['view.twig.enabled']) {
          
          
          Severity: Major
          Found in F9/Providers/TwigViewServiceProvider.php - About 3 hrs to fix

            Method register has 74 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                public function register(Container $app)
                {
                    $app['db.default_options'] = [
                        'driver'   => 'pdo_mysql',
                        'dbname'   => env('DB_DATABASE', NULL),
            Severity: Major
            Found in F9/Providers/DoctrineServiceProvider.php - About 2 hrs to fix

              Function register has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
              Open

                  public function register(Container $app)
                  {
                      $app['profiler.mount_prefix'] = '/_profiler';
                      $app->extend('dispatcher', function ($dispatcher, $app) {
                          return new TraceableEventDispatcher($dispatcher, $app['stopwatch'], $app['logger']);
              Severity: Minor
              Found in F9/Providers/F9WebProfilerServiceProvider.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 F9WebProfilerServiceProvider.php has 276 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              <?php
              
              /*
               * This file is part of the Silex framework.
               *
              Severity: Minor
              Found in F9/Providers/F9WebProfilerServiceProvider.php - About 2 hrs to fix

                Function getMethodArguments has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
                Open

                    public function getMethodArguments(Request $request, $controller, array $parameters) : array
                    {
                        // use this request
                        $this->current_request = $request;
                
                
                Severity: Minor
                Found in Nine/Support/Reflector.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 parseItem has 59 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    protected function parseItem(Container $container, $name)
                    {
                        try {
                            $element = $container[$name];
                        } catch (\Exception $e) {
                Severity: Major
                Found in F9/Providers/PimpleDumpProvider.php - About 2 hrs to fix

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

                      protected function parseItem(Container $container, $name)
                      {
                          try {
                              $element = $container[$name];
                          } catch (\Exception $e) {
                  Severity: Minor
                  Found in F9/Providers/PimpleDumpProvider.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 data_get has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
                  Open

                      public static function data_get($target, $key, $default = NULL)
                      {
                          if (NULL === $key) {
                              return $target;
                          }
                  Severity: Minor
                  Found in Nine/Library/Support.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 extract_dependencies has 42 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      protected function extract_dependencies($class, $method = NULL)
                      {
                          // collect the request attributes
                          $attributes = $this->current_request->attributes->all();
                  
                  
                  Severity: Minor
                  Found in Nine/Support/Reflector.php - About 1 hr to fix

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

                        protected function extract_dependencies($class, $method = NULL)
                        {
                            // collect the request attributes
                            $attributes = $this->current_request->attributes->all();
                    
                    
                    Severity: Minor
                    Found in Nine/Support/Reflector.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 data_set has 39 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        public static function data_set(&$target, $key, $value, $overwrite = TRUE)
                        {
                            $segments = is_array($key) ? $key : explode('.', $key);
                    
                            if (($segment = array_shift($segments)) === '*') {
                    Severity: Minor
                    Found in Nine/Library/Support.php - About 1 hr to fix

                      Method set_loader has 38 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          private function set_loader($configuration)
                          {
                              switch (TRUE) {
                      
                                  case ($this->template_type === static::TWIG_LOADER_ARRAY):
                      Severity: Minor
                      Found in Nine/Views/TwigView.php - About 1 hr to fix

                        Method register has 37 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            public function register(Container $app)
                            {
                                $config = $this->config;
                        
                                // optionally include the Blade templating engine.
                        Severity: Minor
                        Found in F9/Providers/ViewServiceProvider.php - About 1 hr to fix

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

                              private function importByExtension($extension, $filePath, $key = '')
                              {
                                  $extension = strtolower(str_replace('*', '', $extension));
                          
                                  if ( ! in_array($extension, ['.json', '.php', '.yaml', '.yml'], TRUE)) {
                          Severity: Minor
                          Found in Nine/Collections/Config.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