jacquev6/LowVoltage

View on GitHub
LowVoltage/actions/next_gen_mixins.py

Summary

Maintainability
F
4 days
Test Coverage

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

    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

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

    class ExpressionAttributeNames(OptionalDictOfStringParameter):
        def __init__(self, parent):
            super(ExpressionAttributeNames, self).__init__("ExpressionAttributeNames", parent)
    
        def add(self, synonym, name):
    Severity: Major
    Found in LowVoltage/actions/next_gen_mixins.py and 1 other location - About 2 hrs to fix
    LowVoltage/actions/next_gen_mixins.py on lines 208..216

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

    class ExpressionAttributeValues(OptionalDictOfValueParameter):
        def __init__(self, parent):
            super(ExpressionAttributeValues, self).__init__("ExpressionAttributeValues", parent)
    
        def add(self, name, value):
    Severity: Major
    Found in LowVoltage/actions/next_gen_mixins.py and 1 other location - About 2 hrs to fix
    LowVoltage/actions/next_gen_mixins.py on lines 196..205

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

    class TableName(MandatoryStringParameter):
        def __init__(self, parent, value):
            super(TableName, self).__init__("TableName", parent, value)
    
        def set(self, table_name):
    Severity: Major
    Found in LowVoltage/actions/next_gen_mixins.py and 2 other locations - About 2 hrs to fix
    LowVoltage/actions/next_gen_mixins.py on lines 120..128
    LowVoltage/actions/next_gen_mixins.py on lines 131..139

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

    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 Item(MandatoryItemParameter):
        def __init__(self, parent, value):
            super(Item, self).__init__("Item", parent, value)
    
        def set(self, item):
    Severity: Major
    Found in LowVoltage/actions/next_gen_mixins.py and 2 other locations - About 2 hrs to fix
    LowVoltage/actions/next_gen_mixins.py on lines 109..117
    LowVoltage/actions/next_gen_mixins.py on lines 120..128

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

    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 Key(MandatoryItemParameter):
        def __init__(self, parent, value):
            super(Key, self).__init__("Key", parent, value)
    
        def set(self, key):
    Severity: Major
    Found in LowVoltage/actions/next_gen_mixins.py and 2 other locations - About 2 hrs to fix
    LowVoltage/actions/next_gen_mixins.py on lines 109..117
    LowVoltage/actions/next_gen_mixins.py on lines 131..139

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

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

    class ExclusiveStartKey(OptionalItemParameter):
        def __init__(self, parent):
            super(ExclusiveStartKey, self).__init__("ExclusiveStartKey", parent)
    
        def set(self, key):
    Severity: Major
    Found in LowVoltage/actions/next_gen_mixins.py and 4 other locations - About 2 hrs to fix
    LowVoltage/actions/next_gen_mixins.py on lines 142..150
    LowVoltage/actions/next_gen_mixins.py on lines 153..162
    LowVoltage/actions/next_gen_mixins.py on lines 219..227
    LowVoltage/actions/next_gen_mixins.py on lines 230..238

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

    class Limit(OptionalIntParameter):
        def __init__(self, parent):
            super(Limit, self).__init__("Limit", parent)
    
        def set(self, limit):
    Severity: Major
    Found in LowVoltage/actions/next_gen_mixins.py and 4 other locations - About 2 hrs to fix
    LowVoltage/actions/next_gen_mixins.py on lines 142..150
    LowVoltage/actions/next_gen_mixins.py on lines 153..162
    LowVoltage/actions/next_gen_mixins.py on lines 184..193
    LowVoltage/actions/next_gen_mixins.py on lines 219..227

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

    class IndexName(OptionalStringParameter):
        def __init__(self, parent):
            super(IndexName, self).__init__("IndexName", parent)
    
        def set(self, index_name):
    Severity: Major
    Found in LowVoltage/actions/next_gen_mixins.py and 4 other locations - About 2 hrs to fix
    LowVoltage/actions/next_gen_mixins.py on lines 153..162
    LowVoltage/actions/next_gen_mixins.py on lines 184..193
    LowVoltage/actions/next_gen_mixins.py on lines 219..227
    LowVoltage/actions/next_gen_mixins.py on lines 230..238

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

    class FilterExpression(OptionalStringParameter):
        def __init__(self, parent):
            super(FilterExpression, self).__init__("FilterExpression", parent)
    
        def set(self, expression):
    Severity: Major
    Found in LowVoltage/actions/next_gen_mixins.py and 4 other locations - About 2 hrs to fix
    LowVoltage/actions/next_gen_mixins.py on lines 142..150
    LowVoltage/actions/next_gen_mixins.py on lines 153..162
    LowVoltage/actions/next_gen_mixins.py on lines 184..193
    LowVoltage/actions/next_gen_mixins.py on lines 230..238

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

    class ConditionExpression(OptionalStringParameter):
        def __init__(self, parent):
            super(ConditionExpression, self).__init__("ConditionExpression", parent)
    
        def set(self, expression):
    Severity: Major
    Found in LowVoltage/actions/next_gen_mixins.py and 4 other locations - About 2 hrs to fix
    LowVoltage/actions/next_gen_mixins.py on lines 142..150
    LowVoltage/actions/next_gen_mixins.py on lines 184..193
    LowVoltage/actions/next_gen_mixins.py on lines 219..227
    LowVoltage/actions/next_gen_mixins.py on lines 230..238

    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

    There are no issues that match your filters.

    Category
    Status