559Labs/django-dtg-store-manager

View on GitHub
src/business/views/app_lists.py

Summary

Maintainability
D
2 days
Test Coverage

TODO found
Open

    # #TODO For Future Development. Implement a 'ratio' filter for the File Spec table view
Severity: Minor
Found in src/business/views/app_lists.py by fixme

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

class appListGeoPull(View):
    def get(self, request):
        task_api_update_geos.delay(request.user.pk)
        message_user(
            request.user, 'Starting update of geographic data.', constants.INFO)
Severity: Major
Found in src/business/views/app_lists.py and 1 other location - About 1 hr to fix
src/business/views/app_lists.py on lines 275..281

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

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 appListCatProductPull(View):

    def get(self, request):
        task_api_update_products.delay(request.user.pk)
        message_user(
Severity: Major
Found in src/business/views/app_lists.py and 1 other location - About 1 hr to fix
src/business/views/app_lists.py on lines 73..78

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

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

Indentation is not a multiple of 4 (comment)
Open

 # App List
Severity: Minor
Found in src/business/views/app_lists.py by pep8

Use indent_size (PEP8 says 4) spaces per indentation level.

For really old code that you don't want to mess up, you can continue
to use 8-space tabs.

Okay: a = 1
Okay: if a == 0:\n    a = 1
E111:   a = 1
E114:   # a = 1

Okay: for item in items:\n    pass
E112: for item in items:\npass
E115: for item in items:\n# Hi\n    pass

Okay: a = 1\nb = 2
E113: a = 1\n    b = 2
E116: a = 1\n    # b = 2

There are no issues that match your filters.

Category
Status