jasonsnider/tinker-mvc

View on GitHub

Showing 10 of 40 total issues

Function checkAsset has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
Open

    public function checkAsset($loader)
    {
        //The plugin name as it appears on the servers file path
        $plugin = $this->getPlugin(true);

Severity: Minor
Found in core/Tinker/src/Mvc/Router.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 __construct has 35 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function __construct($loader, $router, $theme, $view, $render = true) {

        $this->Loader = $loader;
        $this->Router = $router;
        $this->Theme = $theme;
Severity: Minor
Found in core/Tinker/src/Mvc/Dispatcher.php - About 1 hr to fix

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

    public function render($view)
    {
        $file = null;
        $theme = $this->getTheme();
        $layout = $this->getLayout();
Severity: Minor
Found in core/Tinker/src/Mvc/Theme.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 setViewPath has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

    public function setViewPath()
    {
        $plugin = $this->Router->getPlugin(true);
        $controller = $this->Router->getController();
        $action = $this->Router->getAction();
Severity: Minor
Found in core/Tinker/src/Mvc/View.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 render has 31 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function render($view)
    {
        $file = null;
        $theme = $this->getTheme();
        $layout = $this->getLayout();
Severity: Minor
Found in core/Tinker/src/Mvc/Theme.php - About 1 hr to fix

Method parseUri has 30 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function parseUri($requestUri)
    {
        //Parse each URI segment into it's own element then remove all elements
        //with an empty value.
        $uriSegments = array_filter(explode('/', $requestUri));
Severity: Minor
Found in core/Tinker/src/Mvc/Router.php - About 1 hr to fix

Function __construct has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

    public function __construct($loader, $router, $theme, $view, $render = true) {

        $this->Loader = $loader;
        $this->Router = $router;
        $this->Theme = $theme;
Severity: Minor
Found in core/Tinker/src/Mvc/Dispatcher.php - About 45 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

Method __construct has 5 arguments (exceeds 4 allowed). Consider refactoring.
Open

    public function __construct($loader, $router, $theme, $view, $render = true) {
Severity: Minor
Found in core/Tinker/src/Mvc/Dispatcher.php - About 35 mins to fix

Function fetchAsset has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public function fetchAsset($asset)
    {

        //If the request is a real file from the requested plugin
        if (is_file($asset)) {
Severity: Minor
Found in core/Tinker/src/Mvc/Router.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

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

    public function parseUri($requestUri)
    {
        //Parse each URI segment into it's own element then remove all elements
        //with an empty value.
        $uriSegments = array_filter(explode('/', $requestUri));
Severity: Minor
Found in core/Tinker/src/Mvc/Router.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