jacquev6/LowVoltage

View on GitHub
LowVoltage/actions/update_item.py

Summary

Maintainability
F
1 wk
Test Coverage

File update_item.py has 584 lines of code (exceeds 250 allowed). Consider refactoring.
Open

# coding: utf8

# Copyright 2014-2015 Vincent Jacques <vincent@vincent-jacques.net>

"""
Severity: Major
Found in LowVoltage/actions/update_item.py - About 1 day to fix

    UpdateItemUnitTests has 23 functions (exceeds 20 allowed). Consider refactoring.
    Open

    class UpdateItemUnitTests(_tst.UnitTests):
        def test_name(self):
            self.assertEqual(UpdateItem("Table", {"hash": 42}).name, "UpdateItem")
    
        def test_table_name_and_key(self):
    Severity: Minor
    Found in LowVoltage/actions/update_item.py - About 2 hrs to fix

      UpdateItem has 21 functions (exceeds 20 allowed). Consider refactoring.
      Open

      class UpdateItem(Action):
          """
          The `UpdateItem request <http://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_UpdateItem.html#API_UpdateItem_RequestParameters>`__.
          """
      
      
      Severity: Minor
      Found in LowVoltage/actions/update_item.py - About 2 hrs to fix

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

        class UpdateItemResponse(object):
            """
            UpdateItemResponse()
        
            The `UpdateItem response <http://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_UpdateItem.html#API_UpdateItem_ResponseElements>`__.
        Severity: Major
        Found in LowVoltage/actions/update_item.py and 2 other locations - About 1 day to fix
        LowVoltage/actions/delete_item.py on lines 43..89
        LowVoltage/actions/put_item.py on lines 29..75

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

        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_several_deletes(self):
                self.assertIn(
                    UpdateItem("Table", {"hash": 42}).delete("a", "v").delete("b", "w").payload,
                    [
                        {
        Severity: Major
        Found in LowVoltage/actions/update_item.py and 2 other locations - About 4 hrs to fix
        LowVoltage/actions/update_item.py on lines 431..443
        LowVoltage/actions/update_item.py on lines 468..480

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

        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_several_sets(self):
                self.assertIn(
                    UpdateItem("Table", {"hash": 42}).set("a", ":v").set("b", ":w").payload,
                    [
                        {
        Severity: Major
        Found in LowVoltage/actions/update_item.py and 2 other locations - About 4 hrs to fix
        LowVoltage/actions/update_item.py on lines 468..480
        LowVoltage/actions/update_item.py on lines 495..507

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

        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_several_adds(self):
                self.assertIn(
                    UpdateItem("Table", {"hash": 42}).add("a", "v").add("b", "w").payload,
                    [
                        {
        Severity: Major
        Found in LowVoltage/actions/update_item.py and 2 other locations - About 4 hrs to fix
        LowVoltage/actions/update_item.py on lines 431..443
        LowVoltage/actions/update_item.py on lines 495..507

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

        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(
                    UpdateItem("Table", {"hash": 42}).expression_attribute_value("v", u"value").payload,
                    {
                        "TableName": "Table",
        Severity: Major
        Found in LowVoltage/actions/update_item.py and 2 other locations - About 2 hrs to fix
        LowVoltage/actions/delete_item.py on lines 352..358
        LowVoltage/actions/put_item.py on lines 338..344

        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(
                    UpdateItem("Table", {"hash": 42}).expression_attribute_name("n", "path").payload,
                    {
                        "TableName": "Table",
        Severity: Major
        Found in LowVoltage/actions/update_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/put_item.py on lines 348..354

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

                if self.__add:
                    update.append("ADD {}".format(", ".join("{} :{}".format(n, v) for n, v in self.__add.iteritems())))
        Severity: Major
        Found in LowVoltage/actions/update_item.py and 2 other locations - About 2 hrs to fix
        LowVoltage/actions/update_item.py on lines 107..108
        LowVoltage/actions/update_item.py on lines 113..114

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

        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

                if self.__set:
                    update.append("SET {}".format(", ".join("{}={}".format(n, v) for n, v in self.__set.iteritems())))
        Severity: Major
        Found in LowVoltage/actions/update_item.py and 2 other locations - About 2 hrs to fix
        LowVoltage/actions/update_item.py on lines 111..112
        LowVoltage/actions/update_item.py on lines 113..114

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

        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

                if self.__delete:
                    update.append("DELETE {}".format(", ".join("{} :{}".format(n, v) for n, v in self.__delete.iteritems())))
        Severity: Major
        Found in LowVoltage/actions/update_item.py and 2 other locations - About 2 hrs to fix
        LowVoltage/actions/update_item.py on lines 107..108
        LowVoltage/actions/update_item.py on lines 111..112

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

        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_delete(self):
                self.assertEqual(
                    UpdateItem("Table", {"hash": 42}).delete("a", "v").payload,
                    {
                        "TableName": "Table",
        Severity: Major
        Found in LowVoltage/actions/update_item.py and 2 other locations - About 2 hrs to fix
        LowVoltage/actions/update_item.py on lines 421..427
        LowVoltage/actions/update_item.py on lines 458..464

        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_set(self):
                self.assertEqual(
                    UpdateItem("Table", {"hash": 42}).set("a", ":v").payload,
                    {
                        "TableName": "Table",
        Severity: Major
        Found in LowVoltage/actions/update_item.py and 2 other locations - About 2 hrs to fix
        LowVoltage/actions/update_item.py on lines 458..464
        LowVoltage/actions/update_item.py on lines 485..491

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

            def test_table_name_and_key(self):
                self.assertEqual(
                    UpdateItem().table_name("Table").key({"hash": 42}).payload,
                    {
                        "TableName": "Table",
        Severity: Major
        Found in LowVoltage/actions/update_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/put_item.py on lines 250..255

        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_add(self):
                self.assertEqual(
                    UpdateItem("Table", {"hash": 42}).add("a", "v").payload,
                    {
                        "TableName": "Table",
        Severity: Major
        Found in LowVoltage/actions/update_item.py and 2 other locations - About 2 hrs to fix
        LowVoltage/actions/update_item.py on lines 421..427
        LowVoltage/actions/update_item.py on lines 485..491

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

        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_consumed_capacity_none(self):
                self.assertEqual(
                    UpdateItem("Table", {"hash": u"h"}).return_consumed_capacity_none().payload,
                    {
                        "TableName": "Table",
        Severity: Major
        Found in LowVoltage/actions/update_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/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 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_new(self):
                self.assertEqual(
                    UpdateItem("Table", {"hash": u"h"}).return_values_all_new().payload,
                    {
                        "TableName": "Table",
        Severity: Major
        Found in LowVoltage/actions/update_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/put_item.py on lines 328..334
        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(
                    UpdateItem("Table", {"hash": u"h"}).return_values_all_old().payload,
                    {
                        "TableName": "Table",
        Severity: Major
        Found in LowVoltage/actions/update_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/put_item.py on lines 328..334
        LowVoltage/actions/update_item.py on lines 542..548
        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_updated_new(self):
                self.assertEqual(
                    UpdateItem("Table", {"hash": u"h"}).return_values_updated_new().payload,
                    {
                        "TableName": "Table",
        Severity: Major
        Found in LowVoltage/actions/update_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/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 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(
                    UpdateItem("Table", {"hash": u"h"}).return_values_none().payload,
                    {
                        "TableName": "Table",
        Severity: Major
        Found in LowVoltage/actions/update_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/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 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(
                    UpdateItem("Table", {"hash": u"h"}).return_item_collection_metrics_size().payload,
                    {
                        "TableName": "Table",
        Severity: Major
        Found in LowVoltage/actions/update_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/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 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(
                    UpdateItem("Table", {"hash": u"h"}).return_consumed_capacity_indexes().payload,
                    {
                        "TableName": "Table",
        Severity: Major
        Found in LowVoltage/actions/update_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/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 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_none(self):
                self.assertEqual(
                    UpdateItem("Table", {"hash": u"h"}).return_item_collection_metrics_none().payload,
                    {
                        "TableName": "Table",
        Severity: Major
        Found in LowVoltage/actions/update_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/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

        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_updated_old(self):
                self.assertEqual(
                    UpdateItem("Table", {"hash": u"h"}).return_values_updated_old().payload,
                    {
                        "TableName": "Table",
        Severity: Major
        Found in LowVoltage/actions/update_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/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 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(
                    UpdateItem("Table", {"hash": u"h"}).return_consumed_capacity_total().payload,
                    {
                        "TableName": "Table",
        Severity: Major
        Found in LowVoltage/actions/update_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/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 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 3 locations. Consider refactoring.
        Open

            def test_constructor(self):
                self.assertEqual(
                    UpdateItem("Table", {"hash": 42}).payload,
                    {
                        "TableName": "Table",
        Severity: Major
        Found in LowVoltage/actions/update_item.py and 2 other locations - About 1 hr to fix
        LowVoltage/actions/delete_item.py on lines 273..278
        LowVoltage/actions/get_item.py on lines 225..230

        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

        There are no issues that match your filters.

        Category
        Status