idimensionz/linode-api-v4

View on GitHub

Showing 9 of 21 total issues

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

    private function hydrate(array $data): KernelModel
    {
        /**
         * @var KernelModel $model
         */
Severity: Major
Found in src/LinodeApiV4/Api/Linode/Kernels/KernelsApi.php and 1 other location - About 3 hrs to fix
src/LinodeApiV4/Api/Domains/Records/DomainRecordsApi.php on lines 131..149

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 154.

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

    protected function hydrate(array $data): DomainRecordModel
    {
        /**
         * @var DomainRecordModel $model
         */
Severity: Major
Found in src/LinodeApiV4/Api/Domains/Records/DomainRecordsApi.php and 1 other location - About 3 hrs to fix
src/LinodeApiV4/Api/Linode/Kernels/KernelsApi.php on lines 87..105

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 154.

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

    public function __construct($conditionOperator=self::CONDITION_OPERATOR_AND)
    {
        $filterFields = [
            self::FILTER_FIELD_XEN          =>  FilterAbstract::FILTER_FIELD_TYPE_BOOLEAN,
            self::FILTER_FIELD_KVM          =>  FilterAbstract::FILTER_FIELD_TYPE_BOOLEAN,
Severity: Major
Found in src/LinodeApiV4/Api/Linode/Kernels/KernelFilter.php and 1 other location - About 1 hr to fix
src/LinodeApiV4/Api/Linode/Types/TypeFilter.php on lines 50..65

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 117.

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

    public function __construct($conditionOperator = self::CONDITION_OPERATOR_AND)
    {
        $filterFields = [
            self::FILTER_FIELD_STORAGE              =>  FilterAbstract::FILTER_FIELD_TYPE_INTEGER,
//            self::FILTER_FIELD_HOURLY_PRICE       =>  FilterAbstract::FILTER_FIELD_TYPE_FLOAT,
Severity: Major
Found in src/LinodeApiV4/Api/Linode/Types/TypeFilter.php and 1 other location - About 1 hr to fix
src/LinodeApiV4/Api/Linode/Kernels/KernelFilter.php on lines 54..67

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 117.

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 5 locations. Consider refactoring.
Open

    public function getAll()
    {
        $httpResponse = $this->get();
        $data = $httpResponse->getBodyJsonAsArray();

Severity: Major
Found in src/LinodeApiV4/Api/Regions/RegionsApi.php and 4 other locations - About 40 mins to fix
src/LinodeApiV4/Api/Domains/DomainsApi.php on lines 51..66
src/LinodeApiV4/Api/Linode/Distributions/DistributionsApi.php on lines 46..61
src/LinodeApiV4/Api/Linode/Kernels/KernelsApi.php on lines 53..68
src/LinodeApiV4/Api/Linode/Types/TypesApi.php on lines 53..68

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 94.

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 5 locations. Consider refactoring.
Open

    public function getAll()
    {
        $httpResponse = $this->get();
        $data = $httpResponse->getBodyJsonAsArray();

Severity: Major
Found in src/LinodeApiV4/Api/Linode/Distributions/DistributionsApi.php and 4 other locations - About 40 mins to fix
src/LinodeApiV4/Api/Domains/DomainsApi.php on lines 51..66
src/LinodeApiV4/Api/Linode/Kernels/KernelsApi.php on lines 53..68
src/LinodeApiV4/Api/Linode/Types/TypesApi.php on lines 53..68
src/LinodeApiV4/Api/Regions/RegionsApi.php on lines 53..68

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 94.

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 5 locations. Consider refactoring.
Open

    public function getAll(): array
    {
        $httpResponse = $this->get();
        $data = $httpResponse->getBodyJsonAsArray();

Severity: Major
Found in src/LinodeApiV4/Api/Linode/Types/TypesApi.php and 4 other locations - About 40 mins to fix
src/LinodeApiV4/Api/Domains/DomainsApi.php on lines 51..66
src/LinodeApiV4/Api/Linode/Distributions/DistributionsApi.php on lines 46..61
src/LinodeApiV4/Api/Linode/Kernels/KernelsApi.php on lines 53..68
src/LinodeApiV4/Api/Regions/RegionsApi.php on lines 53..68

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 94.

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 5 locations. Consider refactoring.
Open

    public function getAll(): array
    {
        // Don't need to specify a command here because the Domains API is simple.
        $httpResponse = $this->get();
        $data = $httpResponse->getBodyJsonAsArray();
Severity: Major
Found in src/LinodeApiV4/Api/Domains/DomainsApi.php and 4 other locations - About 40 mins to fix
src/LinodeApiV4/Api/Linode/Distributions/DistributionsApi.php on lines 46..61
src/LinodeApiV4/Api/Linode/Kernels/KernelsApi.php on lines 53..68
src/LinodeApiV4/Api/Linode/Types/TypesApi.php on lines 53..68
src/LinodeApiV4/Api/Regions/RegionsApi.php on lines 53..68

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 94.

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 5 locations. Consider refactoring.
Open

    public function getAll(): array
    {
        $httpResponse = $this->get();
        $data = $httpResponse->getBodyJsonAsArray();

Severity: Major
Found in src/LinodeApiV4/Api/Linode/Kernels/KernelsApi.php and 4 other locations - About 40 mins to fix
src/LinodeApiV4/Api/Domains/DomainsApi.php on lines 51..66
src/LinodeApiV4/Api/Linode/Distributions/DistributionsApi.php on lines 46..61
src/LinodeApiV4/Api/Linode/Types/TypesApi.php on lines 53..68
src/LinodeApiV4/Api/Regions/RegionsApi.php on lines 53..68

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 94.

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