jacquev6/LowVoltage

View on GitHub
LowVoltage/actions/put_item.py

Summary

Maintainability
F
1 wk
Test Coverage

File put_item.py has 333 lines of code (exceeds 250 allowed). Consider refactoring.
Open

# coding: utf8

# Copyright 2014-2015 Vincent Jacques <vincent@vincent-jacques.net>
"""
When given a :class:`PutItem`, the connection will return a :class:`PutItemResponse`:
Severity: Minor
Found in LowVoltage/actions/put_item.py - About 4 hrs to fix

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

    class PutItem(Action):
        """
        The `PutItem request <http://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_PutItem.html#API_PutItem_RequestParameters>`__.
        """
    
    
    Severity: Major
    Found in LowVoltage/actions/put_item.py and 1 other location - About 4 days to fix
    LowVoltage/actions/delete_item.py on lines 92..257

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

    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 PutItemResponse(object):
        """
        PutItemResponse()
    
        The `PutItem response <http://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_PutItem.html#API_PutItem_ResponseElements>`__.
    Severity: Major
    Found in LowVoltage/actions/put_item.py and 2 other locations - About 1 day to fix
    LowVoltage/actions/delete_item.py on lines 43..89
    LowVoltage/actions/update_item.py on lines 30..76

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

    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 PutItemResponseUnitTests(_tst.UnitTests):
        def test_all_none(self):
            r = PutItemResponse()
            self.assertIsNone(r.attributes)
            self.assertIsNone(r.consumed_capacity)
    Severity: Major
    Found in LowVoltage/actions/put_item.py and 2 other locations - About 1 day to fix
    LowVoltage/actions/delete_item.py on lines 383..395
    LowVoltage/actions/update_item.py on lines 643..655

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

    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

        def test_expression_attribute_value(self):
            self.assertEqual(
                PutItem("Table", {"hash": 42}).expression_attribute_value("v", u"value").payload,
                {
                    "TableName": "Table",
    Severity: Major
    Found in LowVoltage/actions/put_item.py and 2 other locations - About 2 hrs to fix
    LowVoltage/actions/delete_item.py on lines 352..358
    LowVoltage/actions/update_item.py on lines 512..518

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

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

        def test_expression_attribute_name(self):
            self.assertEqual(
                PutItem("Table", {"hash": 42}).expression_attribute_name("n", "path").payload,
                {
                    "TableName": "Table",
    Severity: Major
    Found in LowVoltage/actions/put_item.py and 3 other locations - About 2 hrs to fix
    LowVoltage/actions/delete_item.py on lines 362..368
    LowVoltage/actions/get_item.py on lines 284..290
    LowVoltage/actions/update_item.py on lines 522..528

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

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

        def test_table_name_and_item(self):
            self.assertEqual(
                PutItem().table_name("Table").item({"hash": 42}).payload,
                {
                    "TableName": "Table",
    Severity: Major
    Found in LowVoltage/actions/put_item.py and 3 other locations - About 2 hrs to fix
    LowVoltage/actions/delete_item.py on lines 264..269
    LowVoltage/actions/get_item.py on lines 216..221
    LowVoltage/actions/update_item.py on lines 403..408

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

    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

        def test_condition_expression(self):
            self.assertEqual(
                PutItem("Table", {"hash": 42}).condition_expression("a=b").payload,
                {
                    "TableName": "Table",
    Severity: Major
    Found in LowVoltage/actions/put_item.py and 2 other locations - About 1 hr to fix
    LowVoltage/actions/delete_item.py on lines 372..378
    LowVoltage/actions/update_item.py on lines 532..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 49.

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

        def test_return_item_collection_metrics_none(self):
            self.assertEqual(
                PutItem("Table", {"hash": u"h"}).return_item_collection_metrics_none().payload,
                {
                    "TableName": "Table",
    Severity: Major
    Found in LowVoltage/actions/put_item.py and 25 other locations - About 1 hr to fix
    LowVoltage/actions/delete_item.py on lines 282..288
    LowVoltage/actions/delete_item.py on lines 292..298
    LowVoltage/actions/delete_item.py on lines 302..308
    LowVoltage/actions/delete_item.py on lines 312..318
    LowVoltage/actions/delete_item.py on lines 322..328
    LowVoltage/actions/delete_item.py on lines 332..338
    LowVoltage/actions/delete_item.py on lines 342..348
    LowVoltage/actions/get_item.py on lines 234..240
    LowVoltage/actions/get_item.py on lines 244..250
    LowVoltage/actions/put_item.py on lines 268..274
    LowVoltage/actions/put_item.py on lines 278..284
    LowVoltage/actions/put_item.py on lines 288..294
    LowVoltage/actions/put_item.py on lines 298..304
    LowVoltage/actions/put_item.py on lines 308..314
    LowVoltage/actions/put_item.py on lines 318..324
    LowVoltage/actions/update_item.py on lines 542..548
    LowVoltage/actions/update_item.py on lines 552..558
    LowVoltage/actions/update_item.py on lines 562..568
    LowVoltage/actions/update_item.py on lines 572..578
    LowVoltage/actions/update_item.py on lines 582..588
    LowVoltage/actions/update_item.py on lines 592..598
    LowVoltage/actions/update_item.py on lines 602..608
    LowVoltage/actions/update_item.py on lines 612..618
    LowVoltage/actions/update_item.py on lines 622..628
    LowVoltage/actions/update_item.py on lines 632..638

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

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

        def test_return_consumed_capacity_indexes(self):
            self.assertEqual(
                PutItem("Table", {"hash": u"h"}).return_consumed_capacity_indexes().payload,
                {
                    "TableName": "Table",
    Severity: Major
    Found in LowVoltage/actions/put_item.py and 25 other locations - About 1 hr to fix
    LowVoltage/actions/delete_item.py on lines 282..288
    LowVoltage/actions/delete_item.py on lines 292..298
    LowVoltage/actions/delete_item.py on lines 302..308
    LowVoltage/actions/delete_item.py on lines 312..318
    LowVoltage/actions/delete_item.py on lines 322..328
    LowVoltage/actions/delete_item.py on lines 332..338
    LowVoltage/actions/delete_item.py on lines 342..348
    LowVoltage/actions/get_item.py on lines 234..240
    LowVoltage/actions/get_item.py on lines 244..250
    LowVoltage/actions/put_item.py on lines 268..274
    LowVoltage/actions/put_item.py on lines 278..284
    LowVoltage/actions/put_item.py on lines 288..294
    LowVoltage/actions/put_item.py on lines 308..314
    LowVoltage/actions/put_item.py on lines 318..324
    LowVoltage/actions/put_item.py on lines 328..334
    LowVoltage/actions/update_item.py on lines 542..548
    LowVoltage/actions/update_item.py on lines 552..558
    LowVoltage/actions/update_item.py on lines 562..568
    LowVoltage/actions/update_item.py on lines 572..578
    LowVoltage/actions/update_item.py on lines 582..588
    LowVoltage/actions/update_item.py on lines 592..598
    LowVoltage/actions/update_item.py on lines 602..608
    LowVoltage/actions/update_item.py on lines 612..618
    LowVoltage/actions/update_item.py on lines 622..628
    LowVoltage/actions/update_item.py on lines 632..638

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

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

        def test_return_consumed_capacity_none(self):
            self.assertEqual(
                PutItem("Table", {"hash": u"h"}).return_consumed_capacity_none().payload,
                {
                    "TableName": "Table",
    Severity: Major
    Found in LowVoltage/actions/put_item.py and 25 other locations - About 1 hr to fix
    LowVoltage/actions/delete_item.py on lines 282..288
    LowVoltage/actions/delete_item.py on lines 292..298
    LowVoltage/actions/delete_item.py on lines 302..308
    LowVoltage/actions/delete_item.py on lines 312..318
    LowVoltage/actions/delete_item.py on lines 322..328
    LowVoltage/actions/delete_item.py on lines 332..338
    LowVoltage/actions/delete_item.py on lines 342..348
    LowVoltage/actions/get_item.py on lines 234..240
    LowVoltage/actions/get_item.py on lines 244..250
    LowVoltage/actions/put_item.py on lines 268..274
    LowVoltage/actions/put_item.py on lines 278..284
    LowVoltage/actions/put_item.py on lines 288..294
    LowVoltage/actions/put_item.py on lines 298..304
    LowVoltage/actions/put_item.py on lines 318..324
    LowVoltage/actions/put_item.py on lines 328..334
    LowVoltage/actions/update_item.py on lines 542..548
    LowVoltage/actions/update_item.py on lines 552..558
    LowVoltage/actions/update_item.py on lines 562..568
    LowVoltage/actions/update_item.py on lines 572..578
    LowVoltage/actions/update_item.py on lines 582..588
    LowVoltage/actions/update_item.py on lines 592..598
    LowVoltage/actions/update_item.py on lines 602..608
    LowVoltage/actions/update_item.py on lines 612..618
    LowVoltage/actions/update_item.py on lines 622..628
    LowVoltage/actions/update_item.py on lines 632..638

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

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

        def test_return_values_all_old(self):
            self.assertEqual(
                PutItem("Table", {"hash": u"h"}).return_values_all_old().payload,
                {
                    "TableName": "Table",
    Severity: Major
    Found in LowVoltage/actions/put_item.py and 25 other locations - About 1 hr to fix
    LowVoltage/actions/delete_item.py on lines 282..288
    LowVoltage/actions/delete_item.py on lines 292..298
    LowVoltage/actions/delete_item.py on lines 302..308
    LowVoltage/actions/delete_item.py on lines 312..318
    LowVoltage/actions/delete_item.py on lines 322..328
    LowVoltage/actions/delete_item.py on lines 332..338
    LowVoltage/actions/delete_item.py on lines 342..348
    LowVoltage/actions/get_item.py on lines 234..240
    LowVoltage/actions/get_item.py on lines 244..250
    LowVoltage/actions/put_item.py on lines 268..274
    LowVoltage/actions/put_item.py on lines 288..294
    LowVoltage/actions/put_item.py on lines 298..304
    LowVoltage/actions/put_item.py on lines 308..314
    LowVoltage/actions/put_item.py on lines 318..324
    LowVoltage/actions/put_item.py on lines 328..334
    LowVoltage/actions/update_item.py on lines 542..548
    LowVoltage/actions/update_item.py on lines 552..558
    LowVoltage/actions/update_item.py on lines 562..568
    LowVoltage/actions/update_item.py on lines 572..578
    LowVoltage/actions/update_item.py on lines 582..588
    LowVoltage/actions/update_item.py on lines 592..598
    LowVoltage/actions/update_item.py on lines 602..608
    LowVoltage/actions/update_item.py on lines 612..618
    LowVoltage/actions/update_item.py on lines 622..628
    LowVoltage/actions/update_item.py on lines 632..638

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

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

        def test_return_item_collection_metrics_size(self):
            self.assertEqual(
                PutItem("Table", {"hash": u"h"}).return_item_collection_metrics_size().payload,
                {
                    "TableName": "Table",
    Severity: Major
    Found in LowVoltage/actions/put_item.py and 25 other locations - About 1 hr to fix
    LowVoltage/actions/delete_item.py on lines 282..288
    LowVoltage/actions/delete_item.py on lines 292..298
    LowVoltage/actions/delete_item.py on lines 302..308
    LowVoltage/actions/delete_item.py on lines 312..318
    LowVoltage/actions/delete_item.py on lines 322..328
    LowVoltage/actions/delete_item.py on lines 332..338
    LowVoltage/actions/delete_item.py on lines 342..348
    LowVoltage/actions/get_item.py on lines 234..240
    LowVoltage/actions/get_item.py on lines 244..250
    LowVoltage/actions/put_item.py on lines 268..274
    LowVoltage/actions/put_item.py on lines 278..284
    LowVoltage/actions/put_item.py on lines 288..294
    LowVoltage/actions/put_item.py on lines 298..304
    LowVoltage/actions/put_item.py on lines 308..314
    LowVoltage/actions/put_item.py on lines 328..334
    LowVoltage/actions/update_item.py on lines 542..548
    LowVoltage/actions/update_item.py on lines 552..558
    LowVoltage/actions/update_item.py on lines 562..568
    LowVoltage/actions/update_item.py on lines 572..578
    LowVoltage/actions/update_item.py on lines 582..588
    LowVoltage/actions/update_item.py on lines 592..598
    LowVoltage/actions/update_item.py on lines 602..608
    LowVoltage/actions/update_item.py on lines 612..618
    LowVoltage/actions/update_item.py on lines 622..628
    LowVoltage/actions/update_item.py on lines 632..638

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

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

        def test_return_consumed_capacity_total(self):
            self.assertEqual(
                PutItem("Table", {"hash": u"h"}).return_consumed_capacity_total().payload,
                {
                    "TableName": "Table",
    Severity: Major
    Found in LowVoltage/actions/put_item.py and 25 other locations - About 1 hr to fix
    LowVoltage/actions/delete_item.py on lines 282..288
    LowVoltage/actions/delete_item.py on lines 292..298
    LowVoltage/actions/delete_item.py on lines 302..308
    LowVoltage/actions/delete_item.py on lines 312..318
    LowVoltage/actions/delete_item.py on lines 322..328
    LowVoltage/actions/delete_item.py on lines 332..338
    LowVoltage/actions/delete_item.py on lines 342..348
    LowVoltage/actions/get_item.py on lines 234..240
    LowVoltage/actions/get_item.py on lines 244..250
    LowVoltage/actions/put_item.py on lines 268..274
    LowVoltage/actions/put_item.py on lines 278..284
    LowVoltage/actions/put_item.py on lines 298..304
    LowVoltage/actions/put_item.py on lines 308..314
    LowVoltage/actions/put_item.py on lines 318..324
    LowVoltage/actions/put_item.py on lines 328..334
    LowVoltage/actions/update_item.py on lines 542..548
    LowVoltage/actions/update_item.py on lines 552..558
    LowVoltage/actions/update_item.py on lines 562..568
    LowVoltage/actions/update_item.py on lines 572..578
    LowVoltage/actions/update_item.py on lines 582..588
    LowVoltage/actions/update_item.py on lines 592..598
    LowVoltage/actions/update_item.py on lines 602..608
    LowVoltage/actions/update_item.py on lines 612..618
    LowVoltage/actions/update_item.py on lines 622..628
    LowVoltage/actions/update_item.py on lines 632..638

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

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

        def test_return_values_none(self):
            self.assertEqual(
                PutItem("Table", {"hash": u"h"}).return_values_none().payload,
                {
                    "TableName": "Table",
    Severity: Major
    Found in LowVoltage/actions/put_item.py and 25 other locations - About 1 hr to fix
    LowVoltage/actions/delete_item.py on lines 282..288
    LowVoltage/actions/delete_item.py on lines 292..298
    LowVoltage/actions/delete_item.py on lines 302..308
    LowVoltage/actions/delete_item.py on lines 312..318
    LowVoltage/actions/delete_item.py on lines 322..328
    LowVoltage/actions/delete_item.py on lines 332..338
    LowVoltage/actions/delete_item.py on lines 342..348
    LowVoltage/actions/get_item.py on lines 234..240
    LowVoltage/actions/get_item.py on lines 244..250
    LowVoltage/actions/put_item.py on lines 278..284
    LowVoltage/actions/put_item.py on lines 288..294
    LowVoltage/actions/put_item.py on lines 298..304
    LowVoltage/actions/put_item.py on lines 308..314
    LowVoltage/actions/put_item.py on lines 318..324
    LowVoltage/actions/put_item.py on lines 328..334
    LowVoltage/actions/update_item.py on lines 542..548
    LowVoltage/actions/update_item.py on lines 552..558
    LowVoltage/actions/update_item.py on lines 562..568
    LowVoltage/actions/update_item.py on lines 572..578
    LowVoltage/actions/update_item.py on lines 582..588
    LowVoltage/actions/update_item.py on lines 592..598
    LowVoltage/actions/update_item.py on lines 602..608
    LowVoltage/actions/update_item.py on lines 612..618
    LowVoltage/actions/update_item.py on lines 622..628
    LowVoltage/actions/update_item.py on lines 632..638

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

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    There are no issues that match your filters.

    Category
    Status