Showing 4,754 of 10,533 total issues

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

            if 'uuid' in link['meter'].keys():
                if link['meter']['uuid'] is not None and \
                        isinstance(link['meter']['uuid'], str) and \
                        len(str.strip(link['meter']['uuid'])) > 0:
                    meter_uuid = str.strip(link['meter']['uuid'])
Severity: Major
Found in myems-api/core/energyflowdiagram.py and 14 other locations - About 7 hrs to fix
myems-api/core/combinedequipment.py on lines 948..952
myems-api/core/combinedequipment.py on lines 963..967
myems-api/core/combinedequipment.py on lines 970..974
myems-api/core/combinedequipment.py on lines 1328..1332
myems-api/core/combinedequipment.py on lines 1343..1347
myems-api/core/combinedequipment.py on lines 1350..1354
myems-api/core/energyflowdiagram.py on lines 535..539
myems-api/core/energyflowdiagram.py on lines 835..839
myems-api/core/equipment.py on lines 791..795
myems-api/core/equipment.py on lines 806..810
myems-api/core/equipment.py on lines 813..817
myems-api/core/equipment.py on lines 1159..1163
myems-api/core/equipment.py on lines 1174..1178
myems-api/core/equipment.py on lines 1181..1185

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

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

        if 'constant' in new_values['data'].keys():
            if new_values['data']['constant'] is not None and \
                    isinstance(new_values['data']['constant'], str) and \
                    len(str.strip(new_values['data']['constant'])) > 0:
                constant = str.strip(new_values['data']['constant'])
Severity: Major
Found in myems-api/core/combinedequipment.py and 14 other locations - About 7 hrs to fix
myems-api/core/combinedequipment.py on lines 948..952
myems-api/core/combinedequipment.py on lines 963..967
myems-api/core/combinedequipment.py on lines 970..974
myems-api/core/combinedequipment.py on lines 1343..1347
myems-api/core/combinedequipment.py on lines 1350..1354
myems-api/core/energyflowdiagram.py on lines 535..539
myems-api/core/energyflowdiagram.py on lines 835..839
myems-api/core/energyflowdiagram.py on lines 1455..1459
myems-api/core/equipment.py on lines 791..795
myems-api/core/equipment.py on lines 806..810
myems-api/core/equipment.py on lines 813..817
myems-api/core/equipment.py on lines 1159..1163
myems-api/core/equipment.py on lines 1174..1178
myems-api/core/equipment.py on lines 1181..1185

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

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

        if 'denominator_meter_uuid' in new_values['data'].keys():
            if new_values['data']['denominator_meter_uuid'] is not None and \
                    isinstance(new_values['data']['denominator_meter_uuid'], str) and \
                    len(str.strip(new_values['data']['denominator_meter_uuid'])) > 0:
                denominator_meter_uuid = str.strip(new_values['data']['denominator_meter_uuid'])
Severity: Major
Found in myems-api/core/combinedequipment.py and 14 other locations - About 7 hrs to fix
myems-api/core/combinedequipment.py on lines 948..952
myems-api/core/combinedequipment.py on lines 963..967
myems-api/core/combinedequipment.py on lines 1328..1332
myems-api/core/combinedequipment.py on lines 1343..1347
myems-api/core/combinedequipment.py on lines 1350..1354
myems-api/core/energyflowdiagram.py on lines 535..539
myems-api/core/energyflowdiagram.py on lines 835..839
myems-api/core/energyflowdiagram.py on lines 1455..1459
myems-api/core/equipment.py on lines 791..795
myems-api/core/equipment.py on lines 806..810
myems-api/core/equipment.py on lines 813..817
myems-api/core/equipment.py on lines 1159..1163
myems-api/core/equipment.py on lines 1174..1178
myems-api/core/equipment.py on lines 1181..1185

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

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

        if 'denominator_meter_uuid' in new_values['data'].keys():
            if new_values['data']['denominator_meter_uuid'] is not None and \
                    isinstance(new_values['data']['denominator_meter_uuid'], str) and \
                    len(str.strip(new_values['data']['denominator_meter_uuid'])) > 0:
                denominator_meter_uuid = str.strip(new_values['data']['denominator_meter_uuid'])
Severity: Major
Found in myems-api/core/combinedequipment.py and 14 other locations - About 7 hrs to fix
myems-api/core/combinedequipment.py on lines 948..952
myems-api/core/combinedequipment.py on lines 963..967
myems-api/core/combinedequipment.py on lines 970..974
myems-api/core/combinedequipment.py on lines 1328..1332
myems-api/core/combinedequipment.py on lines 1343..1347
myems-api/core/energyflowdiagram.py on lines 535..539
myems-api/core/energyflowdiagram.py on lines 835..839
myems-api/core/energyflowdiagram.py on lines 1455..1459
myems-api/core/equipment.py on lines 791..795
myems-api/core/equipment.py on lines 806..810
myems-api/core/equipment.py on lines 813..817
myems-api/core/equipment.py on lines 1159..1163
myems-api/core/equipment.py on lines 1174..1178
myems-api/core/equipment.py on lines 1181..1185

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

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

        if 'constant' in new_values['data'].keys():
            if new_values['data']['constant'] is not None and \
                    isinstance(new_values['data']['constant'], str) and \
                    len(str.strip(new_values['data']['constant'])) > 0:
                constant = str.strip(new_values['data']['constant'])
Severity: Major
Found in myems-api/core/equipment.py and 14 other locations - About 7 hrs to fix
myems-api/core/combinedequipment.py on lines 948..952
myems-api/core/combinedequipment.py on lines 963..967
myems-api/core/combinedequipment.py on lines 970..974
myems-api/core/combinedequipment.py on lines 1328..1332
myems-api/core/combinedequipment.py on lines 1343..1347
myems-api/core/combinedequipment.py on lines 1350..1354
myems-api/core/energyflowdiagram.py on lines 535..539
myems-api/core/energyflowdiagram.py on lines 835..839
myems-api/core/energyflowdiagram.py on lines 1455..1459
myems-api/core/equipment.py on lines 791..795
myems-api/core/equipment.py on lines 806..810
myems-api/core/equipment.py on lines 813..817
myems-api/core/equipment.py on lines 1174..1178
myems-api/core/equipment.py on lines 1181..1185

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

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

        if 'numerator_meter_uuid' in new_values['data'].keys():
            if new_values['data']['numerator_meter_uuid'] is not None and \
                    isinstance(new_values['data']['numerator_meter_uuid'], str) and \
                    len(str.strip(new_values['data']['numerator_meter_uuid'])) > 0:
                numerator_meter_uuid = str.strip(new_values['data']['numerator_meter_uuid'])
Severity: Major
Found in myems-api/core/equipment.py and 14 other locations - About 7 hrs to fix
myems-api/core/combinedequipment.py on lines 948..952
myems-api/core/combinedequipment.py on lines 963..967
myems-api/core/combinedequipment.py on lines 970..974
myems-api/core/combinedequipment.py on lines 1328..1332
myems-api/core/combinedequipment.py on lines 1343..1347
myems-api/core/combinedequipment.py on lines 1350..1354
myems-api/core/energyflowdiagram.py on lines 535..539
myems-api/core/energyflowdiagram.py on lines 835..839
myems-api/core/energyflowdiagram.py on lines 1455..1459
myems-api/core/equipment.py on lines 791..795
myems-api/core/equipment.py on lines 806..810
myems-api/core/equipment.py on lines 813..817
myems-api/core/equipment.py on lines 1159..1163
myems-api/core/equipment.py on lines 1181..1185

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

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

        if 'numerator_meter_uuid' in new_values['data'].keys():
            if new_values['data']['numerator_meter_uuid'] is not None and \
                    isinstance(new_values['data']['numerator_meter_uuid'], str) and \
                    len(str.strip(new_values['data']['numerator_meter_uuid'])) > 0:
                numerator_meter_uuid = str.strip(new_values['data']['numerator_meter_uuid'])
Severity: Major
Found in myems-api/core/combinedequipment.py and 14 other locations - About 7 hrs to fix
myems-api/core/combinedequipment.py on lines 948..952
myems-api/core/combinedequipment.py on lines 963..967
myems-api/core/combinedequipment.py on lines 970..974
myems-api/core/combinedequipment.py on lines 1328..1332
myems-api/core/combinedequipment.py on lines 1350..1354
myems-api/core/energyflowdiagram.py on lines 535..539
myems-api/core/energyflowdiagram.py on lines 835..839
myems-api/core/energyflowdiagram.py on lines 1455..1459
myems-api/core/equipment.py on lines 791..795
myems-api/core/equipment.py on lines 806..810
myems-api/core/equipment.py on lines 813..817
myems-api/core/equipment.py on lines 1159..1163
myems-api/core/equipment.py on lines 1174..1178
myems-api/core/equipment.py on lines 1181..1185

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

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

        if 'numerator_meter_uuid' in new_values['data'].keys():
            if new_values['data']['numerator_meter_uuid'] is not None and \
                    isinstance(new_values['data']['numerator_meter_uuid'], str) and \
                    len(str.strip(new_values['data']['numerator_meter_uuid'])) > 0:
                numerator_meter_uuid = str.strip(new_values['data']['numerator_meter_uuid'])
Severity: Major
Found in myems-api/core/combinedequipment.py and 14 other locations - About 7 hrs to fix
myems-api/core/combinedequipment.py on lines 948..952
myems-api/core/combinedequipment.py on lines 970..974
myems-api/core/combinedequipment.py on lines 1328..1332
myems-api/core/combinedequipment.py on lines 1343..1347
myems-api/core/combinedequipment.py on lines 1350..1354
myems-api/core/energyflowdiagram.py on lines 535..539
myems-api/core/energyflowdiagram.py on lines 835..839
myems-api/core/energyflowdiagram.py on lines 1455..1459
myems-api/core/equipment.py on lines 791..795
myems-api/core/equipment.py on lines 806..810
myems-api/core/equipment.py on lines 813..817
myems-api/core/equipment.py on lines 1159..1163
myems-api/core/equipment.py on lines 1174..1178
myems-api/core/equipment.py on lines 1181..1185

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

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

        if 'constant' in new_values['data'].keys():
            if new_values['data']['constant'] is not None and \
                    isinstance(new_values['data']['constant'], str) and \
                    len(str.strip(new_values['data']['constant'])) > 0:
                constant = str.strip(new_values['data']['constant'])
Severity: Major
Found in myems-api/core/combinedequipment.py and 14 other locations - About 7 hrs to fix
myems-api/core/combinedequipment.py on lines 963..967
myems-api/core/combinedequipment.py on lines 970..974
myems-api/core/combinedequipment.py on lines 1328..1332
myems-api/core/combinedequipment.py on lines 1343..1347
myems-api/core/combinedequipment.py on lines 1350..1354
myems-api/core/energyflowdiagram.py on lines 535..539
myems-api/core/energyflowdiagram.py on lines 835..839
myems-api/core/energyflowdiagram.py on lines 1455..1459
myems-api/core/equipment.py on lines 791..795
myems-api/core/equipment.py on lines 806..810
myems-api/core/equipment.py on lines 813..817
myems-api/core/equipment.py on lines 1159..1163
myems-api/core/equipment.py on lines 1174..1178
myems-api/core/equipment.py on lines 1181..1185

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

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

        if 'constant' in new_values['data'].keys():
            if new_values['data']['constant'] is not None and \
                    isinstance(new_values['data']['constant'], str) and \
                    len(str.strip(new_values['data']['constant'])) > 0:
                constant = str.strip(new_values['data']['constant'])
Severity: Major
Found in myems-api/core/equipment.py and 14 other locations - About 7 hrs to fix
myems-api/core/combinedequipment.py on lines 948..952
myems-api/core/combinedequipment.py on lines 963..967
myems-api/core/combinedequipment.py on lines 970..974
myems-api/core/combinedequipment.py on lines 1328..1332
myems-api/core/combinedequipment.py on lines 1343..1347
myems-api/core/combinedequipment.py on lines 1350..1354
myems-api/core/energyflowdiagram.py on lines 535..539
myems-api/core/energyflowdiagram.py on lines 835..839
myems-api/core/energyflowdiagram.py on lines 1455..1459
myems-api/core/equipment.py on lines 806..810
myems-api/core/equipment.py on lines 813..817
myems-api/core/equipment.py on lines 1159..1163
myems-api/core/equipment.py on lines 1174..1178
myems-api/core/equipment.py on lines 1181..1185

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

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

        if 'numerator_meter_uuid' in new_values['data'].keys():
            if new_values['data']['numerator_meter_uuid'] is not None and \
                    isinstance(new_values['data']['numerator_meter_uuid'], str) and \
                    len(str.strip(new_values['data']['numerator_meter_uuid'])) > 0:
                numerator_meter_uuid = str.strip(new_values['data']['numerator_meter_uuid'])
Severity: Major
Found in myems-api/core/equipment.py and 14 other locations - About 7 hrs to fix
myems-api/core/combinedequipment.py on lines 948..952
myems-api/core/combinedequipment.py on lines 963..967
myems-api/core/combinedequipment.py on lines 970..974
myems-api/core/combinedequipment.py on lines 1328..1332
myems-api/core/combinedequipment.py on lines 1343..1347
myems-api/core/combinedequipment.py on lines 1350..1354
myems-api/core/energyflowdiagram.py on lines 535..539
myems-api/core/energyflowdiagram.py on lines 835..839
myems-api/core/energyflowdiagram.py on lines 1455..1459
myems-api/core/equipment.py on lines 791..795
myems-api/core/equipment.py on lines 813..817
myems-api/core/equipment.py on lines 1159..1163
myems-api/core/equipment.py on lines 1174..1178
myems-api/core/equipment.py on lines 1181..1185

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

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

        if 'meter_uuid' in new_values['data'].keys():
            if new_values['data']['meter_uuid'] is not None and \
                    isinstance(new_values['data']['meter_uuid'], str) and \
                    len(str.strip(new_values['data']['meter_uuid'])) > 0:
                meter_uuid = str.strip(new_values['data']['meter_uuid'])
Severity: Major
Found in myems-api/core/energyflowdiagram.py and 14 other locations - About 7 hrs to fix
myems-api/core/combinedequipment.py on lines 948..952
myems-api/core/combinedequipment.py on lines 963..967
myems-api/core/combinedequipment.py on lines 970..974
myems-api/core/combinedequipment.py on lines 1328..1332
myems-api/core/combinedequipment.py on lines 1343..1347
myems-api/core/combinedequipment.py on lines 1350..1354
myems-api/core/energyflowdiagram.py on lines 835..839
myems-api/core/energyflowdiagram.py on lines 1455..1459
myems-api/core/equipment.py on lines 791..795
myems-api/core/equipment.py on lines 806..810
myems-api/core/equipment.py on lines 813..817
myems-api/core/equipment.py on lines 1159..1163
myems-api/core/equipment.py on lines 1174..1178
myems-api/core/equipment.py on lines 1181..1185

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

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

                  <p className="fs--1 mb-1">
                    {t('PCS Run State')}:{' '}
                    <strong
                      className={classNames({
                        'text-success': PCSRunState === 'Running',
myems-web/src/components/MyEMS/Microgrid/MicrogridListItem.js on lines 127..152

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

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

                  <p className="fs--1 mb-1">
                    {t('PCS Run State')}:{' '}
                    <strong
                      className={classNames({
                        'text-success': PCSRunState === 'Running',
myems-web/src/components/MyEMS/EnergyStoragePowerStation/EnergyStoragePowerStationListItem.js on lines 144..169

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

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

const Toastify = () => (
  <Fragment>
    <PageHeader
      title="React Toastify"
      description="By default, all toasts will inherit ToastContainer's props. Props defined on toast supersede ToastContainer's props. Props marked with * can only be set on the ToastContainer. The demo is not exhaustive, check the repo for more!"
Severity: Major
Found in myems-web/src/components/plugins/Toastify.js and 1 other location - About 7 hrs to fix
myems-web/src/components/plugins/Typed.js on lines 17..43

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

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

const TypedExample = () => (
  <Fragment>
    <PageHeader
      title="React Typed"
      description="This is a react component that wraps up the typed.js. Typed.js is a library that types. Enter in any string, and watch it type at the speed you've set, backspace what it's typed, and begin a new sentence for however many strings you've set."
Severity: Major
Found in myems-web/src/components/plugins/Typed.js and 1 other location - About 7 hrs to fix
myems-web/src/components/plugins/Toastify.js on lines 32..58

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

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 row is None:
            raise falcon.HTTPError(status=falcon.HTTP_404, title='API.NOT_FOUND',
                                   description='API.ENERGY_STORAGE_CONTAINER_NOT_FOUND')
        else:
            meta_result = {"id": row[0],
Severity: Major
Found in myems-api/core/energystoragecontainer.py and 1 other location - About 7 hrs to fix
myems-api/core/energystoragecontainer.py on lines 72..81

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

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

                meta_result = {"id": row[0],
                               "name": row[1],
                               "uuid": row[2],
                               "rated_capacity": row[3],
                               "rated_power": row[4],
Severity: Major
Found in myems-api/core/energystoragecontainer.py and 1 other location - About 7 hrs to fix
myems-api/core/energystoragecontainer.py on lines 282..295

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

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

                $stateProvider
                    .state('fdd', {
                        abstract: true,
                        url: "/fdd",
                        templateUrl: "views/common/content.html",
Severity: Major
Found in myems-admin/app/config.router.js and 3 other locations - About 7 hrs to fix
myems-admin/app/config.router.js on lines 37..199
myems-admin/app/config.router.js on lines 37..243
myems-admin/app/config.router.js on lines 37..287

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

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

        if new_values['points'] is not None and len(new_values['points']) > 0:
            for point in new_values['points']:
                # todo: validate point properties
                add_value = (" INSERT INTO tbl_points (name, data_source_id, object_type, units, "
                             "                         high_limit, low_limit, higher_limit, lower_limit, ratio, "
Severity: Major
Found in myems-api/core/datasource.py and 1 other location - About 7 hrs to fix
myems-api/core/datasource.py on lines 826..844

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

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