eveseat/eseye

View on GitHub
bin/index.php

Summary

Maintainability
C
7 hrs
Test Coverage

get_sso_callback_url accesses the super-global variable $_SERVER.
Open

function get_sso_callback_url()
{

    if (! empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off')
        $protocol = 'https://';
Severity: Minor
Found in bin/index.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

get_sso_callback_url accesses the super-global variable $_SERVER.
Open

function get_sso_callback_url()
{

    if (! empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off')
        $protocol = 'https://';
Severity: Minor
Found in bin/index.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

new_login accesses the super-global variable $_SERVER.
Open

function new_login()
{

    $action = $_SERVER['PHP_SELF'] . '?action=submitsecrets';
    $callback = get_sso_callback_url();
Severity: Minor
Found in bin/index.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

print_tokens accesses the super-global variable $_SERVER.
Open

function print_tokens($access_token, $refresh_token)
{

    $start_again_url = $_SERVER['PHP_SELF'] . '?action=new';

Severity: Minor
Found in bin/index.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

redirect_to_new accesses the super-global variable $_SERVER.
Open

function redirect_to_new()
{

    header('Location: ' . $_SERVER['PHP_SELF'] . '?action=new');
    exit;
Severity: Minor
Found in bin/index.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

get_sso_callback_url accesses the super-global variable $_SERVER.
Open

function get_sso_callback_url()
{

    if (! empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off')
        $protocol = 'https://';
Severity: Minor
Found in bin/index.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

get_sso_callback_url accesses the super-global variable $_SERVER.
Open

function get_sso_callback_url()
{

    if (! empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off')
        $protocol = 'https://';
Severity: Minor
Found in bin/index.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

Method new_login has 125 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function new_login()
{

    $action = $_SERVER['PHP_SELF'] . '?action=submitsecrets';
    $callback = get_sso_callback_url();
Severity: Major
Found in bin/index.php - About 5 hrs to fix

    File index.php has 276 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    <?php
    
    /*
     * This file is part of SeAT
     *
    Severity: Minor
    Found in bin/index.php - About 2 hrs to fix

      The function new_login() has 142 lines of code. Current threshold is set to 100. Avoid really long methods.
      Open

      function new_login()
      {
      
          $action = $_SERVER['PHP_SELF'] . '?action=submitsecrets';
          $callback = get_sso_callback_url();
      Severity: Minor
      Found in bin/index.php by phpmd

      The function redirect_to_new() contains an exit expression.
      Open

          exit;
      Severity: Minor
      Found in bin/index.php by phpmd

      ExitExpression

      Since: 0.2

      An exit-expression within regular code is untestable and therefore it should be avoided. Consider to move the exit-expression into some kind of startup script where an error/exception code is returned to the calling environment.

      Example

      class Foo {
          public function bar($param)  {
              if ($param === 42) {
                  exit(23);
              }
          }
      }

      Source https://phpmd.org/rules/design.html#exitexpression

      There are no issues that match your filters.

      Category
      Status