gowork/values

View on GitHub

Showing 49 of 57 total issues

The class PlainArray has 40 non-getter- and setter-methods. Consider refactoring PlainArray to keep number of methods under 25.
Open

final class PlainArray implements ArrayValue
{
    /** @phpstan-var Arrayable<TValue> */
    private Arrayable $items;

Severity: Minor
Found in src/PlainArray.php by phpmd

TooManyMethods

Since: 0.1

A class with too many 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'.

The default was changed from 10 to 25 in PHPMD 2.3.

Example

Source https://phpmd.org/rules/codesize.html#toomanymethods

The class PlainString has 37 non-getter- and setter-methods. Consider refactoring PlainString to keep number of methods under 25.
Open

final class PlainString implements StringValue
{
    /** @var string */
    private string $value;

Severity: Minor
Found in src/PlainString.php by phpmd

TooManyMethods

Since: 0.1

A class with too many 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'.

The default was changed from 10 to 25 in PHPMD 2.3.

Example

Source https://phpmd.org/rules/codesize.html#toomanymethods

The class PlainStringsArray has an overall complexity of 85 which is very high. The configured complexity threshold is 50.
Open

final class PlainStringsArray implements StringsArray
{
    /** @var ArrayValue<StringValue> */
    private ArrayValue $strings;

Severity: Minor
Found in src/PlainStringsArray.php by phpmd

The class AssocArray has 31 public methods. Consider refactoring AssocArray to keep number of public methods under 10.
Open

final class AssocArray implements AssocValue
{
    /** @var Associable<TKey,TValue> */
    private Associable $items;

Severity: Minor
Found in src/AssocArray.php by phpmd

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

The class InfiniteIterableValue has 30 public methods. Consider refactoring InfiniteIterableValue to keep number of public methods under 10.
Open

final class InfiniteIterableValue implements IterableValue
{
    /** @phpstan-var IterableValueStack<TKey, TValue> */
    private IterableValueStack $stack;

Severity: Minor
Found in src/InfiniteIterableValue.php by phpmd

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

The class PlainString has an overall complexity of 55 which is very high. The configured complexity threshold is 50.
Open

final class PlainString implements StringValue
{
    /** @var string */
    private string $value;

Severity: Minor
Found in src/PlainString.php by phpmd

The class InfiniteIterableValue has an overall complexity of 72 which is very high. The configured complexity threshold is 50.
Open

final class InfiniteIterableValue implements IterableValue
{
    /** @phpstan-var IterableValueStack<TKey, TValue> */
    private IterableValueStack $stack;

Severity: Minor
Found in src/InfiniteIterableValue.php by phpmd

The class PlainArray has 40 public methods. Consider refactoring PlainArray to keep number of public methods under 10.
Open

final class PlainArray implements ArrayValue
{
    /** @phpstan-var Arrayable<TValue> */
    private Arrayable $items;

Severity: Minor
Found in src/PlainArray.php by phpmd

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

The class InfiniteIterableValue has 31 non-getter- and setter-methods. Consider refactoring InfiniteIterableValue to keep number of methods under 25.
Open

final class InfiniteIterableValue implements IterableValue
{
    /** @phpstan-var IterableValueStack<TKey, TValue> */
    private IterableValueStack $stack;

Severity: Minor
Found in src/InfiniteIterableValue.php by phpmd

TooManyMethods

Since: 0.1

A class with too many 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'.

The default was changed from 10 to 25 in PHPMD 2.3.

Example

Source https://phpmd.org/rules/codesize.html#toomanymethods

The class PlainArray has an overall complexity of 58 which is very high. The configured complexity threshold is 50.
Open

final class PlainArray implements ArrayValue
{
    /** @phpstan-var Arrayable<TValue> */
    private Arrayable $items;

Severity: Minor
Found in src/PlainArray.php by phpmd

The class PlainString has 36 public methods. Consider refactoring PlainString to keep number of public methods under 10.
Open

final class PlainString implements StringValue
{
    /** @var string */
    private string $value;

Severity: Minor
Found in src/PlainString.php by phpmd

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

The class PlainStringsArray has 79 non-getter- and setter-methods. Consider refactoring PlainStringsArray to keep number of methods under 25.
Open

final class PlainStringsArray implements StringsArray
{
    /** @var ArrayValue<StringValue> */
    private ArrayValue $strings;

Severity: Minor
Found in src/PlainStringsArray.php by phpmd

TooManyMethods

Since: 0.1

A class with too many 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'.

The default was changed from 10 to 25 in PHPMD 2.3.

Example

Source https://phpmd.org/rules/codesize.html#toomanymethods

The class AssocArray has 31 non-getter- and setter-methods. Consider refactoring AssocArray to keep number of methods under 25.
Open

final class AssocArray implements AssocValue
{
    /** @var Associable<TKey,TValue> */
    private Associable $items;

Severity: Minor
Found in src/AssocArray.php by phpmd

TooManyMethods

Since: 0.1

A class with too many 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'.

The default was changed from 10 to 25 in PHPMD 2.3.

Example

Source https://phpmd.org/rules/codesize.html#toomanymethods

The class PlainStringsArray has 77 public methods. Consider refactoring PlainStringsArray to keep number of public methods under 10.
Open

final class PlainStringsArray implements StringsArray
{
    /** @var ArrayValue<StringValue> */
    private ArrayValue $strings;

Severity: Minor
Found in src/PlainStringsArray.php by phpmd

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

Similar blocks of code found in 2 locations. Consider refactoring.
Open

<?php declare(strict_types=1);

namespace GW\Value\Arrayable;

use GW\Value\Arrayable;
Severity: Major
Found in src/Arrayable/DiffByComparator.php and 1 other location - About 2 hrs to fix
src/Arrayable/IntersectByComparator.php on lines 1..39

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 123.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

<?php declare(strict_types=1);

namespace GW\Value\Arrayable;

use GW\Value\Arrayable;
Severity: Major
Found in src/Arrayable/IntersectByComparator.php and 1 other location - About 2 hrs to fix
src/Arrayable/DiffByComparator.php on lines 1..39

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 123.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

The class PlainStringsArray has 81 public methods and attributes. Consider reducing the number of public items to less than 45.
Open

final class PlainStringsArray implements StringsArray
{
    /** @var ArrayValue<StringValue> */
    private ArrayValue $strings;

Severity: Minor
Found in src/PlainStringsArray.php by phpmd

ExcessivePublicCount

Since: 0.1

A large number of public methods and attributes declared in a class can indicate the class may need to be broken up as increased effort will be required to thoroughly test it.

Example

public class Foo {
    public $value;
    public $something;
    public $var;
    // [... more more public attributes ...]

    public function doWork() {}
    public function doMoreWork() {}
    public function doWorkAgain() {}
    // [... more more public methods ...]
}

Source https://phpmd.org/rules/codesize.html#excessivepubliccount

Similar blocks of code found in 2 locations. Consider refactoring.
Open

<?php declare(strict_types=1);

namespace GW\Value\Arrayable;

use GW\Value\Arrayable;
Severity: Major
Found in src/Arrayable/Cache.php and 1 other location - About 1 hr to fix
src/Associable/Cache.php on lines 1..35

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 102.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

<?php declare(strict_types=1);

namespace GW\Value\Associable;

use GW\Value\Associable;
Severity: Major
Found in src/Associable/Cache.php and 1 other location - About 1 hr to fix
src/Arrayable/Cache.php on lines 1..34

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 102.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

<?php declare(strict_types=1);

namespace GW\Value\Arrayable;

use GW\Value\Arrayable;
Severity: Major
Found in src/Arrayable/DiffByString.php and 1 other location - About 1 hr to fix
src/Arrayable/IntersectByString.php on lines 1..35

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 101.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Severity
Category
Status
Source
Language