Formula9/Framework

View on GitHub

Showing 120 of 487 total issues

Avoid too many return statements within this method.
Open

                    return dirname($file) . '/Resources/views';
Severity: Major
Found in F9/Providers/F9WebProfilerServiceProvider.php - About 30 mins to fix

    Avoid too many return statements within this method.
    Open

                    return new \Twig_Loader_Chain([
                        $app['twig.loader.array'],
                        $app['twig.loader.filesystem'],
                    ]);
    Severity: Major
    Found in F9/Providers/TwigViewServiceProvider.php - About 30 mins to fix

      Avoid too many return statements within this method.
      Open

                  return new RouterController($app['profiler'], $app['twig'], $app['request_matcher'] ?? NULL, $app['routes']);
      Severity: Major
      Found in F9/Providers/F9WebProfilerServiceProvider.php - About 30 mins to fix

        Avoid too many return statements within this method.
        Open

                    $app['blade.view'] = $app->factory(function () { return new BladeView($this->app['blade.context']); });
        Severity: Major
        Found in F9/Providers/BladeViewServiceProvider.php - About 30 mins to fix

          Avoid too many return statements within this method.
          Open

                              function () use ($app) { return new CompilerEngine($app['blade.compiler'], $app['files']); });
          Severity: Major
          Found in F9/Providers/BladeViewServiceProvider.php - About 30 mins to fix

            Avoid too many return statements within this method.
            Open

                                        return new TwigRenderer($app['twig.form.engine'], $app['csrf.token_manager']);
            Severity: Major
            Found in F9/Providers/TwigViewServiceProvider.php - About 30 mins to fix

              Avoid too many return statements within this method.
              Open

                              $collectors['form'] = function ($app) { return new FormDataCollector($app['data_collectors.form.extractor']); };
              Severity: Major
              Found in F9/Providers/F9WebProfilerServiceProvider.php - About 30 mins to fix

                Avoid too many return statements within this method.
                Open

                                return $collectors;
                Severity: Major
                Found in F9/Providers/F9WebProfilerServiceProvider.php - About 30 mins to fix

                  Avoid too many return statements within this method.
                  Open

                                  return $loader;
                  Severity: Major
                  Found in F9/Providers/F9WebProfilerServiceProvider.php - About 30 mins to fix

                    Avoid too many return statements within this method.
                    Open

                                    return dirname(dirname($r->getFileName())) . '/Resources/views';
                    Severity: Major
                    Found in F9/Providers/F9WebProfilerServiceProvider.php - About 30 mins to fix

                      Avoid too many return statements within this method.
                      Open

                                      return new ProfilerListener($app['profiler'], $app['request_stack'], $app['profiler.request_matcher'], $app['profiler.only_exceptions'], $app['profiler.only_master_requests']);
                      Severity: Major
                      Found in F9/Providers/F9WebProfilerServiceProvider.php - About 30 mins to fix

                        Avoid too many return statements within this method.
                        Open

                                        return new ProfilerListener($app['profiler'], $app['profiler.request_matcher'], $app['profiler.only_exceptions'], $app['profiler.only_master_requests'], $app['request_stack']);
                        Severity: Major
                        Found in F9/Providers/F9WebProfilerServiceProvider.php - About 30 mins to fix

                          Function array_get has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                          Open

                              public static function array_get($array, $key, $default = NULL)
                              {
                                  if (NULL === $key) {
                                      return $array;
                                  }
                          Severity: Minor
                          Found in Nine/Library/Arrays.php - About 25 mins 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 array_query has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                          Open

                              public static function array_query($array, $key, $default = NULL)
                              {
                                  if ($key instanceof \Closure) {
                                      return $key($array, $default);
                                  }
                          Severity: Minor
                          Found in Nine/Library/Arrays.php - About 25 mins 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 include_template has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                          Open

                              private function include_template($template, array $data = [])
                              {
                                  static $cache = [];
                          
                                  foreach ($this->templatePaths as $template_path)
                          Severity: Minor
                          Found in Nine/Views/MarkdownView.php - About 25 mins 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 array_has has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                          Open

                              public static function array_has($array, $key)
                              {
                                  if ([] === $array || NULL === $key) {
                                      return FALSE;
                                  }
                          Severity: Minor
                          Found in Nine/Library/Arrays.php - About 25 mins 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 parseContainer has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                          Open

                              protected function parseContainer(Container $container)
                              {
                                  $map = [];
                          
                                  foreach ($container->keys() as $name) {
                          Severity: Minor
                          Found in F9/Providers/PimpleDumpProvider.php - About 25 mins 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 build has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                          Open

                              public function build($concrete, array $parameters = [])
                              {
                                  // If the concrete type is actually a Closure, we will just execute it and
                                  // hand back the results of the functions, which allows functions to be
                                  // used as resolvers for more fine-tuned resolution of these objects.
                          Severity: Minor
                          Found in Nine/Containers/Container.php - About 25 mins 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 env has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                          Open

                              function env($key, $default = NULL)
                              {
                                  $value = getenv($key);
                          
                                  if ($value === FALSE) {
                          Severity: Minor
                          Found in Nine/Library/helpers.php - About 25 mins 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 array_fetch has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                          Open

                              public static function array_fetch($array, $key)
                              {
                                  $results = [];
                          
                                  foreach (explode('.', $key) as $segment) {
                          Severity: Minor
                          Found in Nine/Library/Arrays.php - About 25 mins 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