sformisano/jetski-router

View on GitHub
src/Router.php

Summary

Maintainability
A
0 mins
Test Coverage

run accesses the super-global variable $_SERVER.
Open

  public function run()
  {
    $httpMethod = $_SERVER['REQUEST_METHOD'];
    $path = parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH);

Severity: Minor
Found in src/Router.php by phpmd

Superglobals

Since: 0.2

Accessing a super-global variable directly is considered a bad practice. These variables should be encapsulated in objects that are provided by a framework, for instance.

Example

class Foo {
    public function bar() {
        $name = $_POST['foo'];
    }
}

Source

run accesses the super-global variable $_SERVER.
Open

  public function run()
  {
    $httpMethod = $_SERVER['REQUEST_METHOD'];
    $path = parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH);

Severity: Minor
Found in src/Router.php by phpmd

Superglobals

Since: 0.2

Accessing a super-global variable directly is considered a bad practice. These variables should be encapsulated in objects that are provided by a framework, for instance.

Example

class Foo {
    public function bar() {
        $name = $_POST['foo'];
    }
}

Source

The class Router has 12 public methods. Consider refactoring Router to keep number of public methods under 10.
Open

class Router
{

  /*** PROPERTIES ***/

Severity: Minor
Found in src/Router.php by phpmd

TooManyPublicMethods

Since: 0.1

A class with too many public methods is probably a good suspect for refactoring, in order to reduce its complexity and find a way to have more fine grained objects.

By default it ignores methods starting with 'get' or 'set'.

Example

Source https://phpmd.org/rules/codesize.html#toomanypublicmethods

There are no issues that match your filters.

Category
Status