Showing 4,751 of 10,525 total issues

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

    @staticmethod
    def on_get(req, resp, id_):
        if 'API-KEY' not in req.headers or \
                not isinstance(req.headers['API-KEY'], str) or \
                len(str.strip(req.headers['API-KEY'])) == 0:
Severity: Major
Found in myems-api/core/combinedequipment.py and 1 other location - About 1 wk to fix
myems-api/core/equipment.py on lines 626..752

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

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

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

    @staticmethod
    def on_get(req, resp, id_):
        if 'API-KEY' not in req.headers or \
                not isinstance(req.headers['API-KEY'], str) or \
                len(str.strip(req.headers['API-KEY'])) == 0:
Severity: Major
Found in myems-api/core/energyflowdiagram.py and 1 other location - About 1 wk to fix
myems-api/core/energyflowdiagram.py on lines 1242..1355

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

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

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

    @staticmethod
    def on_get(req, resp, id_):
        if 'API-KEY' not in req.headers or \
                not isinstance(req.headers['API-KEY'], str) or \
                len(str.strip(req.headers['API-KEY'])) == 0:
Severity: Major
Found in myems-api/core/energyflowdiagram.py and 1 other location - About 1 wk to fix
myems-api/core/energyflowdiagram.py on lines 186..299

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

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

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

        if fraction_list is not None and len(fraction_list) > 0:
            for i in range(len(fraction_list)):
                if fraction_list[i]['numerator_meter_uuid'] in offline_meter_dict:
                    fraction_list[i]['numerator_meter_id'] = \
                        offline_meter_dict[fraction_list[i]['numerator_meter_uuid']]['id']
Severity: Major
Found in myems-api/reports/equipmentefficiency.py and 1 other location - About 1 wk to fix
myems-api/reports/combinedequipmentefficiency.py on lines 352..408

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 1037.

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

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

        if fraction_list is not None and len(fraction_list) > 0:
            for i in range(len(fraction_list)):
                if fraction_list[i]['numerator_meter_uuid'] in offline_meter_dict:
                    fraction_list[i]['numerator_meter_id'] = \
                        offline_meter_dict[fraction_list[i]['numerator_meter_uuid']]['id']
Severity: Major
Found in myems-api/reports/combinedequipmentefficiency.py and 1 other location - About 1 wk to fix
myems-api/reports/equipmentefficiency.py on lines 277..333

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

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

    @staticmethod
    def on_get(req, resp, id_, pid):
        if 'API-KEY' not in req.headers or \
                not isinstance(req.headers['API-KEY'], str) or \
                len(str.strip(req.headers['API-KEY'])) == 0:
Severity: Major
Found in myems-api/core/equipment.py and 1 other location - About 1 wk to fix
myems-api/core/combinedequipment.py on lines 1116..1236

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

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

    @staticmethod
    def on_get(req, resp, id_, pid):
        if 'API-KEY' not in req.headers or \
                not isinstance(req.headers['API-KEY'], str) or \
                len(str.strip(req.headers['API-KEY'])) == 0:
Severity: Major
Found in myems-api/core/combinedequipment.py and 1 other location - About 1 wk to fix
myems-api/core/equipment.py on lines 947..1067

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

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

class SpaceVirtualMeterCollection:
    def __init__(self):
        """Initializes Class"""
        pass

Severity: Major
Found in myems-api/core/space.py and 11 other locations - About 1 wk to fix
myems-api/core/shopfloor.py on lines 634..759
myems-api/core/shopfloor.py on lines 822..947
myems-api/core/shopfloor.py on lines 1374..1499
myems-api/core/space.py on lines 1344..1469
myems-api/core/space.py on lines 1710..1835
myems-api/core/store.py on lines 577..702
myems-api/core/store.py on lines 765..890
myems-api/core/store.py on lines 1317..1442
myems-api/core/tenant.py on lines 675..802
myems-api/core/tenant.py on lines 865..992
myems-api/core/tenant.py on lines 1423..1550

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

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

class StoreMeterCollection:
    def __init__(self):
        """"Initializes StoreMeterCollection"""
        pass

Severity: Major
Found in myems-api/core/store.py and 11 other locations - About 1 wk to fix
myems-api/core/shopfloor.py on lines 634..759
myems-api/core/shopfloor.py on lines 822..947
myems-api/core/shopfloor.py on lines 1374..1499
myems-api/core/space.py on lines 1344..1469
myems-api/core/space.py on lines 1710..1835
myems-api/core/space.py on lines 2787..2912
myems-api/core/store.py on lines 765..890
myems-api/core/store.py on lines 1317..1442
myems-api/core/tenant.py on lines 675..802
myems-api/core/tenant.py on lines 865..992
myems-api/core/tenant.py on lines 1423..1550

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

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

class ShopfloorMeterCollection:
    def __init__(self):
        """Initializes ShopfloorMeterCollection"""
        pass

Severity: Major
Found in myems-api/core/shopfloor.py and 11 other locations - About 1 wk to fix
myems-api/core/shopfloor.py on lines 822..947
myems-api/core/shopfloor.py on lines 1374..1499
myems-api/core/space.py on lines 1344..1469
myems-api/core/space.py on lines 1710..1835
myems-api/core/space.py on lines 2787..2912
myems-api/core/store.py on lines 577..702
myems-api/core/store.py on lines 765..890
myems-api/core/store.py on lines 1317..1442
myems-api/core/tenant.py on lines 675..802
myems-api/core/tenant.py on lines 865..992
myems-api/core/tenant.py on lines 1423..1550

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

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

class SpaceOfflineMeterCollection:
    def __init__(self):
        """Initializes Class"""
        pass

Severity: Major
Found in myems-api/core/space.py and 11 other locations - About 1 wk to fix
myems-api/core/shopfloor.py on lines 634..759
myems-api/core/shopfloor.py on lines 822..947
myems-api/core/shopfloor.py on lines 1374..1499
myems-api/core/space.py on lines 1344..1469
myems-api/core/space.py on lines 2787..2912
myems-api/core/store.py on lines 577..702
myems-api/core/store.py on lines 765..890
myems-api/core/store.py on lines 1317..1442
myems-api/core/tenant.py on lines 675..802
myems-api/core/tenant.py on lines 865..992
myems-api/core/tenant.py on lines 1423..1550

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

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

class TenantOfflineMeterCollection:
    def __init__(self):
        """Initializes Class"""
        pass

Severity: Major
Found in myems-api/core/tenant.py and 11 other locations - About 1 wk to fix
myems-api/core/shopfloor.py on lines 634..759
myems-api/core/shopfloor.py on lines 822..947
myems-api/core/shopfloor.py on lines 1374..1499
myems-api/core/space.py on lines 1344..1469
myems-api/core/space.py on lines 1710..1835
myems-api/core/space.py on lines 2787..2912
myems-api/core/store.py on lines 577..702
myems-api/core/store.py on lines 765..890
myems-api/core/store.py on lines 1317..1442
myems-api/core/tenant.py on lines 675..802
myems-api/core/tenant.py on lines 1423..1550

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

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

class SpaceMeterCollection:
    def __init__(self):
        """Initializes Class"""
        pass

Severity: Major
Found in myems-api/core/space.py and 11 other locations - About 1 wk to fix
myems-api/core/shopfloor.py on lines 634..759
myems-api/core/shopfloor.py on lines 822..947
myems-api/core/shopfloor.py on lines 1374..1499
myems-api/core/space.py on lines 1710..1835
myems-api/core/space.py on lines 2787..2912
myems-api/core/store.py on lines 577..702
myems-api/core/store.py on lines 765..890
myems-api/core/store.py on lines 1317..1442
myems-api/core/tenant.py on lines 675..802
myems-api/core/tenant.py on lines 865..992
myems-api/core/tenant.py on lines 1423..1550

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

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

class StoreOfflineMeterCollection:
    def __init__(self):
        """Initializes Class"""
        pass

Severity: Major
Found in myems-api/core/store.py and 11 other locations - About 1 wk to fix
myems-api/core/shopfloor.py on lines 634..759
myems-api/core/shopfloor.py on lines 822..947
myems-api/core/shopfloor.py on lines 1374..1499
myems-api/core/space.py on lines 1344..1469
myems-api/core/space.py on lines 1710..1835
myems-api/core/space.py on lines 2787..2912
myems-api/core/store.py on lines 577..702
myems-api/core/store.py on lines 1317..1442
myems-api/core/tenant.py on lines 675..802
myems-api/core/tenant.py on lines 865..992
myems-api/core/tenant.py on lines 1423..1550

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

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

class ShopfloorVirtualMeterCollection:
    def __init__(self):
        """Initializes ShopfloorVirtualMeterCollection"""
        pass

Severity: Major
Found in myems-api/core/shopfloor.py and 11 other locations - About 1 wk to fix
myems-api/core/shopfloor.py on lines 634..759
myems-api/core/shopfloor.py on lines 822..947
myems-api/core/space.py on lines 1344..1469
myems-api/core/space.py on lines 1710..1835
myems-api/core/space.py on lines 2787..2912
myems-api/core/store.py on lines 577..702
myems-api/core/store.py on lines 765..890
myems-api/core/store.py on lines 1317..1442
myems-api/core/tenant.py on lines 675..802
myems-api/core/tenant.py on lines 865..992
myems-api/core/tenant.py on lines 1423..1550

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

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

class TenantVirtualMeterCollection:
    def __init__(self):
        """Initializes Class"""
        pass

Severity: Major
Found in myems-api/core/tenant.py and 11 other locations - About 1 wk to fix
myems-api/core/shopfloor.py on lines 634..759
myems-api/core/shopfloor.py on lines 822..947
myems-api/core/shopfloor.py on lines 1374..1499
myems-api/core/space.py on lines 1344..1469
myems-api/core/space.py on lines 1710..1835
myems-api/core/space.py on lines 2787..2912
myems-api/core/store.py on lines 577..702
myems-api/core/store.py on lines 765..890
myems-api/core/store.py on lines 1317..1442
myems-api/core/tenant.py on lines 675..802
myems-api/core/tenant.py on lines 865..992

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

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

class ShopfloorOfflineMeterCollection:
    def __init__(self):
        """Initializes ShopfloorOfflineMeterCollection"""
        pass

Severity: Major
Found in myems-api/core/shopfloor.py and 11 other locations - About 1 wk to fix
myems-api/core/shopfloor.py on lines 634..759
myems-api/core/shopfloor.py on lines 1374..1499
myems-api/core/space.py on lines 1344..1469
myems-api/core/space.py on lines 1710..1835
myems-api/core/space.py on lines 2787..2912
myems-api/core/store.py on lines 577..702
myems-api/core/store.py on lines 765..890
myems-api/core/store.py on lines 1317..1442
myems-api/core/tenant.py on lines 675..802
myems-api/core/tenant.py on lines 865..992
myems-api/core/tenant.py on lines 1423..1550

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

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

class StoreVirtualMeterCollection:
    def __init__(self):
        """Initializes Class"""
        pass

Severity: Major
Found in myems-api/core/store.py and 11 other locations - About 1 wk to fix
myems-api/core/shopfloor.py on lines 634..759
myems-api/core/shopfloor.py on lines 822..947
myems-api/core/shopfloor.py on lines 1374..1499
myems-api/core/space.py on lines 1344..1469
myems-api/core/space.py on lines 1710..1835
myems-api/core/space.py on lines 2787..2912
myems-api/core/store.py on lines 577..702
myems-api/core/store.py on lines 765..890
myems-api/core/tenant.py on lines 675..802
myems-api/core/tenant.py on lines 865..992
myems-api/core/tenant.py on lines 1423..1550

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

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

class TenantMeterCollection:
    def __init__(self):
        """Initializes Class"""
        pass

Severity: Major
Found in myems-api/core/tenant.py and 11 other locations - About 1 wk to fix
myems-api/core/shopfloor.py on lines 634..759
myems-api/core/shopfloor.py on lines 822..947
myems-api/core/shopfloor.py on lines 1374..1499
myems-api/core/space.py on lines 1344..1469
myems-api/core/space.py on lines 1710..1835
myems-api/core/space.py on lines 2787..2912
myems-api/core/store.py on lines 577..702
myems-api/core/store.py on lines 765..890
myems-api/core/store.py on lines 1317..1442
myems-api/core/tenant.py on lines 865..992
myems-api/core/tenant.py on lines 1423..1550

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

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 ShopfloorPointCollection:
    def __init__(self):
        """Initializes ShopfloorPointCollection"""
        pass

Severity: Major
Found in myems-api/core/shopfloor.py and 3 other locations - About 1 wk to fix
myems-api/core/space.py on lines 1899..2023
myems-api/core/store.py on lines 954..1078
myems-api/core/tenant.py on lines 1056..1182

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

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

Severity
Category
Status
Source
Language