Formula9/Framework

View on GitHub
F9/Providers/ViewServiceProvider.php

Summary

Maintainability
A
2 hrs
Test Coverage

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

    Avoid too many return statements within this method.
    Open

                        return "<span class='glyphicon glyphicon-$glyph'></span>";
    Severity: Major
    Found in F9/Providers/ViewServiceProvider.php - About 30 mins to fix

      Avoid too many return statements within this method.
      Open

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

        Missing class import via use statement (line '75', column '40').
        Open

                        $twig->addFunction(new \Twig_SimpleFunction('image', function ($asset) use ($app, $base_path) {
        Severity: Minor
        Found in F9/Providers/ViewServiceProvider.php by phpmd

        MissingImport

        Since: 2.7.0

        Importing all external classes in a file through use statements makes them clearly visible.

        Example

        function make() {
            return new \stdClass();
        }

        Source http://phpmd.org/rules/cleancode.html#MissingImport

        Missing class import via use statement (line '82', column '40').
        Open

                        $twig->addFunction(new \Twig_SimpleFunction('script', function ($asset) use ($app, $base_path) {
        Severity: Minor
        Found in F9/Providers/ViewServiceProvider.php by phpmd

        MissingImport

        Since: 2.7.0

        Importing all external classes in a file through use statements makes them clearly visible.

        Example

        function make() {
            return new \stdClass();
        }

        Source http://phpmd.org/rules/cleancode.html#MissingImport

        Missing class import via use statement (line '68', column '40').
        Open

                        $twig->addFunction(new \Twig_SimpleFunction('asset', function ($asset) use ($app, $base_path) {
        Severity: Minor
        Found in F9/Providers/ViewServiceProvider.php by phpmd

        MissingImport

        Since: 2.7.0

        Importing all external classes in a file through use statements makes them clearly visible.

        Example

        function make() {
            return new \stdClass();
        }

        Source http://phpmd.org/rules/cleancode.html#MissingImport

        Missing class import via use statement (line '89', column '40').
        Open

                        $twig->addFunction(new \Twig_SimpleFunction('style', function ($asset) use ($app, $base_path) {
        Severity: Minor
        Found in F9/Providers/ViewServiceProvider.php by phpmd

        MissingImport

        Since: 2.7.0

        Importing all external classes in a file through use statements makes them clearly visible.

        Example

        function make() {
            return new \stdClass();
        }

        Source http://phpmd.org/rules/cleancode.html#MissingImport

        Missing class import via use statement (line '96', column '40').
        Open

                        $twig->addFunction(new \Twig_SimpleFunction('glyph', function ($glyph) use ($app) {
        Severity: Minor
        Found in F9/Providers/ViewServiceProvider.php by phpmd

        MissingImport

        Since: 2.7.0

        Importing all external classes in a file through use statements makes them clearly visible.

        Example

        function make() {
            return new \stdClass();
        }

        Source http://phpmd.org/rules/cleancode.html#MissingImport

        The variable $base_path is not named in camelCase.
        Open

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

        CamelCaseVariableName

        Since: 0.2

        It is considered best practice to use the camelCase notation to name variables.

        Example

        class ClassName {
            public function doSomething() {
                $data_module = new DataModule();
            }
        }

        Source

        The variable $base_path is not named in camelCase.
        Open

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

        CamelCaseVariableName

        Since: 0.2

        It is considered best practice to use the camelCase notation to name variables.

        Example

        class ClassName {
            public function doSomething() {
                $data_module = new DataModule();
            }
        }

        Source

        The variable $base_path is not named in camelCase.
        Open

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

        CamelCaseVariableName

        Since: 0.2

        It is considered best practice to use the camelCase notation to name variables.

        Example

        class ClassName {
            public function doSomething() {
                $data_module = new DataModule();
            }
        }

        Source

        The variable $current_request is not named in camelCase.
        Open

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

        CamelCaseVariableName

        Since: 0.2

        It is considered best practice to use the camelCase notation to name variables.

        Example

        class ClassName {
            public function doSomething() {
                $data_module = new DataModule();
            }
        }

        Source

        The variable $base_path is not named in camelCase.
        Open

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

        CamelCaseVariableName

        Since: 0.2

        It is considered best practice to use the camelCase notation to name variables.

        Example

        class ClassName {
            public function doSomething() {
                $data_module = new DataModule();
            }
        }

        Source

        The variable $base_path is not named in camelCase.
        Open

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

        CamelCaseVariableName

        Since: 0.2

        It is considered best practice to use the camelCase notation to name variables.

        Example

        class ClassName {
            public function doSomething() {
                $data_module = new DataModule();
            }
        }

        Source

        The variable $current_request is not named in camelCase.
        Open

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

        CamelCaseVariableName

        Since: 0.2

        It is considered best practice to use the camelCase notation to name variables.

        Example

        class ClassName {
            public function doSomething() {
                $data_module = new DataModule();
            }
        }

        Source

        The variable $current_request is not named in camelCase.
        Open

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

        CamelCaseVariableName

        Since: 0.2

        It is considered best practice to use the camelCase notation to name variables.

        Example

        class ClassName {
            public function doSomething() {
                $data_module = new DataModule();
            }
        }

        Source

        There are no issues that match your filters.

        Category
        Status