nice-php/framework

View on GitHub

Showing 7 of 7 total issues

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

class Application implements HttpKernelInterface, ExtendableInterface
{
    /**
     * @var bool
     */
Severity: Minor
Found in src/Application.php - About 2 hrs to fix

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

        public function initializeContainer(Application $application, array $extensions = array(), array $compilerPasses = array())
        {
            $container = $this->getContainerBuilder();
            $container->addObjectResource($application);
            $container->setParameter('app.env', $application->getEnvironment());
    Severity: Minor
    Found in src/DependencyInjection/ContainerInitializer/DefaultInitializer.php - About 1 hr to fix

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

          public function load(array $config, ContainerBuilder $container)
          {
              $container->register('router.parser', 'FastRoute\RouteParser\Std');
              $container->register('router.data_generator.strategy', 'FastRoute\DataGenerator\GroupCountBased');
              $container->register('router.data_generator', 'Nice\Router\NamedDataGenerator\HandlerWrapperGenerator')
      Severity: Minor
      Found in src/Extension/RouterExtension.php - About 1 hr to fix

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

            public function initializeContainer(Application $application, array $extensions = array(), array $compilerPasses = array())
            {
                $container = $this->getContainerBuilder();
                $container->addObjectResource($application);
                $container->setParameter('app.env', $application->getEnvironment());
        Severity: Minor
        Found in src/DependencyInjection/ContainerInitializer/DefaultInitializer.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 getData has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
        Open

            public function getData()
            {
                $routes = $this->routeCollector->getData();
                $data = array();
                foreach ($routes[0] as $method => $paths) {
        Severity: Minor
        Found in src/Router/UrlGenerator/GroupCountBasedDataGenerator.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 generate has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
        Open

            public function generate($name, array $parameters = array(), $absolute = false)
            {
                if (!$this->initialized) {
                    $this->initialize();
                }
        Severity: Minor
        Found in src/Router/UrlGenerator/SimpleUrlGenerator.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 parseDynamicGroup has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
        Open

            private function parseDynamicGroup($group)
            {
                $regex = $group['regex'];
                $parts = explode('|', $regex);
                $data = array();
        Severity: Minor
        Found in src/Router/UrlGenerator/GroupCountBasedDataGenerator.php - About 35 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