jacquev6/LowVoltage

View on GitHub

Showing 329 of 329 total issues

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

    def test_back_to_create_gsi_after_back_to_table(self):
        self.assertEqual(
            UpdateTable("Foo").create_global_secondary_index("the_gsi").table().provisioned_throughput(12, 13)
                .create_global_secondary_index("the_gsi").provisioned_throughput(42, 43).payload,
            {
Severity: Major
Found in LowVoltage/actions/update_table.py and 2 other locations - About 4 hrs to fix
LowVoltage/actions/update_table.py on lines 481..490
LowVoltage/actions/update_table.py on lines 507..516

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

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

class AttributeDefinition(object):
    """
    `AttributeDefinition <http://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_AttributeDefinition.html>`__.
    """

Severity: Major
Found in LowVoltage/actions/return_types.py and 3 other locations - About 4 hrs to fix
LowVoltage/actions/list_tables.py on lines 24..61
LowVoltage/actions/return_types.py on lines 343..371
LowVoltage/actions/return_types.py on lines 471..499

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

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_back_to_update_gsi_after_back_to_table_after_create_gsi(self):
        self.assertEqual(
            UpdateTable("Foo").create_global_secondary_index("the_gsi").table().provisioned_throughput(12, 13)
                .update_global_secondary_index("the_gsi").provisioned_throughput(42, 43).payload,
            {
Severity: Major
Found in LowVoltage/actions/update_table.py and 2 other locations - About 4 hrs to fix
LowVoltage/actions/update_table.py on lines 481..490
LowVoltage/actions/update_table.py on lines 494..503

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

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

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

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

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

Refactorings

Further Reading

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

class ReturnConsumedCapacity(OptionalStringParameter):
    def __init__(self, parent):
        super(ReturnConsumedCapacity, self).__init__("ReturnConsumedCapacity", parent)

    def indexes(self):
Severity: Major
Found in LowVoltage/actions/next_gen_mixins.py and 1 other location - About 4 hrs to fix
LowVoltage/actions/next_gen_mixins.py on lines 348..369

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

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

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

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

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

Refactorings

Further Reading

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

class Select(OptionalStringParameter):
    def __init__(self, parent):
        super(Select, self).__init__("Select", parent)

    def all_attributes(self):
Severity: Major
Found in LowVoltage/actions/next_gen_mixins.py and 1 other location - About 4 hrs to fix
LowVoltage/actions/next_gen_mixins.py on lines 263..286

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

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

File delete_item.py has 344 lines of code (exceeds 250 allowed). Consider refactoring.
Open

# coding: utf8

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

"""
Severity: Minor
Found in LowVoltage/actions/delete_item.py - About 4 hrs to fix

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

    def iterate_query(connection, query):
        """
        Make as many :class:`.Query` actions as needed to iterate over all matching items.
        That is until :attr:`.QueryResponse.last_evaluated_key` is ``None``.
    
    
    Severity: Major
    Found in LowVoltage/compounds/iterate_query.py and 1 other location - About 4 hrs to fix
    LowVoltage/compounds/iterate_scan.py on lines 11..38

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

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

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

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

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

    Refactorings

    Further Reading

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

    def iterate_scan(connection, scan):
        """
        Make as many :class:`.Scan` actions as needed to iterate over all matching items.
        That is until :attr:`.ScanResponse.last_evaluated_key` is ``None``.
    
    
    Severity: Major
    Found in LowVoltage/compounds/iterate_scan.py and 1 other location - About 4 hrs to fix
    LowVoltage/compounds/iterate_query.py on lines 9..30

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

    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

    ConversionUnitTests has 32 functions (exceeds 20 allowed). Consider refactoring.
    Open

    class ConversionUnitTests(_tst.UnitTests):
        def test_convert_unicode_value_to_db(self):
            self.assertEqual(_convert_value_to_db(u"éoà"), {"S": u"éoà"})
    
        def test_convert_bytes_value_to_db(self):
    Severity: Minor
    Found in LowVoltage/actions/conversion.py - About 4 hrs to fix

      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

        File next_gen_mixins.py has 323 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        # coding: utf8
        
        # Copyright 2014-2015 Vincent Jacques <vincent@vincent-jacques.net>
        
        import numbers
        Severity: Minor
        Found in LowVoltage/actions/next_gen_mixins.py - About 3 hrs to fix

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

              def test_create_gsi_range_key_with_type(self):
                  self.assertEqual(
                      UpdateTable("Foo").create_global_secondary_index("the_gsi").range_key("r", "N").payload,
                      {
                          "TableName": "Foo",
          Severity: Major
          Found in LowVoltage/actions/update_table.py and 1 other location - About 3 hrs to fix
          LowVoltage/actions/update_table.py on lines 391..399

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

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

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

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

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

          Refactorings

          Further Reading

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

              def test_create_gsi_hash_key_with_type(self):
                  self.assertEqual(
                      UpdateTable("Foo").create_global_secondary_index("the_gsi").hash_key("h", "S").payload,
                      {
                          "TableName": "Foo",
          Severity: Major
          Found in LowVoltage/actions/update_table.py and 1 other location - About 3 hrs to fix
          LowVoltage/actions/update_table.py on lines 403..411

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

          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

          UpdateTableUnitTests has 30 functions (exceeds 20 allowed). Consider refactoring.
          Open

          class UpdateTableUnitTests(_tst.UnitTests):
              def test_name(self):
                  self.assertEqual(UpdateTable("Foo").name, "UpdateTable")
          
              def test_constructor(self):
          Severity: Minor
          Found in LowVoltage/actions/update_table.py - About 3 hrs to fix

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

                def test_global_secondary_index_hash_key_with_type(self):
                    self.assertEqual(
                        CreateTable("Foo").global_secondary_index("foo").hash_key("hh", _lv.STRING).payload,
                        {
                            "TableName": "Foo",
            Severity: Major
            Found in LowVoltage/actions/create_table.py and 1 other location - About 3 hrs to fix
            LowVoltage/actions/create_table.py on lines 440..448

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

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

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

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

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

            Refactorings

            Further Reading

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

                def test_global_secondary_index_range_key_with_type(self):
                    self.assertEqual(
                        CreateTable("Foo").global_secondary_index("foo").range_key("rr", _lv.STRING).payload,
                        {
                            "TableName": "Foo",
            Severity: Major
            Found in LowVoltage/actions/create_table.py and 1 other location - About 3 hrs to fix
            LowVoltage/actions/create_table.py on lines 428..436

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

            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

            File scan.py has 309 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            # coding: utf8
            
            # Copyright 2014-2015 Vincent Jacques <vincent@vincent-jacques.net>
            
            """
            Severity: Minor
            Found in LowVoltage/actions/scan.py - About 3 hrs to fix
              Severity
              Category
              Status
              Source
              Language