condorrocks/condor

View on GitHub
packages/alariva/uptimerobot/test/uptimerobotTest.php

Summary

Maintainability
A
0 mins
Test Coverage

The class UptimeRobotTest has 17 public methods. Consider refactoring UptimeRobotTest to keep number of public methods under 10.
Open

class UptimeRobotTest extends PHPUnit_Framework_TestCase
{
    /**
     * @var UptimeRobot
     */

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

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

        $this->object = new UptimeRobot;

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 'UptimeRobot' in method 'testConfigure'.
Open

        $this->assertEquals(0, UptimeRobot::configure($this->apiKey, 1));

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 '$responseTimes'.
Open

        $this->assertNotEquals(null, $this->object->getMonitors($monitors = static::$newMonitorId, $customUptimeRatio = null, $logs = 1, $responseTimes = 1, $responseTimesAverage = 1, $alertContacts = 1, $showMonitorAlertContacts = 1, $showTimezone = 1));

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

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

        $this->assertNotEquals(null, $this->object->getMonitors($monitors = static::$newMonitorId, $customUptimeRatio = null, $logs = 1, $responseTimes = 1, $responseTimesAverage = 1, $alertContacts = 1, $showMonitorAlertContacts = 1, $showTimezone = 1));

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

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

        $this->assertNotEquals(null, $this->object->editMonitor($monitorId = static::$newMonitorId, $monitorStatus = 0, $friendlyName = 'Edit 1', $URL = 'http://google.com', $subType = null, $port = null, $keywordType = null, $keywordValue = null, $HTTPUsername = null, $HTTPPassword = null));

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

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

        $this->assertNotEquals(null, $this->object->editMonitor($monitorId = static::$newMonitorId, $monitorStatus = 0, $friendlyName = 'Edit 1', $URL = 'http://google.com', $subType = null, $port = null, $keywordType = null, $keywordValue = null, $HTTPUsername = null, $HTTPPassword = null));

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

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

        $this->assertNotEquals(null, $this->object->getMonitors($monitors = static::$newMonitorId, $customUptimeRatio = null, $logs = 1, $responseTimes = 1, $responseTimesAverage = 1, $alertContacts = 1, $showMonitorAlertContacts = 1, $showTimezone = 1));

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

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

        $this->assertNotEquals(null, $this->object->getMonitors($monitors = static::$newMonitorId, $customUptimeRatio = null, $logs = 1, $responseTimes = 1, $responseTimesAverage = 1, $alertContacts = 1, $showMonitorAlertContacts = 1, $showTimezone = 1));

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

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

        $this->assertNotEquals(null, $this->object->editMonitor($monitorId = static::$newMonitorId, $monitorStatus = 0, $friendlyName = 'Edit 1', $URL = 'http://google.com', $subType = null, $port = null, $keywordType = null, $keywordValue = null, $HTTPUsername = null, $HTTPPassword = null));

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

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

        $this->assertNotEquals(null, $this->object->editMonitor($monitorId = static::$newMonitorId, $monitorStatus = 0, $friendlyName = 'Edit 1', $URL = 'http://google.com', $subType = null, $port = null, $keywordType = null, $keywordValue = null, $HTTPUsername = null, $HTTPPassword = null));

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

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

        $this->assertNotEquals(null, $this->object->getMonitors($monitors = static::$newMonitorId, $customUptimeRatio = null, $logs = 1, $responseTimes = 1, $responseTimesAverage = 1, $alertContacts = 1, $showMonitorAlertContacts = 1, $showTimezone = 1));

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

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

        $this->assertNotEquals(null, $this->object->editMonitor($monitorId = static::$newMonitorId, $monitorStatus = 0, $friendlyName = 'Edit 1', $URL = 'http://google.com', $subType = null, $port = null, $keywordType = null, $keywordValue = null, $HTTPUsername = null, $HTTPPassword = null));

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

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

        $this->assertNotEquals(null, $this->object->editMonitor($monitorId = static::$newMonitorId, $monitorStatus = 0, $friendlyName = 'Edit 1', $URL = 'http://google.com', $subType = null, $port = null, $keywordType = null, $keywordValue = null, $HTTPUsername = null, $HTTPPassword = null));

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

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

        $this->assertNotEquals(null, $this->object->editMonitor($monitorId = static::$newMonitorId, $monitorStatus = 0, $friendlyName = 'Edit 1', $URL = 'http://google.com', $subType = null, $port = null, $keywordType = null, $keywordValue = null, $HTTPUsername = null, $HTTPPassword = null));

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

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

        $this->assertNotEquals(null, $this->object->getMonitors($monitors = static::$newMonitorId, $customUptimeRatio = null, $logs = 1, $responseTimes = 1, $responseTimesAverage = 1, $alertContacts = 1, $showMonitorAlertContacts = 1, $showTimezone = 1));

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

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

        $this->assertNotEquals(null, $this->object->getMonitors($monitors = static::$newMonitorId, $customUptimeRatio = null, $logs = 1, $responseTimes = 1, $responseTimesAverage = 1, $alertContacts = 1, $showMonitorAlertContacts = 1, $showTimezone = 1));

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

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

        $this->assertNotEquals(null, $this->object->editMonitor($monitorId = static::$newMonitorId, $monitorStatus = 0, $friendlyName = 'Edit 1', $URL = 'http://google.com', $subType = null, $port = null, $keywordType = null, $keywordValue = null, $HTTPUsername = null, $HTTPPassword = null));

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

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

        $this->assertNotEquals(null, $this->object->getMonitors($monitors = static::$newMonitorId, $customUptimeRatio = null, $logs = 1, $responseTimes = 1, $responseTimesAverage = 1, $alertContacts = 1, $showMonitorAlertContacts = 1, $showTimezone = 1));

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

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

        $this->assertNotEquals(null, $this->object->editMonitor($monitorId = static::$newMonitorId, $monitorStatus = 0, $friendlyName = 'Edit 1', $URL = 'http://google.com', $subType = null, $port = null, $keywordType = null, $keywordValue = null, $HTTPUsername = null, $HTTPPassword = null));

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

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

        $this->assertNotEquals(null, $this->object->editMonitor($monitorId = static::$newMonitorId, $monitorStatus = 0, $friendlyName = 'Edit 1', $URL = 'http://google.com', $subType = null, $port = null, $keywordType = null, $keywordValue = null, $HTTPUsername = null, $HTTPPassword = null));

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

Each class must be in a namespace of at least one level (a top-level vendor name)
Open

class UptimeRobotTest extends PHPUnit_Framework_TestCase

A file should declare new symbols (classes, functions, constants, etc.) and cause no other side effects, or it should execute logic with side effects, but should not do both. The first symbol is defined on line 11 and the first side effect is on line 10.
Open

<?php

Visibility must be declared on property "$newUserId"
Open

    static $newUserId;

Method name "UptimeRobotTest::testSetFormat_err" is not in camel caps format
Open

    public function testSetFormat_err()

Method name "UptimeRobotTest::testDeleteMonitor_1" is not in camel caps format
Open

    public function testDeleteMonitor_1()

Method name "UptimeRobotTest::testGetMonitors_created" is not in camel caps format
Open

    public function testGetMonitors_created()

Method name "UptimeRobotTest::testDeleteMonitor_whitout_params" is not in camel caps format
Open

    public function testDeleteMonitor_whitout_params()

Method name "UptimeRobotTest::testGetAlertContacts_all" is not in camel caps format
Open

    public function testGetAlertContacts_all()

Function closing brace must go on the next line following the body; found 1 blank lines before brace
Open

    }

Method name "UptimeRobotTest::testGetAlertContacts_created" is not in camel caps format
Open

    public function testGetAlertContacts_created()

Method name "UptimeRobotTest::testGetApiKey_whitoutConf" is not in camel caps format
Open

    public function testGetApiKey_whitoutConf()

The closing brace for the class must go on the next line after the body
Open

}

Method name "UptimeRobotTest::testSetFormat_2" is not in camel caps format
Open

    public function testSetFormat_2()

Method name "UptimeRobotTest::testSetFormat_1" is not in camel caps format
Open

    public function testSetFormat_1()

Method name "UptimeRobotTest::testGetMonitors_1" is not in camel caps format
Open

    public function testGetMonitors_1()

Visibility must be declared on property "$newMonitorId"
Open

    static $newMonitorId;

Line exceeds 120 characters; contains 293 characters
Open

        $this->assertNotEquals(null, $this->object->editMonitor($monitorId = static::$newMonitorId, $monitorStatus = 0, $friendlyName = 'Edit 1', $URL = 'http://google.com', $subType = null, $port = null, $keywordType = null, $keywordValue = null, $HTTPUsername = null, $HTTPPassword = null));

Line exceeds 120 characters; contains 255 characters
Open

        $this->assertNotEquals(null, $this->object->getMonitors($monitors = static::$newMonitorId, $customUptimeRatio = null, $logs = 1, $responseTimes = 1, $responseTimesAverage = 1, $alertContacts = 1, $showMonitorAlertContacts = 1, $showTimezone = 1));

Whitespace found at end of line
Open

 * 

Expected 1 newline at end of file; 0 found
Open

}

Whitespace found at end of line
Open

     * 

Whitespace found at end of line
Open

     * 

The variable $URL is not named in camelCase.
Open

    public function testEditMonitor()
    {
        $this->assertNotEquals(null, $this->object->editMonitor($monitorId = static::$newMonitorId, $monitorStatus = 0, $friendlyName = 'Edit 1', $URL = 'http://google.com', $subType = null, $port = null, $keywordType = null, $keywordValue = null, $HTTPUsername = null, $HTTPPassword = null));
    }

CamelCaseVariableName

Since: 0.2

It is considered best practice to use the camelCase notation to name variables.

Example

class ClassName {
    public function doSomething() {
        $data_module = new DataModule();
    }
}

Source

The variable $HTTPUsername is not named in camelCase.
Open

    public function testEditMonitor()
    {
        $this->assertNotEquals(null, $this->object->editMonitor($monitorId = static::$newMonitorId, $monitorStatus = 0, $friendlyName = 'Edit 1', $URL = 'http://google.com', $subType = null, $port = null, $keywordType = null, $keywordValue = null, $HTTPUsername = null, $HTTPPassword = null));
    }

CamelCaseVariableName

Since: 0.2

It is considered best practice to use the camelCase notation to name variables.

Example

class ClassName {
    public function doSomething() {
        $data_module = new DataModule();
    }
}

Source

The variable $HTTPPassword is not named in camelCase.
Open

    public function testEditMonitor()
    {
        $this->assertNotEquals(null, $this->object->editMonitor($monitorId = static::$newMonitorId, $monitorStatus = 0, $friendlyName = 'Edit 1', $URL = 'http://google.com', $subType = null, $port = null, $keywordType = null, $keywordValue = null, $HTTPUsername = null, $HTTPPassword = null));
    }

CamelCaseVariableName

Since: 0.2

It is considered best practice to use the camelCase notation to name variables.

Example

class ClassName {
    public function doSomething() {
        $data_module = new DataModule();
    }
}

Source

The method testSetFormat_1 is not named in camelCase.
Open

    public function testSetFormat_1()
    {
        $this->assertEquals(0, $this->object->setFormat('xml'));
    }

CamelCaseMethodName

Since: 0.2

It is considered best practice to use the camelCase notation to name methods.

Example

class ClassName {
    public function get_name() {
    }
}

Source

The method testGetMonitors_created is not named in camelCase.
Open

    public function testGetMonitors_created()
    {
        $this->assertNotEquals(null, $this->object->getMonitors($monitors = static::$newMonitorId, $customUptimeRatio = null, $logs = 1, $responseTimes = 1, $responseTimesAverage = 1, $alertContacts = 1, $showMonitorAlertContacts = 1, $showTimezone = 1));
    }

CamelCaseMethodName

Since: 0.2

It is considered best practice to use the camelCase notation to name methods.

Example

class ClassName {
    public function get_name() {
    }
}

Source

The method testSetFormat_2 is not named in camelCase.
Open

    public function testSetFormat_2()
    {
        $this->assertEquals(0, $this->object->setFormat('json'));
    }

CamelCaseMethodName

Since: 0.2

It is considered best practice to use the camelCase notation to name methods.

Example

class ClassName {
    public function get_name() {
    }
}

Source

The method testDeleteMonitor_1 is not named in camelCase.
Open

    public function testDeleteMonitor_1()
    {
        $this->assertNotEquals(null, $this->object->deleteMonitor(static::$newMonitorId));
    }

CamelCaseMethodName

Since: 0.2

It is considered best practice to use the camelCase notation to name methods.

Example

class ClassName {
    public function get_name() {
    }
}

Source

The method testGetApiKey_whitoutConf is not named in camelCase.
Open

    public function testGetApiKey_whitoutConf()
    {
        $this->object->getApiKey();
    }

CamelCaseMethodName

Since: 0.2

It is considered best practice to use the camelCase notation to name methods.

Example

class ClassName {
    public function get_name() {
    }
}

Source

The method testDeleteMonitor_whitout_params is not named in camelCase.
Open

    public function testDeleteMonitor_whitout_params()
    {
        $this->object->deleteMonitor();
    }

CamelCaseMethodName

Since: 0.2

It is considered best practice to use the camelCase notation to name methods.

Example

class ClassName {
    public function get_name() {
    }
}

Source

The method testGetAlertContacts_all is not named in camelCase.
Open

    public function testGetAlertContacts_all()
    {
        $this->assertNotEquals(null, $this->object->getAlertContacts());
    }

CamelCaseMethodName

Since: 0.2

It is considered best practice to use the camelCase notation to name methods.

Example

class ClassName {
    public function get_name() {
    }
}

Source

The method testSetFormat_err is not named in camelCase.
Open

    public function testSetFormat_err()
    {
        $this->object->setFormat('test');
    }

CamelCaseMethodName

Since: 0.2

It is considered best practice to use the camelCase notation to name methods.

Example

class ClassName {
    public function get_name() {
    }
}

Source

The method testGetMonitors_1 is not named in camelCase.
Open

    public function testGetMonitors_1()
    {
        $this->assertNotEquals(null, $this->object->getMonitors());
    }

CamelCaseMethodName

Since: 0.2

It is considered best practice to use the camelCase notation to name methods.

Example

class ClassName {
    public function get_name() {
    }
}

Source

The method testGetAlertContacts_created is not named in camelCase.
Open

    public function testGetAlertContacts_created()
    {
        $this->assertNotEquals(null, $this->object->getAlertContacts(static::$newUserId));
    }

CamelCaseMethodName

Since: 0.2

It is considered best practice to use the camelCase notation to name methods.

Example

class ClassName {
    public function get_name() {
    }
}

Source

There are no issues that match your filters.

Category
Status