YetiForceCompany/YetiForceCRM

View on GitHub
tests/Init/InstallTest.php

Summary

Maintainability
A
0 mins
Test Coverage
A
100%

Missing class import via use statement (line '33', column '28').
Open

        static::assertTrue(((new \App\Db\Query())->from('vtiger_ws_fieldtype')->count()) > 0);
Severity: Minor
Found in tests/Init/InstallTest.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

Avoid using static access to class '\App\Db' in method 'testInstall'.
Open

        $db = \App\Db::getInstance();
Severity: Minor
Found in tests/Init/InstallTest.php by phpmd

StaticAccess

Since: 1.4.0

Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

Example

class Foo
{
    public function bar()
    {
        Bar::baz();
    }
}

Source https://phpmd.org/rules/cleancode.html#staticaccess

Avoid using static access to class '\Settings_ModuleManager_Library_Model' in method 'testDownloadLibrary'.
Open

        \Settings_ModuleManager_Library_Model::downloadAll();
Severity: Minor
Found in tests/Init/InstallTest.php by phpmd

StaticAccess

Since: 1.4.0

Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

Example

class Foo
{
    public function bar()
    {
        Bar::baz();
    }
}

Source https://phpmd.org/rules/cleancode.html#staticaccess

Avoid unused local variables such as '$name'.
Open

        foreach (\Settings_ModuleManager_Library_Model::$libraries as $name => $lib) {
Severity: Minor
Found in tests/Init/InstallTest.php by phpmd

UnusedLocalVariable

Since: 0.2

Detects when a local variable is declared and/or assigned, but not used.

Example

class Foo {
    public function doSomething()
    {
        $i = 5; // Unused
    }
}

Source https://phpmd.org/rules/unusedcode.html#unusedlocalvariable

Static call to undeclared method \Tests\Init\InstallTest::assertTrue
Open

        static::assertTrue(((new \App\Db\Query())->from('vtiger_ws_fieldtype')->count()) > 0);
Severity: Critical
Found in tests/Init/InstallTest.php by phan

Static call to undeclared method \Tests\Init\InstallTest::assertNotNull
Open

        static::assertNotNull($schema->getTableSchema('a_yf_adv_permission'));
Severity: Critical
Found in tests/Init/InstallTest.php by phan

Static call to undeclared method \Tests\Init\InstallTest::assertNotNull
Open

        static::assertNotNull($schema->getTableSchema('yetiforce_updates'));
Severity: Critical
Found in tests/Init/InstallTest.php by phan

Call to undeclared method \App\Db\Query::from
Open

        static::assertTrue(((new \App\Db\Query())->from('vtiger_ws_fieldtype')->count()) > 0);
Severity: Critical
Found in tests/Init/InstallTest.php by phan

Static call to undeclared method \Tests\Init\InstallTest::assertFileExists
Open

            static::assertFileExists($lib['dir'] . 'version.php');
Severity: Critical
Found in tests/Init/InstallTest.php by phan

Call to undeclared method \App\Db::getSchema
Open

        $schema = $db->getSchema();
Severity: Critical
Found in tests/Init/InstallTest.php by phan

Avoid variables with short names like $db. Configured minimum length is 3.
Open

        $db = \App\Db::getInstance();
Severity: Minor
Found in tests/Init/InstallTest.php by phpmd

ShortVariable

Since: 0.2

Detects when a field, local, or parameter has a very short name.

Example

class Something {
    private $q = 15; // VIOLATION - Field
    public static function main( array $as ) { // VIOLATION - Formal
        $r = 20 + $this->q; // VIOLATION - Local
        for (int $i = 0; $i < 10; $i++) { // Not a Violation (inside FOR)
            $r += $this->q;
        }
    }
}

Source https://phpmd.org/rules/naming.html#shortvariable

Spaces must be used to indent lines; tabs are not allowed
Open

    {
Severity: Minor
Found in tests/Init/InstallTest.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

        $db = \App\Db::getInstance();
Severity: Minor
Found in tests/Init/InstallTest.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

     */
Severity: Minor
Found in tests/Init/InstallTest.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

    public function testDownloadLibrary()
Severity: Minor
Found in tests/Init/InstallTest.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

        }
Severity: Minor
Found in tests/Init/InstallTest.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

        static::assertNotNull($schema->getTableSchema('a_yf_adv_permission'));
Severity: Minor
Found in tests/Init/InstallTest.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

     */
Severity: Minor
Found in tests/Init/InstallTest.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

    }
Severity: Minor
Found in tests/Init/InstallTest.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

    /**
Severity: Minor
Found in tests/Init/InstallTest.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

    public function testInstall()
Severity: Minor
Found in tests/Init/InstallTest.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

    {
Severity: Minor
Found in tests/Init/InstallTest.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

        $schema = $db->getSchema();
Severity: Minor
Found in tests/Init/InstallTest.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

     * Testing database installation from SQL file.
Severity: Minor
Found in tests/Init/InstallTest.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

        static::assertNotNull($schema->getTableSchema('yetiforce_updates'));
Severity: Minor
Found in tests/Init/InstallTest.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

    /**
Severity: Minor
Found in tests/Init/InstallTest.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

     * Testing library downloads.
Severity: Minor
Found in tests/Init/InstallTest.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

        foreach (\Settings_ModuleManager_Library_Model::$libraries as $name => $lib) {
Severity: Minor
Found in tests/Init/InstallTest.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

        static::assertTrue(((new \App\Db\Query())->from('vtiger_ws_fieldtype')->count()) > 0);
Severity: Minor
Found in tests/Init/InstallTest.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

        \Settings_ModuleManager_Library_Model::downloadAll();
Severity: Minor
Found in tests/Init/InstallTest.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

            static::assertFileExists($lib['dir'] . 'version.php');
Severity: Minor
Found in tests/Init/InstallTest.php by phpcodesniffer

Spaces must be used to indent lines; tabs are not allowed
Open

    }
Severity: Minor
Found in tests/Init/InstallTest.php by phpcodesniffer

There are no issues that match your filters.

Category
Status