Showing 4,751 of 10,525 total issues

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

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

Severity: Major
Found in myems-api/core/space.py and 23 other locations - About 1 wk to fix
myems-api/core/combinedequipment.py on lines 2098..2210
myems-api/core/equipment.py on lines 1914..2028
myems-api/core/meter.py on lines 1142..1254
myems-api/core/shopfloor.py on lines 458..570
myems-api/core/shopfloor.py on lines 1199..1311
myems-api/core/shopfloor.py on lines 1563..1675
myems-api/core/shopfloor.py on lines 1739..1851
myems-api/core/space.py on lines 817..929
myems-api/core/space.py on lines 993..1105
myems-api/core/space.py on lines 1534..1646
myems-api/core/space.py on lines 2087..2199
myems-api/core/space.py on lines 2262..2374
myems-api/core/space.py on lines 2437..2549
myems-api/core/space.py on lines 2612..2724
myems-api/core/space.py on lines 3161..3273
myems-api/core/space.py on lines 3337..3449
myems-api/core/store.py on lines 1142..1254
myems-api/core/store.py on lines 1506..1618
myems-api/core/store.py on lines 1682..1794
myems-api/core/tenant.py on lines 1246..1360
myems-api/core/tenant.py on lines 1614..1728
myems-api/core/tenant.py on lines 1792..1906
myems-api/core/virtualpowerplant.py on lines 435..547

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

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

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

Severity: Major
Found in myems-api/core/equipment.py and 23 other locations - About 1 wk to fix
myems-api/core/combinedequipment.py on lines 2098..2210
myems-api/core/meter.py on lines 1142..1254
myems-api/core/shopfloor.py on lines 458..570
myems-api/core/shopfloor.py on lines 1199..1311
myems-api/core/shopfloor.py on lines 1563..1675
myems-api/core/shopfloor.py on lines 1739..1851
myems-api/core/space.py on lines 817..929
myems-api/core/space.py on lines 993..1105
myems-api/core/space.py on lines 1169..1281
myems-api/core/space.py on lines 1534..1646
myems-api/core/space.py on lines 2087..2199
myems-api/core/space.py on lines 2262..2374
myems-api/core/space.py on lines 2437..2549
myems-api/core/space.py on lines 2612..2724
myems-api/core/space.py on lines 3161..3273
myems-api/core/space.py on lines 3337..3449
myems-api/core/store.py on lines 1142..1254
myems-api/core/store.py on lines 1506..1618
myems-api/core/store.py on lines 1682..1794
myems-api/core/tenant.py on lines 1246..1360
myems-api/core/tenant.py on lines 1614..1728
myems-api/core/tenant.py on lines 1792..1906
myems-api/core/virtualpowerplant.py on lines 435..547

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

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

app.controller('SensorPointController', function (
    $scope,
    $window,
    $timeout,
    $translate,
myems-admin/app/controllers/settings/meter/meterpoint.controller.js on lines 3..135

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

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

app.controller('MeterPointController', function (
    $scope,
    $window,
    $timeout, 
    $translate,
myems-admin/app/controllers/settings/sensor/sensorpoint.controller.js on lines 3..139

Duplicated Code

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

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

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

Tuning

This issue has a mass of 1422.

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 "associated_equipment" not in report.keys() or \
            "energy_category_names" not in report['associated_equipment'].keys() or \
            len(report['associated_equipment']["energy_category_names"]) == 0 \
            or 'associated_equipment_names_array' not in report['associated_equipment'].keys() \
            or report['associated_equipment']['associated_equipment_names_array'] is None \
Severity: Major
Found in myems-api/excelexporters/combinedequipmentstatistics.py and 1 other location - About 1 wk to fix
myems-api/excelexporters/combinedequipmentenergycategory.py on lines 808..856

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

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 "associated_equipment" not in report.keys() or \
            "energy_category_names" not in report['associated_equipment'].keys() or \
            len(report['associated_equipment']["energy_category_names"]) == 0 \
            or 'associated_equipment_names_array' not in report['associated_equipment'].keys() \
            or report['associated_equipment']['associated_equipment_names_array'] is None \
Severity: Major
Found in myems-api/excelexporters/combinedequipmentenergycategory.py and 1 other location - About 1 wk to fix
myems-api/excelexporters/combinedequipmentstatistics.py on lines 624..671

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

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

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

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

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

Refactorings

Further Reading

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

app.controller('StorePointController', function (
    $window,
    $scope, 
    $translate, 
    StoreService, 
myems-admin/app/controllers/settings/shopfloor/shopfloorpoint.controller.js on lines 3..133
myems-admin/app/controllers/settings/tenant/tenantpoint.controller.js on lines 3..133

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

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

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

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

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

Refactorings

Further Reading

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

app.controller('ShopfloorPointController', function (
    $scope, 
    $window,
    $translate, 
    ShopfloorService, 
myems-admin/app/controllers/settings/store/storepoint.controller.js on lines 3..133
myems-admin/app/controllers/settings/tenant/tenantpoint.controller.js on lines 3..133

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

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

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

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

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

Refactorings

Further Reading

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

app.controller('TenantPointController', function (
    $scope, 
    $window,
    $translate, 
    TenantService, 
myems-admin/app/controllers/settings/shopfloor/shopfloorpoint.controller.js on lines 3..133
myems-admin/app/controllers/settings/store/storepoint.controller.js on lines 3..133

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

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

    if "subtotals_in_kgce" not in reporting_period_data.keys() or \
            reporting_period_data['subtotals_in_kgce'] is None or \
            len(reporting_period_data['subtotals_in_kgce']) == 0:
        pass
    else:
Severity: Major
Found in myems-api/excelexporters/tenantenergycategory.py and 5 other locations - About 1 wk to fix
myems-api/excelexporters/shopfloorenergycategory.py on lines 397..458
myems-api/excelexporters/shopfloorenergycategory.py on lines 466..526
myems-api/excelexporters/spaceenergycategory.py on lines 378..439
myems-api/excelexporters/spaceenergycategory.py on lines 442..502
myems-api/excelexporters/tenantenergycategory.py on lines 440..500

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

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

    if "subtotals_in_kgce" not in reporting_period_data.keys() or \
            reporting_period_data['subtotals_in_kgce'] is None or \
            len(reporting_period_data['subtotals_in_kgce']) == 0:
        pass
    else:
Severity: Major
Found in myems-api/excelexporters/spaceenergycategory.py and 5 other locations - About 1 wk to fix
myems-api/excelexporters/shopfloorenergycategory.py on lines 397..458
myems-api/excelexporters/shopfloorenergycategory.py on lines 466..526
myems-api/excelexporters/spaceenergycategory.py on lines 442..502
myems-api/excelexporters/tenantenergycategory.py on lines 376..437
myems-api/excelexporters/tenantenergycategory.py on lines 440..500

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

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

    if "subtotals_in_kgco2e" not in reporting_period_data.keys() or \
            reporting_period_data['subtotals_in_kgco2e'] is None or \
            len(reporting_period_data['subtotals_in_kgco2e']) == 0:
        pass
    else:
Severity: Major
Found in myems-api/excelexporters/spaceenergycategory.py and 5 other locations - About 1 wk to fix
myems-api/excelexporters/shopfloorenergycategory.py on lines 397..458
myems-api/excelexporters/shopfloorenergycategory.py on lines 466..526
myems-api/excelexporters/spaceenergycategory.py on lines 378..439
myems-api/excelexporters/tenantenergycategory.py on lines 376..437
myems-api/excelexporters/tenantenergycategory.py on lines 440..500

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

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

    if "subtotals_in_kgco2e" not in reporting_period_data.keys() or \
            reporting_period_data['subtotals_in_kgco2e'] is None or \
            len(reporting_period_data['subtotals_in_kgco2e']) == 0:
        pass
    else:
Severity: Major
Found in myems-api/excelexporters/shopfloorenergycategory.py and 5 other locations - About 1 wk to fix
myems-api/excelexporters/shopfloorenergycategory.py on lines 397..458
myems-api/excelexporters/spaceenergycategory.py on lines 378..439
myems-api/excelexporters/spaceenergycategory.py on lines 442..502
myems-api/excelexporters/tenantenergycategory.py on lines 376..437
myems-api/excelexporters/tenantenergycategory.py on lines 440..500

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

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

    if "subtotals_in_kgco2e" not in reporting_period_data.keys() or \
            reporting_period_data['subtotals_in_kgco2e'] is None or \
            len(reporting_period_data['subtotals_in_kgco2e']) == 0:
        pass
    else:
Severity: Major
Found in myems-api/excelexporters/tenantenergycategory.py and 5 other locations - About 1 wk to fix
myems-api/excelexporters/shopfloorenergycategory.py on lines 397..458
myems-api/excelexporters/shopfloorenergycategory.py on lines 466..526
myems-api/excelexporters/spaceenergycategory.py on lines 378..439
myems-api/excelexporters/spaceenergycategory.py on lines 442..502
myems-api/excelexporters/tenantenergycategory.py on lines 376..437

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

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

    if "subtotals_in_kgce" not in reporting_period_data.keys() or \
            reporting_period_data['subtotals_in_kgce'] is None or \
            len(reporting_period_data['subtotals_in_kgce']) == 0:
        pass
    else:
Severity: Major
Found in myems-api/excelexporters/shopfloorenergycategory.py and 5 other locations - About 1 wk to fix
myems-api/excelexporters/shopfloorenergycategory.py on lines 466..526
myems-api/excelexporters/spaceenergycategory.py on lines 378..439
myems-api/excelexporters/spaceenergycategory.py on lines 442..502
myems-api/excelexporters/tenantenergycategory.py on lines 376..437
myems-api/excelexporters/tenantenergycategory.py on lines 440..500

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

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

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

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

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

Refactorings

Further Reading

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

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

Severity: Major
Found in myems-api/core/energystoragepowerstation.py and 1 other location - About 1 wk to fix
myems-api/core/microgrid.py on lines 4782..4889

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

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

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

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

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

Refactorings

Further Reading

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

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

Severity: Major
Found in myems-api/core/microgrid.py and 1 other location - About 1 wk to fix
myems-api/core/energystoragepowerstation.py on lines 591..702

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

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

app.controller('EmailServerController', function($scope,
    $rootScope,
    $window,
    $translate,
    $uibModal,
myems-admin/app/controllers/settings/contact/contact.controller.js on lines 3..143

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

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

app.controller('ContactController', function(
    $scope,
    $rootScope,
    $window,
    $translate,
myems-admin/app/controllers/settings/emailserver/emailserver.controller.js on lines 3..141

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

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

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

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

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

Refactorings

Further Reading

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

def get_energy_category_tariffs(cost_center_id, energy_category_id, start_datetime_utc, end_datetime_utc):
    # todo: validate parameters
    if cost_center_id is None:
        return dict()

Severity: Major
Found in myems-api/core/utilities.py and 1 other location - About 1 wk to fix
myems-api/core/utilities.py on lines 253..350

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

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