alientronics/fleetany-web

View on GitHub
tests/unit/TypeModelTest.php

Summary

Maintainability
D
2 days
Test Coverage

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

    public function testHasModels()
    {
    
        $type = factory(\App\Entities\Type::class)->create();
    
Severity: Major
Found in tests/unit/TypeModelTest.php and 28 other locations - About 2 hrs to fix
tests/unit/CompanyModelTest.php on lines 21..37
tests/unit/CompanyModelTest.php on lines 39..55
tests/unit/CompanyModelTest.php on lines 57..73
tests/unit/CompanyModelTest.php on lines 75..91
tests/unit/CompanyModelTest.php on lines 93..109
tests/unit/CompanyModelTest.php on lines 111..127
tests/unit/CompanyModelTest.php on lines 129..145
tests/unit/CompanyModelTest.php on lines 147..163
tests/unit/CompanyModelTest.php on lines 165..181
tests/unit/ContactModelTest.php on lines 32..48
tests/unit/ContactModelTest.php on lines 50..66
tests/unit/ContactModelTest.php on lines 68..84
tests/unit/ContactModelTest.php on lines 86..102
tests/unit/ContactModelTest.php on lines 104..120
tests/unit/ContactModelTest.php on lines 122..138
tests/unit/ContactModelTest.php on lines 140..156
tests/unit/ModelModelTest.php on lines 43..59
tests/unit/ModelModelTest.php on lines 61..77
tests/unit/PartsModelTest.php on lines 76..92
tests/unit/PartsModelTest.php on lines 94..110
tests/unit/TypeModelTest.php on lines 21..37
tests/unit/TypeModelTest.php on lines 39..55
tests/unit/TypeModelTest.php on lines 75..91
tests/unit/TypeModelTest.php on lines 93..109
tests/unit/TypeModelTest.php on lines 111..127
tests/unit/VehicleModelTest.php on lines 35..51
tests/unit/VehicleModelTest.php on lines 53..69
tests/unit/VehicleModelTest.php on lines 71..87

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

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

    public function testHasTrips()
    {

        $type = factory(\App\Entities\Type::class)->create();

Severity: Major
Found in tests/unit/TypeModelTest.php and 28 other locations - About 2 hrs to fix
tests/unit/CompanyModelTest.php on lines 21..37
tests/unit/CompanyModelTest.php on lines 39..55
tests/unit/CompanyModelTest.php on lines 57..73
tests/unit/CompanyModelTest.php on lines 75..91
tests/unit/CompanyModelTest.php on lines 93..109
tests/unit/CompanyModelTest.php on lines 111..127
tests/unit/CompanyModelTest.php on lines 129..145
tests/unit/CompanyModelTest.php on lines 147..163
tests/unit/CompanyModelTest.php on lines 165..181
tests/unit/ContactModelTest.php on lines 32..48
tests/unit/ContactModelTest.php on lines 50..66
tests/unit/ContactModelTest.php on lines 68..84
tests/unit/ContactModelTest.php on lines 86..102
tests/unit/ContactModelTest.php on lines 104..120
tests/unit/ContactModelTest.php on lines 122..138
tests/unit/ContactModelTest.php on lines 140..156
tests/unit/ModelModelTest.php on lines 43..59
tests/unit/ModelModelTest.php on lines 61..77
tests/unit/PartsModelTest.php on lines 76..92
tests/unit/PartsModelTest.php on lines 94..110
tests/unit/TypeModelTest.php on lines 21..37
tests/unit/TypeModelTest.php on lines 39..55
tests/unit/TypeModelTest.php on lines 57..73
tests/unit/TypeModelTest.php on lines 93..109
tests/unit/TypeModelTest.php on lines 111..127
tests/unit/VehicleModelTest.php on lines 35..51
tests/unit/VehicleModelTest.php on lines 53..69
tests/unit/VehicleModelTest.php on lines 71..87

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

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

    public function testHasParts()
    {

        $type = factory(\App\Entities\Type::class)->create();

Severity: Major
Found in tests/unit/TypeModelTest.php and 28 other locations - About 2 hrs to fix
tests/unit/CompanyModelTest.php on lines 21..37
tests/unit/CompanyModelTest.php on lines 39..55
tests/unit/CompanyModelTest.php on lines 57..73
tests/unit/CompanyModelTest.php on lines 75..91
tests/unit/CompanyModelTest.php on lines 93..109
tests/unit/CompanyModelTest.php on lines 111..127
tests/unit/CompanyModelTest.php on lines 129..145
tests/unit/CompanyModelTest.php on lines 147..163
tests/unit/CompanyModelTest.php on lines 165..181
tests/unit/ContactModelTest.php on lines 32..48
tests/unit/ContactModelTest.php on lines 50..66
tests/unit/ContactModelTest.php on lines 68..84
tests/unit/ContactModelTest.php on lines 86..102
tests/unit/ContactModelTest.php on lines 104..120
tests/unit/ContactModelTest.php on lines 122..138
tests/unit/ContactModelTest.php on lines 140..156
tests/unit/ModelModelTest.php on lines 43..59
tests/unit/ModelModelTest.php on lines 61..77
tests/unit/PartsModelTest.php on lines 76..92
tests/unit/PartsModelTest.php on lines 94..110
tests/unit/TypeModelTest.php on lines 21..37
tests/unit/TypeModelTest.php on lines 39..55
tests/unit/TypeModelTest.php on lines 57..73
tests/unit/TypeModelTest.php on lines 75..91
tests/unit/TypeModelTest.php on lines 93..109
tests/unit/VehicleModelTest.php on lines 35..51
tests/unit/VehicleModelTest.php on lines 53..69
tests/unit/VehicleModelTest.php on lines 71..87

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

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

    public function testHasEntries()
    {
    
        $type = factory(\App\Entities\Type::class)->create();
    
Severity: Major
Found in tests/unit/TypeModelTest.php and 28 other locations - About 2 hrs to fix
tests/unit/CompanyModelTest.php on lines 21..37
tests/unit/CompanyModelTest.php on lines 39..55
tests/unit/CompanyModelTest.php on lines 57..73
tests/unit/CompanyModelTest.php on lines 75..91
tests/unit/CompanyModelTest.php on lines 93..109
tests/unit/CompanyModelTest.php on lines 111..127
tests/unit/CompanyModelTest.php on lines 129..145
tests/unit/CompanyModelTest.php on lines 147..163
tests/unit/CompanyModelTest.php on lines 165..181
tests/unit/ContactModelTest.php on lines 32..48
tests/unit/ContactModelTest.php on lines 50..66
tests/unit/ContactModelTest.php on lines 68..84
tests/unit/ContactModelTest.php on lines 86..102
tests/unit/ContactModelTest.php on lines 104..120
tests/unit/ContactModelTest.php on lines 122..138
tests/unit/ContactModelTest.php on lines 140..156
tests/unit/ModelModelTest.php on lines 43..59
tests/unit/ModelModelTest.php on lines 61..77
tests/unit/PartsModelTest.php on lines 76..92
tests/unit/PartsModelTest.php on lines 94..110
tests/unit/TypeModelTest.php on lines 21..37
tests/unit/TypeModelTest.php on lines 57..73
tests/unit/TypeModelTest.php on lines 75..91
tests/unit/TypeModelTest.php on lines 93..109
tests/unit/TypeModelTest.php on lines 111..127
tests/unit/VehicleModelTest.php on lines 35..51
tests/unit/VehicleModelTest.php on lines 53..69
tests/unit/VehicleModelTest.php on lines 71..87

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

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

    public function testHasFuelTypes()
    {

        $type = factory(\App\Entities\Type::class)->create();

Severity: Major
Found in tests/unit/TypeModelTest.php and 28 other locations - About 2 hrs to fix
tests/unit/CompanyModelTest.php on lines 21..37
tests/unit/CompanyModelTest.php on lines 39..55
tests/unit/CompanyModelTest.php on lines 57..73
tests/unit/CompanyModelTest.php on lines 75..91
tests/unit/CompanyModelTest.php on lines 93..109
tests/unit/CompanyModelTest.php on lines 111..127
tests/unit/CompanyModelTest.php on lines 129..145
tests/unit/CompanyModelTest.php on lines 147..163
tests/unit/CompanyModelTest.php on lines 165..181
tests/unit/ContactModelTest.php on lines 32..48
tests/unit/ContactModelTest.php on lines 50..66
tests/unit/ContactModelTest.php on lines 68..84
tests/unit/ContactModelTest.php on lines 86..102
tests/unit/ContactModelTest.php on lines 104..120
tests/unit/ContactModelTest.php on lines 122..138
tests/unit/ContactModelTest.php on lines 140..156
tests/unit/ModelModelTest.php on lines 43..59
tests/unit/ModelModelTest.php on lines 61..77
tests/unit/PartsModelTest.php on lines 76..92
tests/unit/PartsModelTest.php on lines 94..110
tests/unit/TypeModelTest.php on lines 21..37
tests/unit/TypeModelTest.php on lines 39..55
tests/unit/TypeModelTest.php on lines 57..73
tests/unit/TypeModelTest.php on lines 75..91
tests/unit/TypeModelTest.php on lines 111..127
tests/unit/VehicleModelTest.php on lines 35..51
tests/unit/VehicleModelTest.php on lines 53..69
tests/unit/VehicleModelTest.php on lines 71..87

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

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

    public function testHasContacts()
    {

        $type = factory(\App\Entities\Type::class)->create();

Severity: Major
Found in tests/unit/TypeModelTest.php and 28 other locations - About 2 hrs to fix
tests/unit/CompanyModelTest.php on lines 21..37
tests/unit/CompanyModelTest.php on lines 39..55
tests/unit/CompanyModelTest.php on lines 57..73
tests/unit/CompanyModelTest.php on lines 75..91
tests/unit/CompanyModelTest.php on lines 93..109
tests/unit/CompanyModelTest.php on lines 111..127
tests/unit/CompanyModelTest.php on lines 129..145
tests/unit/CompanyModelTest.php on lines 147..163
tests/unit/CompanyModelTest.php on lines 165..181
tests/unit/ContactModelTest.php on lines 32..48
tests/unit/ContactModelTest.php on lines 50..66
tests/unit/ContactModelTest.php on lines 68..84
tests/unit/ContactModelTest.php on lines 86..102
tests/unit/ContactModelTest.php on lines 104..120
tests/unit/ContactModelTest.php on lines 122..138
tests/unit/ContactModelTest.php on lines 140..156
tests/unit/ModelModelTest.php on lines 43..59
tests/unit/ModelModelTest.php on lines 61..77
tests/unit/PartsModelTest.php on lines 76..92
tests/unit/PartsModelTest.php on lines 94..110
tests/unit/TypeModelTest.php on lines 39..55
tests/unit/TypeModelTest.php on lines 57..73
tests/unit/TypeModelTest.php on lines 75..91
tests/unit/TypeModelTest.php on lines 93..109
tests/unit/TypeModelTest.php on lines 111..127
tests/unit/VehicleModelTest.php on lines 35..51
tests/unit/VehicleModelTest.php on lines 53..69
tests/unit/VehicleModelTest.php on lines 71..87

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

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

There are no issues that match your filters.

Category
Status