jaroslavtyc/drd-plus-calculations

View on GitHub
tests/Calculations/SumAndRoundTest.php

Summary

Maintainability
A
0 mins
Test Coverage

Avoid using static access to class '\DrdPlus\Calculations\SumAndRound' in method 'I_can_round_a_number'.
Open

        self::assertSame(5, SumAndRound::round($shouldBeHigher));

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 '\DrdPlus\Calculations\SumAndRound' in method 'I_can_get_ceiled_half'.
Open

        self::assertSame(2, SumAndRound::ceiledHalf($number));

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 '\DrdPlus\Calculations\SumAndRound' in method 'I_can_get_floored_half'.
Open

        self::assertSame(2, SumAndRound::flooredHalf($number));

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 '\DrdPlus\Calculations\SumAndRound' in method 'I_can_get_ceiled_half'.
Open

        self::assertSame(3, SumAndRound::ceiledHalf($number));

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 '\DrdPlus\Calculations\SumAndRound' in method 'I_can_get_floored_half'.
Open

        self::assertSame(2, SumAndRound::flooredHalf($number));

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 '\DrdPlus\Calculations\SumAndRound' in method 'I_can_get_floored_half'.
Open

        self::assertSame(1, SumAndRound::flooredHalf($number));

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 '\DrdPlus\Calculations\SumAndRound' in method 'I_can_get_third'.
Open

        self::assertSame(3, SumAndRound::third($number));

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 '\DrdPlus\Calculations\SumAndRound' in method 'I_can_ceil_a_number'.
Open

        self::assertSame(9, SumAndRound::ceil($integerAndBit));

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 '\DrdPlus\Calculations\SumAndRound' in method 'I_can_get_round_half'.
Open

        self::assertSame(2, SumAndRound::half($number));

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 '\DrdPlus\Calculations\SumAndRound' in method 'I_can_get_floored_third'.
Open

        self::assertSame(0, SumAndRound::flooredThird($number));

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 '\DrdPlus\Calculations\SumAndRound' in method 'I_can_get_ceiled_half'.
Open

        self::assertSame(3, SumAndRound::ceiledHalf($number));

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 '\DrdPlus\Calculations\SumAndRound' in method 'I_can_get_round_average_of_two_numbers'.
Open

        self::assertSame(2, SumAndRound::average($firstNumber, $secondNumber));

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 '\DrdPlus\Calculations\SumAndRound' in method 'I_can_get_ceiled_third'.
Open

        self::assertSame(2, SumAndRound::ceiledThird($number));

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 '\DrdPlus\Calculations\SumAndRound' in method 'I_can_get_ceiled_third'.
Open

        self::assertSame(1, SumAndRound::ceiledThird($number));

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 '\DrdPlus\Calculations\SumAndRound' in method 'I_can_get_floored_third'.
Open

        self::assertSame(33, SumAndRound::flooredThird($number));

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 '\DrdPlus\Calculations\SumAndRound' in method 'I_can_get_round_average_of_two_numbers'.
Open

        self::assertSame(1, SumAndRound::average($firstNumber, $secondNumber));

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 '\DrdPlus\Calculations\SumAndRound' in method 'I_can_get_third'.
Open

        self::assertSame(1, SumAndRound::third($number));

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 '\DrdPlus\Calculations\SumAndRound' in method 'I_can_get_ceiled_third'.
Open

        self::assertSame(33, SumAndRound::ceiledThird($number));

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 '\DrdPlus\Calculations\SumAndRound' in method 'I_can_get_floored_third'.
Open

        self::assertSame(1, SumAndRound::flooredThird($number));

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 '\DrdPlus\Calculations\SumAndRound' in method 'I_can_ceil_a_number'.
Open

        self::assertSame(6, SumAndRound::ceil($almostHigherInteger));

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 '\DrdPlus\Calculations\SumAndRound' in method 'I_can_round_a_number'.
Open

        self::assertSame(4, SumAndRound::round($shouldBeLower));

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 '\DrdPlus\Calculations\SumAndRound' in method 'I_can_get_third'.
Open

        self::assertSame(0, SumAndRound::third($number));

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 '\DrdPlus\Calculations\SumAndRound' in method 'I_can_floor_a_number'.
Open

        self::assertSame(5, SumAndRound::floor($almostHigherInteger));

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 '\DrdPlus\Calculations\SumAndRound' in method 'I_can_get_round_half'.
Open

        self::assertSame(3, SumAndRound::half($number));

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

The method I_can_get_third is not named in camelCase.
Open

    public function I_can_get_third(): void
    {
        $number = 7.5;
        self::assertSame(3, SumAndRound::third($number));
        $number = 2.9999;

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 I_can_get_round_half is not named in camelCase.
Open

    public function I_can_get_round_half(): void
    {
        $number = 5;
        self::assertSame(3, SumAndRound::half($number));
        $number = 4.99;

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 I_can_get_floored_half is not named in camelCase.
Open

    public function I_can_get_floored_half(): void
    {
        $number = 5;
        self::assertSame(2, SumAndRound::flooredHalf($number));
        $number = 4.0001;

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 I_can_get_ceiled_half is not named in camelCase.
Open

    public function I_can_get_ceiled_half(): void
    {
        $number = 5;
        self::assertSame(3, SumAndRound::ceiledHalf($number));
        $number = 4.0001;

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 I_can_floor_a_number is not named in camelCase.
Open

    public function I_can_floor_a_number(): void
    {
        $almostHigherInteger = 5.999999;
        self::assertSame(5, SumAndRound::floor($almostHigherInteger));
    }

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 I_can_get_floored_third is not named in camelCase.
Open

    public function I_can_get_floored_third(): void
    {
        $number = 5;
        self::assertSame(1, SumAndRound::flooredThird($number));
        $number = 2.9999;

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 I_can_round_a_number is not named in camelCase.
Open

    public function I_can_round_a_number(): void
    {
        $shouldBeHigher = 4.5;
        self::assertSame(5, SumAndRound::round($shouldBeHigher));
        $shouldBeLower = 4.4;

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 I_can_ceil_a_number is not named in camelCase.
Open

    public function I_can_ceil_a_number(): void
    {
        $almostHigherInteger = 5.999999;
        self::assertSame(6, SumAndRound::ceil($almostHigherInteger));
        $integerAndBit = 8.0000001;

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 I_can_get_ceiled_third is not named in camelCase.
Open

    public function I_can_get_ceiled_third(): void
    {
        $number = 5;
        self::assertSame(2, SumAndRound::ceiledThird($number));
        $number = 2.9999;

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 I_can_get_round_average_of_two_numbers is not named in camelCase.
Open

    public function I_can_get_round_average_of_two_numbers(): void
    {
        $firstNumber = 1.5123;
        $secondNumber = 2.5123;
        self::assertSame(2, SumAndRound::average($firstNumber, $secondNumber));

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