559Labs/django-dtg-store-manager

View on GitHub

Showing 302 of 302 total issues

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

            if p['status']:
                _status, c = pfFileStatus.objects.update_or_create(
                    name=p['status'],
                    defaults={}
                )
Severity: Major
Found in src/business/models.py and 2 other locations - About 1 hr to fix
src/business/models.py on lines 1772..1778
src/business/models.py on lines 1788..1794

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

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

class appListFileSpecCreate(appListCommonCreateView):
    model = pfCatalogFileSpec
    form_class = pfCatalogFileSpecForm
    object_name = "File Spec"
    object_icon = ""
Severity: Major
Found in src/business/views/app_lists.py and 10 other locations - About 1 hr to fix
src/business/views/app_lists.py on lines 90..96
src/business/views/app_lists.py on lines 143..149
src/business/views/app_lists.py on lines 159..165
src/business/views/app_lists.py on lines 168..174
src/business/views/app_lists.py on lines 192..198
src/business/views/app_lists.py on lines 201..207
src/business/views/app_lists.py on lines 225..231
src/business/views/app_lists.py on lines 234..240
src/business/views/app_lists.py on lines 284..290
src/business/views/app_lists.py on lines 299..305

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

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

class appListTagUpdate(appListCommonUpdateView):
    model = wooTag
    form_class = wooTagForm
    object_name = "Product Tag"
    object_icon = ""
Severity: Major
Found in src/business/views/app_lists.py and 10 other locations - About 1 hr to fix
src/business/views/app_lists.py on lines 90..96
src/business/views/app_lists.py on lines 134..140
src/business/views/app_lists.py on lines 143..149
src/business/views/app_lists.py on lines 159..165
src/business/views/app_lists.py on lines 168..174
src/business/views/app_lists.py on lines 192..198
src/business/views/app_lists.py on lines 201..207
src/business/views/app_lists.py on lines 225..231
src/business/views/app_lists.py on lines 284..290
src/business/views/app_lists.py on lines 299..305

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

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

class appListTagCreate(appListCommonCreateView):
    model = wooTag
    form_class = wooTagForm
    object_name = "Product Tag"
    object_icon = ""
Severity: Major
Found in src/business/views/app_lists.py and 10 other locations - About 1 hr to fix
src/business/views/app_lists.py on lines 90..96
src/business/views/app_lists.py on lines 134..140
src/business/views/app_lists.py on lines 143..149
src/business/views/app_lists.py on lines 159..165
src/business/views/app_lists.py on lines 168..174
src/business/views/app_lists.py on lines 192..198
src/business/views/app_lists.py on lines 201..207
src/business/views/app_lists.py on lines 234..240
src/business/views/app_lists.py on lines 284..290
src/business/views/app_lists.py on lines 299..305

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

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

class appListColorUpdate(appListCommonUpdateView):
    model = pfCatalogColor
    form_class = pfCatalogColorForm
    object_name = "Colour"
    object_icon = ""
Severity: Major
Found in src/business/views/app_lists.py and 10 other locations - About 1 hr to fix
src/business/views/app_lists.py on lines 134..140
src/business/views/app_lists.py on lines 143..149
src/business/views/app_lists.py on lines 159..165
src/business/views/app_lists.py on lines 168..174
src/business/views/app_lists.py on lines 192..198
src/business/views/app_lists.py on lines 201..207
src/business/views/app_lists.py on lines 225..231
src/business/views/app_lists.py on lines 234..240
src/business/views/app_lists.py on lines 284..290
src/business/views/app_lists.py on lines 299..305

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

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

class appListShippingUpdate(appListCommonUpdateView):
    model = wooShippingClass
    form_class = wooShippingClassForm
    object_name = "Shipping Class"
    object_icon = ""
Severity: Major
Found in src/business/views/app_lists.py and 10 other locations - About 1 hr to fix
src/business/views/app_lists.py on lines 90..96
src/business/views/app_lists.py on lines 134..140
src/business/views/app_lists.py on lines 143..149
src/business/views/app_lists.py on lines 159..165
src/business/views/app_lists.py on lines 192..198
src/business/views/app_lists.py on lines 201..207
src/business/views/app_lists.py on lines 225..231
src/business/views/app_lists.py on lines 234..240
src/business/views/app_lists.py on lines 284..290
src/business/views/app_lists.py on lines 299..305

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

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

class appListCategoryCreate(appListCommonCreateView):
    model = wooCategory
    form_class = wooCategoryForm
    object_name = "Product Category"
    object_icon = ""
Severity: Major
Found in src/business/views/app_lists.py and 10 other locations - About 1 hr to fix
src/business/views/app_lists.py on lines 90..96
src/business/views/app_lists.py on lines 134..140
src/business/views/app_lists.py on lines 143..149
src/business/views/app_lists.py on lines 159..165
src/business/views/app_lists.py on lines 168..174
src/business/views/app_lists.py on lines 201..207
src/business/views/app_lists.py on lines 225..231
src/business/views/app_lists.py on lines 234..240
src/business/views/app_lists.py on lines 284..290
src/business/views/app_lists.py on lines 299..305

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

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

class appListCategoryUpdate(appListCommonUpdateView):
    model = wooCategory
    form_class = wooCategoryForm
    object_name = "Product Category"
    object_icon = ""
Severity: Major
Found in src/business/views/app_lists.py and 10 other locations - About 1 hr to fix
src/business/views/app_lists.py on lines 90..96
src/business/views/app_lists.py on lines 134..140
src/business/views/app_lists.py on lines 143..149
src/business/views/app_lists.py on lines 159..165
src/business/views/app_lists.py on lines 168..174
src/business/views/app_lists.py on lines 192..198
src/business/views/app_lists.py on lines 225..231
src/business/views/app_lists.py on lines 234..240
src/business/views/app_lists.py on lines 284..290
src/business/views/app_lists.py on lines 299..305

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

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

class appListAttributeUpdate(appListCommonUpdateView):
    model = wooAttribute
    form_class = wooAttributeForm
    object_name = "Product Attribute"
    object_icon = ""
Severity: Major
Found in src/business/views/app_lists.py and 10 other locations - About 1 hr to fix
src/business/views/app_lists.py on lines 90..96
src/business/views/app_lists.py on lines 134..140
src/business/views/app_lists.py on lines 143..149
src/business/views/app_lists.py on lines 159..165
src/business/views/app_lists.py on lines 168..174
src/business/views/app_lists.py on lines 192..198
src/business/views/app_lists.py on lines 201..207
src/business/views/app_lists.py on lines 225..231
src/business/views/app_lists.py on lines 234..240
src/business/views/app_lists.py on lines 284..290

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

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

class appListFileSpecUpdate(appListCommonUpdateView):
    model = pfCatalogFileSpec
    form_class = pfCatalogFileSpecForm
    object_name = "File Spec"
    object_icon = ""
Severity: Major
Found in src/business/views/app_lists.py and 10 other locations - About 1 hr to fix
src/business/views/app_lists.py on lines 90..96
src/business/views/app_lists.py on lines 134..140
src/business/views/app_lists.py on lines 159..165
src/business/views/app_lists.py on lines 168..174
src/business/views/app_lists.py on lines 192..198
src/business/views/app_lists.py on lines 201..207
src/business/views/app_lists.py on lines 225..231
src/business/views/app_lists.py on lines 234..240
src/business/views/app_lists.py on lines 284..290
src/business/views/app_lists.py on lines 299..305

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

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

class appListShippingCreate(appListCommonCreateView):
    model = wooShippingClass
    form_class = wooShippingClassForm
    object_name = "Shipping Class"
    object_icon = ""
Severity: Major
Found in src/business/views/app_lists.py and 10 other locations - About 1 hr to fix
src/business/views/app_lists.py on lines 90..96
src/business/views/app_lists.py on lines 134..140
src/business/views/app_lists.py on lines 143..149
src/business/views/app_lists.py on lines 168..174
src/business/views/app_lists.py on lines 192..198
src/business/views/app_lists.py on lines 201..207
src/business/views/app_lists.py on lines 225..231
src/business/views/app_lists.py on lines 234..240
src/business/views/app_lists.py on lines 284..290
src/business/views/app_lists.py on lines 299..305

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

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

class appListCatProductUpdate(appListCommonUpdateView):
    model = pfCatalogProduct
    form_class = pfCatalogProductForm
    object_name = "Catalog Product"
    object_icon = ""
Severity: Major
Found in src/business/views/app_lists.py and 10 other locations - About 1 hr to fix
src/business/views/app_lists.py on lines 90..96
src/business/views/app_lists.py on lines 134..140
src/business/views/app_lists.py on lines 143..149
src/business/views/app_lists.py on lines 159..165
src/business/views/app_lists.py on lines 168..174
src/business/views/app_lists.py on lines 192..198
src/business/views/app_lists.py on lines 201..207
src/business/views/app_lists.py on lines 225..231
src/business/views/app_lists.py on lines 234..240
src/business/views/app_lists.py on lines 299..305

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

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 wooTagAdmin(admin.ModelAdmin):
    form = wooTagAdminForm
    list_display = ['id', 'date_added', 'date_updated',
                    'is_active', 'wid', 'name', 'slug', 'description', 'count']
    readonly_fields = ['id', 'date_added', 'date_updated',
Severity: Major
Found in src/business/admin.py and 1 other location - About 1 hr to fix
src/business/admin.py on lines 152..158

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

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 wooAttributeAdmin(admin.ModelAdmin):
    form = wooAttributeAdminForm
    list_display = ['id', 'date_added', 'date_updated',
                    'is_active', 'wid', 'name', 'slug', 'type', 'has_archives']
    readonly_fields = ['id', 'date_added', 'date_updated',
Severity: Major
Found in src/business/admin.py and 1 other location - About 1 hr to fix
src/business/admin.py on lines 270..276

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

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

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

        if key:
            api = pyPrintful(key=key)
        else:
            _storeObj = pfStore.get_store(store)
            api = pyPrintful(key=_storeObj.key)
Severity: Major
Found in src/business/models.py and 1 other location - About 1 hr to fix
src/business/models.py on lines 1506..1510

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

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

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

        if key:
            api = pyPrintful(key=key)
        else:
            _storeObj = pfStore.get_store(store)
            api = pyPrintful(key=_storeObj.key)
Severity: Major
Found in src/business/models.py and 1 other location - About 1 hr to fix
src/business/models.py on lines 1027..1031

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

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 asHTML has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    def asHTML(self):
        """
        Returns an HTML div, formatted in a 'standard' way:

            Name
Severity: Minor
Found in src/business/models.py - About 1 hr 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 32 locations. Consider refactoring.
Open

class bzProductVariantViewSet(viewsets.ModelViewSet):
    """ViewSet for the bzProductVariant class"""

    queryset = models.bzProductVariant.objects.all()
    serializer_class = serializers.bzProductVariantSerializer
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 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 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 bzCreativeDesignViewSet(viewsets.ModelViewSet):
    """ViewSet for the bzCreativeDesign class"""

    queryset = models.bzCreativeDesign.objects.all()
    serializer_class = serializers.bzCreativeDesignSerializer
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 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 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 wooAttributeViewSet(viewsets.ModelViewSet):
    """ViewSet for the wooAttribute class"""

    queryset = models.wooAttribute.objects.all()
    serializer_class = serializers.wooAttributeSerializer
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 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 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

Severity
Category
Status
Source
Language