attogram/attogram-user

View on GitHub

Showing 56 of 56 total issues

isLoggedIn accesses the super-global variable $_SESSION.
Open

    public static function isLoggedIn()
    {
        if (isset($_SESSION['attogram_id'])
            && $_SESSION['attogram_id']
            && isset($_SESSION['AttogramUsername'])
Severity: Minor
Found in includes/AttogramUser.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

login accesses the super-global variable $_SESSION.
Open

    public static function login(\Psr\Log\LoggerInterface $log, \Attogram\AttogramDatabaseInterface $database)
    {
        if (!isset($_POST['u']) || !isset($_POST['p']) || !$_POST['u'] || !$_POST['p']) {
            $log->error('LOGIN: missing username or password');
            return false;
Severity: Minor
Found in includes/AttogramUser.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

Variable $this is undeclared
Open

        header('Location: ' . $this->path . '/');
Severity: Minor
Found in actions/login.php by phan

Call to method debug from undeclared class \Psr\Log\LoggerInterface
Open

        $log->debug('LOGIN: User Logged in');
Severity: Critical
Found in includes/AttogramUser.php by phan

Variable $this is undeclared
Open

        $this->event->info(
Severity: Minor
Found in actions/login.php by phan

Variable $this is undeclared
Open

$this->pageHeader('👥 User Admin');
Severity: Minor
Found in admin_actions/user-admin.php by phan

Parameter $database has undeclared type \Attogram\AttogramDatabaseInterface
Open

    public static function login(\Psr\Log\LoggerInterface $log, \Attogram\AttogramDatabaseInterface $database);
Severity: Minor
Found in includes/AttogramUser.php by phan

Parameter $database has undeclared type \Attogram\AttogramDatabaseInterface
Open

    public static function login(\Psr\Log\LoggerInterface $log, \Attogram\AttogramDatabaseInterface $database)
Severity: Minor
Found in includes/AttogramUser.php by phan

Call to method error from undeclared class \Psr\Log\LoggerInterface
Open

            $log->error('LOGIN: Login system offline');
Severity: Critical
Found in includes/AttogramUser.php by phan

Possibly zero references to use statement for classlike/namespace TestCase (\PHPUnit\Framework\TestCase)
Open

use PHPUnit\Framework\TestCase;
Severity: Minor
Found in tests/BaseTest.php by phan

Variable $this is undeclared
Open

    $this->error404('User Page Disbled.  Attogram User module missing in action!');
Severity: Minor
Found in actions/user.php by phan

Call to method error from undeclared class \Psr\Log\LoggerInterface
Open

            $log->error('LOGIN: missing username or password');
Severity: Critical
Found in includes/AttogramUser.php by phan

Reference to instance property database from undeclared class \Attogram\AttogramDatabaseInterface
Open

        if (!$database->database || $database->database->errorCode() != '00000') {
Severity: Minor
Found in includes/AttogramUser.php by phan

Variable $this is undeclared
Open

        $this->shutdown();
Severity: Minor
Found in actions/login.php by phan

Call to method error from undeclared class \Psr\Log\LoggerInterface
Open

            $log->error('LOGIN: Login system error');
Severity: Critical
Found in includes/AttogramUser.php by phan

Call to undeclared method \BaseTest::assertTrue
Open

        $this->assertTrue(true, 'true not true!');
Severity: Critical
Found in tests/BaseTest.php by phan

Variable $this is undeclared
Open

$this->pageFooter();
Severity: Minor
Found in actions/login.php by phan

Variable $this is undeclared
Open

    $this->shutdown();
Severity: Minor
Found in actions/user.php by phan

Variable $this is undeclared
Open

$this->pageHeader('👤 User page');
Severity: Minor
Found in actions/user.php by phan

Parameter $log has undeclared type \Psr\Log\LoggerInterface
Open

    public static function login(\Psr\Log\LoggerInterface $log, \Attogram\AttogramDatabaseInterface $database);
Severity: Minor
Found in includes/AttogramUser.php by phan
Severity
Category
Status
Source
Language