559Labs/django-dtg-store-manager

View on GitHub

Showing 302 of 302 total issues

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

class pfCountryViewSet(viewsets.ModelViewSet):
    """ViewSet for the pfCountry class"""

    queryset = models.pfCountry.objects.all()
    serializer_class = serializers.pfCountrySerializer
Severity: Major
Found in src/business/api.py and 31 other locations - About 1 hr to fix
src/business/api.py on lines 6..11
src/business/api.py on lines 14..19
src/business/api.py on lines 22..27
src/business/api.py on lines 30..35
src/business/api.py on lines 38..43
src/business/api.py on lines 46..51
src/business/api.py on lines 54..59
src/business/api.py on lines 62..67
src/business/api.py on lines 70..75
src/business/api.py on lines 78..83
src/business/api.py on lines 86..91
src/business/api.py on lines 94..99
src/business/api.py on lines 102..107
src/business/api.py on lines 110..115
src/business/api.py on lines 118..123
src/business/api.py on lines 126..131
src/business/api.py on lines 134..139
src/business/api.py on lines 142..147
src/business/api.py on lines 158..163
src/business/api.py on lines 166..171
src/business/api.py on lines 174..179
src/business/api.py on lines 182..187
src/business/api.py on lines 190..195
src/business/api.py on lines 198..203
src/business/api.py on lines 206..211
src/business/api.py on lines 214..219
src/business/api.py on lines 222..227
src/business/api.py on lines 230..235
src/business/api.py on lines 238..243
src/business/api.py on lines 246..251
src/business/api.py on lines 254..259

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

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

class pfCatalogFileSpecViewSet(viewsets.ModelViewSet):
    """ViewSet for the pfCatalogFileSpec class"""

    queryset = models.pfCatalogFileSpec.objects.all()
    serializer_class = serializers.pfCatalogFileSpecSerializer
Severity: Major
Found in src/business/api.py and 31 other locations - About 1 hr to fix
src/business/api.py on lines 6..11
src/business/api.py on lines 14..19
src/business/api.py on lines 22..27
src/business/api.py on lines 30..35
src/business/api.py on lines 38..43
src/business/api.py on lines 46..51
src/business/api.py on lines 54..59
src/business/api.py on lines 62..67
src/business/api.py on lines 70..75
src/business/api.py on lines 78..83
src/business/api.py on lines 86..91
src/business/api.py on lines 94..99
src/business/api.py on lines 102..107
src/business/api.py on lines 110..115
src/business/api.py on lines 118..123
src/business/api.py on lines 126..131
src/business/api.py on lines 134..139
src/business/api.py on lines 142..147
src/business/api.py on lines 150..155
src/business/api.py on lines 158..163
src/business/api.py on lines 166..171
src/business/api.py on lines 174..179
src/business/api.py on lines 182..187
src/business/api.py on lines 190..195
src/business/api.py on lines 198..203
src/business/api.py on lines 214..219
src/business/api.py on lines 222..227
src/business/api.py on lines 230..235
src/business/api.py on lines 238..243
src/business/api.py on lines 246..251
src/business/api.py on lines 254..259

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

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

class wpMediaViewSet(viewsets.ModelViewSet):
    """ViewSet for the wpMedia class"""

    queryset = models.wpMedia.objects.all()
    serializer_class = serializers.wpMediaSerializer
Severity: Major
Found in src/business/api.py and 31 other locations - About 1 hr to fix
src/business/api.py on lines 6..11
src/business/api.py on lines 14..19
src/business/api.py on lines 22..27
src/business/api.py on lines 30..35
src/business/api.py on lines 38..43
src/business/api.py on lines 46..51
src/business/api.py on lines 54..59
src/business/api.py on lines 62..67
src/business/api.py on lines 70..75
src/business/api.py on lines 78..83
src/business/api.py on lines 86..91
src/business/api.py on lines 94..99
src/business/api.py on lines 102..107
src/business/api.py on lines 110..115
src/business/api.py on lines 118..123
src/business/api.py on lines 126..131
src/business/api.py on lines 142..147
src/business/api.py on lines 150..155
src/business/api.py on lines 158..163
src/business/api.py on lines 166..171
src/business/api.py on lines 174..179
src/business/api.py on lines 182..187
src/business/api.py on lines 190..195
src/business/api.py on lines 198..203
src/business/api.py on lines 206..211
src/business/api.py on lines 214..219
src/business/api.py on lines 222..227
src/business/api.py on lines 230..235
src/business/api.py on lines 238..243
src/business/api.py on lines 246..251
src/business/api.py on lines 254..259

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

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

class pfCatalogFileTypeViewSet(viewsets.ModelViewSet):
    """ViewSet for the pfCatalogFileType class"""

    queryset = models.pfCatalogFileType.objects.all()
    serializer_class = serializers.pfCatalogFileTypeSerializer
Severity: Major
Found in src/business/api.py and 31 other locations - About 1 hr to fix
src/business/api.py on lines 6..11
src/business/api.py on lines 14..19
src/business/api.py on lines 22..27
src/business/api.py on lines 30..35
src/business/api.py on lines 38..43
src/business/api.py on lines 46..51
src/business/api.py on lines 54..59
src/business/api.py on lines 62..67
src/business/api.py on lines 70..75
src/business/api.py on lines 78..83
src/business/api.py on lines 86..91
src/business/api.py on lines 94..99
src/business/api.py on lines 102..107
src/business/api.py on lines 110..115
src/business/api.py on lines 118..123
src/business/api.py on lines 126..131
src/business/api.py on lines 134..139
src/business/api.py on lines 142..147
src/business/api.py on lines 150..155
src/business/api.py on lines 158..163
src/business/api.py on lines 166..171
src/business/api.py on lines 174..179
src/business/api.py on lines 182..187
src/business/api.py on lines 190..195
src/business/api.py on lines 198..203
src/business/api.py on lines 206..211
src/business/api.py on lines 222..227
src/business/api.py on lines 230..235
src/business/api.py on lines 238..243
src/business/api.py on lines 246..251
src/business/api.py on lines 254..259

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

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

class wooVariantViewSet(viewsets.ModelViewSet):
    """ViewSet for the wooVariant class"""

    queryset = models.wooVariant.objects.all()
    serializer_class = serializers.wooVariantSerializer
Severity: Major
Found in src/business/api.py and 31 other locations - About 1 hr to fix
src/business/api.py on lines 6..11
src/business/api.py on lines 14..19
src/business/api.py on lines 22..27
src/business/api.py on lines 30..35
src/business/api.py on lines 38..43
src/business/api.py on lines 46..51
src/business/api.py on lines 54..59
src/business/api.py on lines 62..67
src/business/api.py on lines 70..75
src/business/api.py on lines 78..83
src/business/api.py on lines 86..91
src/business/api.py on lines 94..99
src/business/api.py on lines 102..107
src/business/api.py on lines 110..115
src/business/api.py on lines 118..123
src/business/api.py on lines 134..139
src/business/api.py on lines 142..147
src/business/api.py on lines 150..155
src/business/api.py on lines 158..163
src/business/api.py on lines 166..171
src/business/api.py on lines 174..179
src/business/api.py on lines 182..187
src/business/api.py on lines 190..195
src/business/api.py on lines 198..203
src/business/api.py on lines 206..211
src/business/api.py on lines 214..219
src/business/api.py on lines 222..227
src/business/api.py on lines 230..235
src/business/api.py on lines 238..243
src/business/api.py on lines 246..251
src/business/api.py on lines 254..259

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

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

class pfCatalogProductViewSet(viewsets.ModelViewSet):
    """ViewSet for the pfCatalogProduct class"""

    queryset = models.pfCatalogProduct.objects.all()
    serializer_class = serializers.pfCatalogProductSerializer
Severity: Major
Found in src/business/api.py and 31 other locations - About 1 hr to fix
src/business/api.py on lines 6..11
src/business/api.py on lines 14..19
src/business/api.py on lines 22..27
src/business/api.py on lines 30..35
src/business/api.py on lines 38..43
src/business/api.py on lines 46..51
src/business/api.py on lines 54..59
src/business/api.py on lines 62..67
src/business/api.py on lines 70..75
src/business/api.py on lines 78..83
src/business/api.py on lines 86..91
src/business/api.py on lines 94..99
src/business/api.py on lines 102..107
src/business/api.py on lines 110..115
src/business/api.py on lines 118..123
src/business/api.py on lines 126..131
src/business/api.py on lines 134..139
src/business/api.py on lines 142..147
src/business/api.py on lines 150..155
src/business/api.py on lines 158..163
src/business/api.py on lines 166..171
src/business/api.py on lines 174..179
src/business/api.py on lines 182..187
src/business/api.py on lines 190..195
src/business/api.py on lines 198..203
src/business/api.py on lines 206..211
src/business/api.py on lines 214..219
src/business/api.py on lines 222..227
src/business/api.py on lines 238..243
src/business/api.py on lines 246..251
src/business/api.py on lines 254..259

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

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

class pfStoreViewSet(viewsets.ModelViewSet):
    """ViewSet for the pfStore class"""

    queryset = models.pfStore.objects.all()
    serializer_class = serializers.pfStoreSerializer
Severity: Major
Found in src/business/api.py and 31 other locations - About 1 hr to fix
src/business/api.py on lines 6..11
src/business/api.py on lines 14..19
src/business/api.py on lines 22..27
src/business/api.py on lines 30..35
src/business/api.py on lines 38..43
src/business/api.py on lines 46..51
src/business/api.py on lines 54..59
src/business/api.py on lines 62..67
src/business/api.py on lines 70..75
src/business/api.py on lines 78..83
src/business/api.py on lines 86..91
src/business/api.py on lines 94..99
src/business/api.py on lines 102..107
src/business/api.py on lines 110..115
src/business/api.py on lines 118..123
src/business/api.py on lines 126..131
src/business/api.py on lines 134..139
src/business/api.py on lines 142..147
src/business/api.py on lines 150..155
src/business/api.py on lines 158..163
src/business/api.py on lines 166..171
src/business/api.py on lines 174..179
src/business/api.py on lines 182..187
src/business/api.py on lines 190..195
src/business/api.py on lines 198..203
src/business/api.py on lines 206..211
src/business/api.py on lines 214..219
src/business/api.py on lines 222..227
src/business/api.py on lines 230..235
src/business/api.py on lines 238..243
src/business/api.py on lines 254..259

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

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

    DISPLAY_CHOICES = (
        (DISPLAY_DEFAULT, _("Default")),
        (DISPLAY_PRODUCTS, _("Products")),
        (DISPLAY_SUBCATEGORIES, _("Subcategories")),
        (DISPLAY_BOTH, _("Display Both"))
Severity: Major
Found in src/business/models.py and 2 other locations - About 1 hr to fix
src/business/models.py on lines 571..575
src/business/models.py on lines 582..586

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

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

class pfCatalogSizeViewSet(viewsets.ModelViewSet):
    """ViewSet for the pfCatalogSize class"""

    queryset = models.pfCatalogSize.objects.all()
    serializer_class = serializers.pfCatalogSizeSerializer
Severity: Major
Found in src/business/api.py and 31 other locations - About 1 hr to fix
src/business/api.py on lines 6..11
src/business/api.py on lines 14..19
src/business/api.py on lines 22..27
src/business/api.py on lines 30..35
src/business/api.py on lines 38..43
src/business/api.py on lines 46..51
src/business/api.py on lines 54..59
src/business/api.py on lines 62..67
src/business/api.py on lines 70..75
src/business/api.py on lines 78..83
src/business/api.py on lines 86..91
src/business/api.py on lines 94..99
src/business/api.py on lines 102..107
src/business/api.py on lines 110..115
src/business/api.py on lines 118..123
src/business/api.py on lines 126..131
src/business/api.py on lines 134..139
src/business/api.py on lines 142..147
src/business/api.py on lines 150..155
src/business/api.py on lines 158..163
src/business/api.py on lines 166..171
src/business/api.py on lines 174..179
src/business/api.py on lines 182..187
src/business/api.py on lines 190..195
src/business/api.py on lines 206..211
src/business/api.py on lines 214..219
src/business/api.py on lines 222..227
src/business/api.py on lines 230..235
src/business/api.py on lines 238..243
src/business/api.py on lines 246..251
src/business/api.py on lines 254..259

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

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

    ORDER_CHOICES = (
        (ORDER_NAME, _("Sort by Name")),
        (ORDER_NAMENUMBER, _("Sort by Name (Number)")),
        (ORDER_ID, _("Sort by ID")),
        (ORDER_MENU, _("Sort by Custom Menu Order")),
Severity: Major
Found in src/business/models.py and 2 other locations - About 1 hr to fix
src/business/models.py on lines 571..575
src/business/models.py on lines 626..630

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

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

class pfCatalogOptionTypeViewSet(viewsets.ModelViewSet):
    """ViewSet for the pfCatalogOptionType class"""

    queryset = models.pfCatalogOptionType.objects.all()
    serializer_class = serializers.pfCatalogOptionTypeSerializer
Severity: Major
Found in src/business/api.py and 31 other locations - About 1 hr to fix
src/business/api.py on lines 6..11
src/business/api.py on lines 14..19
src/business/api.py on lines 22..27
src/business/api.py on lines 30..35
src/business/api.py on lines 38..43
src/business/api.py on lines 46..51
src/business/api.py on lines 54..59
src/business/api.py on lines 62..67
src/business/api.py on lines 70..75
src/business/api.py on lines 78..83
src/business/api.py on lines 86..91
src/business/api.py on lines 94..99
src/business/api.py on lines 102..107
src/business/api.py on lines 110..115
src/business/api.py on lines 118..123
src/business/api.py on lines 126..131
src/business/api.py on lines 134..139
src/business/api.py on lines 142..147
src/business/api.py on lines 150..155
src/business/api.py on lines 158..163
src/business/api.py on lines 166..171
src/business/api.py on lines 174..179
src/business/api.py on lines 182..187
src/business/api.py on lines 190..195
src/business/api.py on lines 198..203
src/business/api.py on lines 206..211
src/business/api.py on lines 214..219
src/business/api.py on lines 230..235
src/business/api.py on lines 238..243
src/business/api.py on lines 246..251
src/business/api.py on lines 254..259

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

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

class pfStateViewSet(viewsets.ModelViewSet):
    """ViewSet for the pfState class"""

    queryset = models.pfState.objects.all()
    serializer_class = serializers.pfStateSerializer
Severity: Major
Found in src/business/api.py and 31 other locations - About 1 hr to fix
src/business/api.py on lines 6..11
src/business/api.py on lines 14..19
src/business/api.py on lines 22..27
src/business/api.py on lines 30..35
src/business/api.py on lines 38..43
src/business/api.py on lines 46..51
src/business/api.py on lines 54..59
src/business/api.py on lines 62..67
src/business/api.py on lines 70..75
src/business/api.py on lines 78..83
src/business/api.py on lines 86..91
src/business/api.py on lines 94..99
src/business/api.py on lines 102..107
src/business/api.py on lines 110..115
src/business/api.py on lines 118..123
src/business/api.py on lines 126..131
src/business/api.py on lines 134..139
src/business/api.py on lines 142..147
src/business/api.py on lines 150..155
src/business/api.py on lines 166..171
src/business/api.py on lines 174..179
src/business/api.py on lines 182..187
src/business/api.py on lines 190..195
src/business/api.py on lines 198..203
src/business/api.py on lines 206..211
src/business/api.py on lines 214..219
src/business/api.py on lines 222..227
src/business/api.py on lines 230..235
src/business/api.py on lines 238..243
src/business/api.py on lines 246..251
src/business/api.py on lines 254..259

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

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

Function __str__ has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    def __str__(self):
        rv = []
        if self.bzcreativecollection:
            if self.bzcreativecollection.code:
                rv.append(self.bzcreativecollection.code + "-")
Severity: Minor
Found in src/business/models.py - About 55 mins to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

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

class pfSyncProductAdmin(admin.ModelAdmin):
    form = pfSyncProductAdminForm
    list_display = ['id', 'date_added', 'date_updated', 'pid', 'external_id',
                    'variants', 'synced']
    readonly_fields = ['id', 'date_added', 'date_updated',
Severity: Minor
Found in src/business/admin.py and 1 other location - About 55 mins to fix
src/business/admin.py on lines 533..538

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

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

class pfCatalogOptionTypeAdmin(admin.ModelAdmin):
    form = pfCatalogOptionTypeAdminForm
    list_display = ['id', 'date_added', 'date_updated',
                    'pid', 'title', 'type', 'additional_price']
    readonly_fields = ['id', 'date_added', 'date_updated',
Severity: Minor
Found in src/business/admin.py and 1 other location - About 55 mins to fix
src/business/admin.py on lines 408..413

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

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

Function api_pull has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

    def api_pull(store=None, key=None):
        """
        Update the Country and State objects from the Printful API.

        :param store: Optional bzStore object. If not provided, method will
Severity: Minor
Found in src/business/models.py - About 45 mins to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

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

class wooShippingClassAdmin(admin.ModelAdmin):
    form = wooShippingClassAdminForm
    list_display = ['id', 'wid', 'name', 'slug', 'description', 'count']
    readonly_fields = ['id', 'wid', 'name', 'slug', 'description', 'count']
Severity: Major
Found in src/business/admin.py and 2 other locations - About 45 mins to fix
src/business/admin.py on lines 426..431
src/business/admin.py on lines 515..520

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

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

class pfSyncVariantAdmin(admin.ModelAdmin):
    form = pfSyncVariantAdminForm
    list_display = ['id', 'date_added', 'date_updated',
                    'pid', 'external_id', 'synced']
    readonly_fields = ['id', 'date_added', 'date_updated',
Severity: Major
Found in src/business/admin.py and 2 other locations - About 45 mins to fix
src/business/admin.py on lines 233..236
src/business/admin.py on lines 515..520

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

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

class pfCatalogFileTypeAdmin(admin.ModelAdmin):
    form = pfCatalogFileTypeAdminForm
    list_display = ['id', 'date_added', 'date_updated',
                    'pid', 'title', 'additional_price']
    readonly_fields = ['id', 'date_added', 'date_updated',
Severity: Major
Found in src/business/admin.py and 2 other locations - About 45 mins to fix
src/business/admin.py on lines 233..236
src/business/admin.py on lines 426..431

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

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

class appListGeoList(appListCommonListView):
    model = pfCountry
    table_class = pfCountryTable
    object_name = "Geographies"
    action_list = [
Severity: Minor
Found in src/business/views/app_lists.py and 1 other location - About 40 mins to fix
src/business/views/app_dams.py on lines 49..57

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

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