Showing 4,754 of 10,533 total issues

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

  const options = {
    scales: {
      x: {
        display: true,
        ticks: {
Severity: Major
Found in myems-web/src/components/MyEMS/Microgrid/StackBarChart.js and 2 other locations - About 6 hrs to fix
myems-web/src/components/MyEMS/EnergyStoragePowerStation/StackBarChart.js on lines 57..88
myems-web/src/components/MyEMS/common/ChartSpacesStackBar.js on lines 78..109

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

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

        if 'point_id' in new_values['data'].keys():
            if new_values['data']['point_id'] is not None and \
                    new_values['data']['point_id'] <= 0:
                raise falcon.HTTPError(status=falcon.HTTP_400, title='API.BAD_REQUEST',
                                       description='API.INVALID_POINT_ID')
Severity: Major
Found in myems-api/core/combinedequipment.py and 9 other locations - About 6 hrs to fix
myems-api/core/combinedequipment.py on lines 955..960
myems-api/core/energyflowdiagram.py on lines 519..524
myems-api/core/energyflowdiagram.py on lines 527..532
myems-api/core/energyflowdiagram.py on lines 819..824
myems-api/core/energyflowdiagram.py on lines 827..832
myems-api/core/energyflowdiagram.py on lines 1439..1444
myems-api/core/energyflowdiagram.py on lines 1447..1452
myems-api/core/equipment.py on lines 798..803
myems-api/core/equipment.py on lines 1166..1171

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

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

            if 'id' in link['source_node'].keys():
                if link['source_node']['id'] is not None and \
                        link['source_node']['id'] <= 0:
                    raise falcon.HTTPError(status=falcon.HTTP_400, title='API.BAD_REQUEST',
                                           description='API.INVALID_SOURCE_NODE_ID')
Severity: Major
Found in myems-api/core/energyflowdiagram.py and 9 other locations - About 6 hrs to fix
myems-api/core/combinedequipment.py on lines 955..960
myems-api/core/combinedequipment.py on lines 1335..1340
myems-api/core/energyflowdiagram.py on lines 519..524
myems-api/core/energyflowdiagram.py on lines 527..532
myems-api/core/energyflowdiagram.py on lines 819..824
myems-api/core/energyflowdiagram.py on lines 827..832
myems-api/core/energyflowdiagram.py on lines 1447..1452
myems-api/core/equipment.py on lines 798..803
myems-api/core/equipment.py on lines 1166..1171

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

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

            if 'id' in link['target_node'].keys():
                if link['target_node']['id'] is not None and \
                        link['target_node']['id'] <= 0:
                    raise falcon.HTTPError(status=falcon.HTTP_400, title='API.BAD_REQUEST',
                                           description='API.INVALID_TARGET_NODE_ID')
Severity: Major
Found in myems-api/core/energyflowdiagram.py and 9 other locations - About 6 hrs to fix
myems-api/core/combinedequipment.py on lines 955..960
myems-api/core/combinedequipment.py on lines 1335..1340
myems-api/core/energyflowdiagram.py on lines 519..524
myems-api/core/energyflowdiagram.py on lines 527..532
myems-api/core/energyflowdiagram.py on lines 819..824
myems-api/core/energyflowdiagram.py on lines 827..832
myems-api/core/energyflowdiagram.py on lines 1439..1444
myems-api/core/equipment.py on lines 798..803
myems-api/core/equipment.py on lines 1166..1171

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

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

        if 'source_node_id' in new_values['data'].keys():
            if new_values['data']['source_node_id'] is not None and \
                    new_values['data']['source_node_id'] <= 0:
                raise falcon.HTTPError(status=falcon.HTTP_400, title='API.BAD_REQUEST',
                                       description='API.INVALID_SOURCE_NODE_ID')
Severity: Major
Found in myems-api/core/energyflowdiagram.py and 9 other locations - About 6 hrs to fix
myems-api/core/combinedequipment.py on lines 955..960
myems-api/core/combinedequipment.py on lines 1335..1340
myems-api/core/energyflowdiagram.py on lines 519..524
myems-api/core/energyflowdiagram.py on lines 527..532
myems-api/core/energyflowdiagram.py on lines 827..832
myems-api/core/energyflowdiagram.py on lines 1439..1444
myems-api/core/energyflowdiagram.py on lines 1447..1452
myems-api/core/equipment.py on lines 798..803
myems-api/core/equipment.py on lines 1166..1171

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

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

        if 'point_id' in new_values['data'].keys():
            if new_values['data']['point_id'] is not None and \
                    new_values['data']['point_id'] <= 0:
                raise falcon.HTTPError(status=falcon.HTTP_400, title='API.BAD_REQUEST',
                                       description='API.INVALID_POINT_ID')
Severity: Major
Found in myems-api/core/combinedequipment.py and 9 other locations - About 6 hrs to fix
myems-api/core/combinedequipment.py on lines 1335..1340
myems-api/core/energyflowdiagram.py on lines 519..524
myems-api/core/energyflowdiagram.py on lines 527..532
myems-api/core/energyflowdiagram.py on lines 819..824
myems-api/core/energyflowdiagram.py on lines 827..832
myems-api/core/energyflowdiagram.py on lines 1439..1444
myems-api/core/energyflowdiagram.py on lines 1447..1452
myems-api/core/equipment.py on lines 798..803
myems-api/core/equipment.py on lines 1166..1171

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

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

        if 'target_node_id' in new_values['data'].keys():
            if new_values['data']['target_node_id'] is not None and \
                    new_values['data']['target_node_id'] <= 0:
                raise falcon.HTTPError(status=falcon.HTTP_400, title='API.BAD_REQUEST',
                                       description='API.INVALID_TARGET_NODE_ID')
Severity: Major
Found in myems-api/core/energyflowdiagram.py and 9 other locations - About 6 hrs to fix
myems-api/core/combinedequipment.py on lines 955..960
myems-api/core/combinedequipment.py on lines 1335..1340
myems-api/core/energyflowdiagram.py on lines 519..524
myems-api/core/energyflowdiagram.py on lines 819..824
myems-api/core/energyflowdiagram.py on lines 827..832
myems-api/core/energyflowdiagram.py on lines 1439..1444
myems-api/core/energyflowdiagram.py on lines 1447..1452
myems-api/core/equipment.py on lines 798..803
myems-api/core/equipment.py on lines 1166..1171

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

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

        if 'target_node_id' in new_values['data'].keys():
            if new_values['data']['target_node_id'] is not None and \
                    new_values['data']['target_node_id'] <= 0:
                raise falcon.HTTPError(status=falcon.HTTP_400, title='API.BAD_REQUEST',
                                       description='API.INVALID_TARGET_NODE_ID')
Severity: Major
Found in myems-api/core/energyflowdiagram.py and 9 other locations - About 6 hrs to fix
myems-api/core/combinedequipment.py on lines 955..960
myems-api/core/combinedequipment.py on lines 1335..1340
myems-api/core/energyflowdiagram.py on lines 519..524
myems-api/core/energyflowdiagram.py on lines 527..532
myems-api/core/energyflowdiagram.py on lines 819..824
myems-api/core/energyflowdiagram.py on lines 1439..1444
myems-api/core/energyflowdiagram.py on lines 1447..1452
myems-api/core/equipment.py on lines 798..803
myems-api/core/equipment.py on lines 1166..1171

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

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

        result = {"id": row[0],
                  "host": row[1],
                  "port": row[2],
                  "requires_authentication": bool(row[3]),
                  "user_name": row[4],
Severity: Major
Found in myems-api/core/emailserver.py and 1 other location - About 6 hrs to fix
myems-api/core/emailserver.py on lines 35..42

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

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

        if 'source_node_id' in new_values['data'].keys():
            if new_values['data']['source_node_id'] is not None and \
                    new_values['data']['source_node_id'] <= 0:
                raise falcon.HTTPError(status=falcon.HTTP_400, title='API.BAD_REQUEST',
                                       description='API.INVALID_SOURCE_NODE_ID')
Severity: Major
Found in myems-api/core/energyflowdiagram.py and 9 other locations - About 6 hrs to fix
myems-api/core/combinedequipment.py on lines 955..960
myems-api/core/combinedequipment.py on lines 1335..1340
myems-api/core/energyflowdiagram.py on lines 527..532
myems-api/core/energyflowdiagram.py on lines 819..824
myems-api/core/energyflowdiagram.py on lines 827..832
myems-api/core/energyflowdiagram.py on lines 1439..1444
myems-api/core/energyflowdiagram.py on lines 1447..1452
myems-api/core/equipment.py on lines 798..803
myems-api/core/equipment.py on lines 1166..1171

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

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

        if 'point_id' in new_values['data'].keys():
            if new_values['data']['point_id'] is not None and \
                    new_values['data']['point_id'] <= 0:
                raise falcon.HTTPError(status=falcon.HTTP_400, title='API.BAD_REQUEST',
                                       description='API.INVALID_POINT_ID')
Severity: Major
Found in myems-api/core/equipment.py and 9 other locations - About 6 hrs to fix
myems-api/core/combinedequipment.py on lines 955..960
myems-api/core/combinedequipment.py on lines 1335..1340
myems-api/core/energyflowdiagram.py on lines 519..524
myems-api/core/energyflowdiagram.py on lines 527..532
myems-api/core/energyflowdiagram.py on lines 819..824
myems-api/core/energyflowdiagram.py on lines 827..832
myems-api/core/energyflowdiagram.py on lines 1439..1444
myems-api/core/energyflowdiagram.py on lines 1447..1452
myems-api/core/equipment.py on lines 1166..1171

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

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

        if 'point_id' in new_values['data'].keys():
            if new_values['data']['point_id'] is not None and \
                    new_values['data']['point_id'] <= 0:
                raise falcon.HTTPError(status=falcon.HTTP_400, title='API.BAD_REQUEST',
                                       description='API.INVALID_POINT_ID')
Severity: Major
Found in myems-api/core/equipment.py and 9 other locations - About 6 hrs to fix
myems-api/core/combinedequipment.py on lines 955..960
myems-api/core/combinedequipment.py on lines 1335..1340
myems-api/core/energyflowdiagram.py on lines 519..524
myems-api/core/energyflowdiagram.py on lines 527..532
myems-api/core/energyflowdiagram.py on lines 819..824
myems-api/core/energyflowdiagram.py on lines 827..832
myems-api/core/energyflowdiagram.py on lines 1439..1444
myems-api/core/energyflowdiagram.py on lines 1447..1452
myems-api/core/equipment.py on lines 798..803

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

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

                meta_result = {"id": row[0],
                               "host": row[1],
                               "port": row[2],
                               "requires_authentication": bool(row[3]),
                               "user_name": row[4],
Severity: Major
Found in myems-api/core/emailserver.py and 1 other location - About 6 hrs to fix
myems-api/core/emailserver.py on lines 173..180

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

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

            $scope.showhide = function () {
                var ibox = $element.closest('div.ibox');
                var icon = $element.find('i:first');
                var content = ibox.find('div.ibox-content');
                content.slideToggle(200);
Severity: Major
Found in myems-admin/app/directives/directives.js and 1 other location - About 6 hrs to fix
myems-admin/app/directives/directives.js on lines 138..150

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

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

            $scope.showhide = function () {
                var ibox = $element.closest('div.ibox');
                var icon = $element.find('i:first');
                var content = ibox.find('div.ibox-content');
                content.slideToggle(200);
Severity: Major
Found in myems-admin/app/directives/directives.js and 1 other location - About 6 hrs to fix
myems-admin/app/directives/directives.js on lines 106..118

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

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

                if is_online:
                    query = (" SELECT run_state_point_id "
                             " FROM tbl_microgrids_power_conversion_systems "
                             " WHERE microgrid_id = %s "
                             " LIMIT 1 ")
Severity: Major
Found in myems-api/reports/microgridlist.py and 8 other locations - About 6 hrs to fix
myems-api/reports/energystoragepowerstationlist.py on lines 122..133
myems-api/reports/energystoragepowerstationlist.py on lines 167..178
myems-api/reports/energystoragepowerstationlist.py on lines 225..236
myems-api/reports/energystoragepowerstationlist.py on lines 240..251
myems-api/reports/microgridlist.py on lines 156..166
myems-api/reports/microgridlist.py on lines 201..210
myems-api/reports/microgridlist.py on lines 214..223
myems-api/reports/microgridlist.py on lines 227..236

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

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

                if is_online:
                    query = (" SELECT power_point_id "
                             " FROM tbl_microgrids_loads "
                             " WHERE microgrid_id = %s "
                             " LIMIT 1 ")
Severity: Major
Found in myems-api/reports/microgridlist.py and 8 other locations - About 6 hrs to fix
myems-api/reports/energystoragepowerstationlist.py on lines 122..133
myems-api/reports/energystoragepowerstationlist.py on lines 167..178
myems-api/reports/energystoragepowerstationlist.py on lines 225..236
myems-api/reports/energystoragepowerstationlist.py on lines 240..251
myems-api/reports/microgridlist.py on lines 118..127
myems-api/reports/microgridlist.py on lines 156..166
myems-api/reports/microgridlist.py on lines 201..210
myems-api/reports/microgridlist.py on lines 214..223

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

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

                if is_online:
                    query = (" SELECT tescl.power_point_id "
                             " FROM tbl_energy_storage_power_stations_containers tespsesc, "
                             "      tbl_energy_storage_containers_loads tescl "
                             " WHERE tespsesc.energy_storage_power_station_id = %s "
Severity: Major
Found in myems-api/reports/energystoragepowerstationlist.py and 8 other locations - About 6 hrs to fix
myems-api/reports/energystoragepowerstationlist.py on lines 122..133
myems-api/reports/energystoragepowerstationlist.py on lines 167..178
myems-api/reports/energystoragepowerstationlist.py on lines 225..236
myems-api/reports/microgridlist.py on lines 118..127
myems-api/reports/microgridlist.py on lines 156..166
myems-api/reports/microgridlist.py on lines 201..210
myems-api/reports/microgridlist.py on lines 214..223
myems-api/reports/microgridlist.py on lines 227..236

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

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

                if is_online:
                    query = (" SELECT power_point_id "
                             " FROM tbl_microgrids_photovoltaics "
                             " WHERE microgrid_id = %s "
                             " LIMIT 1 ")
Severity: Major
Found in myems-api/reports/microgridlist.py and 8 other locations - About 6 hrs to fix
myems-api/reports/energystoragepowerstationlist.py on lines 122..133
myems-api/reports/energystoragepowerstationlist.py on lines 167..178
myems-api/reports/energystoragepowerstationlist.py on lines 225..236
myems-api/reports/energystoragepowerstationlist.py on lines 240..251
myems-api/reports/microgridlist.py on lines 118..127
myems-api/reports/microgridlist.py on lines 156..166
myems-api/reports/microgridlist.py on lines 214..223
myems-api/reports/microgridlist.py on lines 227..236

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

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

                if is_online:
                    query = (" SELECT power_point_id "
                             " FROM tbl_microgrids_grids "
                             " WHERE microgrid_id = %s "
                             " LIMIT 1 ")
Severity: Major
Found in myems-api/reports/microgridlist.py and 8 other locations - About 6 hrs to fix
myems-api/reports/energystoragepowerstationlist.py on lines 122..133
myems-api/reports/energystoragepowerstationlist.py on lines 167..178
myems-api/reports/energystoragepowerstationlist.py on lines 225..236
myems-api/reports/energystoragepowerstationlist.py on lines 240..251
myems-api/reports/microgridlist.py on lines 118..127
myems-api/reports/microgridlist.py on lines 156..166
myems-api/reports/microgridlist.py on lines 201..210
myems-api/reports/microgridlist.py on lines 227..236

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

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