Showing 4,753 of 10,532 total issues

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

        if energy_category_set is not None and len(energy_category_set) > 0:
            for energy_category_id in energy_category_set:
                associated_equipment_data[energy_category_id] = dict()
                associated_equipment_data[energy_category_id]['associated_equipment_names'] = list()
                associated_equipment_data[energy_category_id]['subtotals'] = list()
Severity: Major
Found in myems-api/reports/combinedequipmentincome.py and 11 other locations - About 1 day to fix
myems-api/reports/combinedequipmentcarbon.py on lines 530..552
myems-api/reports/combinedequipmentcost.py on lines 520..542
myems-api/reports/combinedequipmentefficiency.py on lines 773..795
myems-api/reports/combinedequipmentenergyitem.py on lines 523..545
myems-api/reports/combinedequipmentoutput.py on lines 500..523
myems-api/reports/combinedequipmentstatistics.py on lines 526..548
myems-api/reports/spacecarbon.py on lines 526..547
myems-api/reports/spacecost.py on lines 526..547
myems-api/reports/spaceenergyitem.py on lines 531..553
myems-api/reports/spaceincome.py on lines 507..528
myems-api/reports/spaceoutput.py on lines 507..528

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

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

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

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

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

Refactorings

Further Reading

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

        if energy_category_set is not None and len(energy_category_set) > 0:
            for energy_category_id in energy_category_set:
                child_space_data[energy_category_id] = dict()
                child_space_data[energy_category_id]['child_space_names'] = list()
                child_space_data[energy_category_id]['subtotals'] = list()
Severity: Major
Found in myems-api/reports/spacecost.py and 11 other locations - About 1 day to fix
myems-api/reports/combinedequipmentcarbon.py on lines 530..552
myems-api/reports/combinedequipmentcost.py on lines 520..542
myems-api/reports/combinedequipmentefficiency.py on lines 773..795
myems-api/reports/combinedequipmentenergyitem.py on lines 523..545
myems-api/reports/combinedequipmentincome.py on lines 500..522
myems-api/reports/combinedequipmentoutput.py on lines 500..523
myems-api/reports/combinedequipmentstatistics.py on lines 526..548
myems-api/reports/spacecarbon.py on lines 526..547
myems-api/reports/spaceenergyitem.py on lines 531..553
myems-api/reports/spaceincome.py on lines 507..528
myems-api/reports/spaceoutput.py on lines 507..528

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

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

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

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

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

Refactorings

Further Reading

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

        if energy_item_set is not None and len(energy_item_set) > 0:
            for energy_item_id in energy_item_set:
                associated_equipment_data[energy_item_id] = dict()
                associated_equipment_data[energy_item_id]['associated_equipment_names'] = list()
                associated_equipment_data[energy_item_id]['subtotals'] = list()
Severity: Major
Found in myems-api/reports/combinedequipmentenergyitem.py and 11 other locations - About 1 day to fix
myems-api/reports/combinedequipmentcarbon.py on lines 530..552
myems-api/reports/combinedequipmentcost.py on lines 520..542
myems-api/reports/combinedequipmentefficiency.py on lines 773..795
myems-api/reports/combinedequipmentincome.py on lines 500..522
myems-api/reports/combinedequipmentoutput.py on lines 500..523
myems-api/reports/combinedequipmentstatistics.py on lines 526..548
myems-api/reports/spacecarbon.py on lines 526..547
myems-api/reports/spacecost.py on lines 526..547
myems-api/reports/spaceenergyitem.py on lines 531..553
myems-api/reports/spaceincome.py on lines 507..528
myems-api/reports/spaceoutput.py on lines 507..528

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

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 rows_spaces is not None and len(rows_spaces) > 0:
                for row in rows_spaces:
                    children_result = {"id": row[0],
                                       "name": row[1],
                                       "uuid": row[2],
Severity: Major
Found in myems-api/core/space.py and 1 other location - About 1 day to fix
myems-api/core/space.py on lines 4624..4640

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

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

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

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

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

Refactorings

Further Reading

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

        if energy_category_set is not None and len(energy_category_set) > 0:
            for energy_category_id in energy_category_set:
                associated_equipment_data[energy_category_id] = dict()
                associated_equipment_data[energy_category_id]['associated_equipment_names'] = list()
                associated_equipment_data[energy_category_id]['subtotals'] = list()
Severity: Major
Found in myems-api/reports/combinedequipmentefficiency.py and 11 other locations - About 1 day to fix
myems-api/reports/combinedequipmentcarbon.py on lines 530..552
myems-api/reports/combinedequipmentcost.py on lines 520..542
myems-api/reports/combinedequipmentenergyitem.py on lines 523..545
myems-api/reports/combinedequipmentincome.py on lines 500..522
myems-api/reports/combinedequipmentoutput.py on lines 500..523
myems-api/reports/combinedequipmentstatistics.py on lines 526..548
myems-api/reports/spacecarbon.py on lines 526..547
myems-api/reports/spacecost.py on lines 526..547
myems-api/reports/spaceenergyitem.py on lines 531..553
myems-api/reports/spaceincome.py on lines 507..528
myems-api/reports/spaceoutput.py on lines 507..528

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

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

    @staticmethod
    @user_logger
    def on_delete(req, resp, id_):
        admin_control(req)
        if not id_.isdigit() or int(id_) <= 0:
Severity: Major
Found in myems-api/core/wechatmessage.py and 3 other locations - About 1 day to fix
myems-api/core/emailmessage.py on lines 457..489
myems-api/core/textmessage.py on lines 426..456
myems-api/core/user.py on lines 1519..1551

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

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

    @staticmethod
    @user_logger
    def on_delete(req, resp, id_):
        admin_control(req)
        if not id_.isdigit() or int(id_) <= 0:
Severity: Major
Found in myems-api/core/textmessage.py and 3 other locations - About 1 day to fix
myems-api/core/emailmessage.py on lines 457..489
myems-api/core/user.py on lines 1519..1551
myems-api/core/wechatmessage.py on lines 475..507

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

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

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

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

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

Refactorings

Further Reading

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

        if energy_category_set is not None and len(energy_category_set) > 0:
            for energy_category_id in energy_category_set:
                associated_equipment_data[energy_category_id] = dict()
                associated_equipment_data[energy_category_id]['associated_equipment_names'] = list()
                associated_equipment_data[energy_category_id]['subtotals'] = list()
Severity: Major
Found in myems-api/reports/combinedequipmentoutput.py and 11 other locations - About 1 day to fix
myems-api/reports/combinedequipmentcarbon.py on lines 530..552
myems-api/reports/combinedequipmentcost.py on lines 520..542
myems-api/reports/combinedequipmentefficiency.py on lines 773..795
myems-api/reports/combinedequipmentenergyitem.py on lines 523..545
myems-api/reports/combinedequipmentincome.py on lines 500..522
myems-api/reports/combinedequipmentstatistics.py on lines 526..548
myems-api/reports/spacecarbon.py on lines 526..547
myems-api/reports/spacecost.py on lines 526..547
myems-api/reports/spaceenergyitem.py on lines 531..553
myems-api/reports/spaceincome.py on lines 507..528
myems-api/reports/spaceoutput.py on lines 507..528

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

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

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

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

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

Refactorings

Further Reading

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

        if energy_item_set is not None and len(energy_item_set) > 0:
            for energy_item_id in energy_item_set:
                child_space_data[energy_item_id] = dict()
                child_space_data[energy_item_id]['child_space_names'] = list()
                child_space_data[energy_item_id]['subtotals'] = list()
Severity: Major
Found in myems-api/reports/spaceenergyitem.py and 11 other locations - About 1 day to fix
myems-api/reports/combinedequipmentcarbon.py on lines 530..552
myems-api/reports/combinedequipmentcost.py on lines 520..542
myems-api/reports/combinedequipmentefficiency.py on lines 773..795
myems-api/reports/combinedequipmentenergyitem.py on lines 523..545
myems-api/reports/combinedequipmentincome.py on lines 500..522
myems-api/reports/combinedequipmentoutput.py on lines 500..523
myems-api/reports/combinedequipmentstatistics.py on lines 526..548
myems-api/reports/spacecarbon.py on lines 526..547
myems-api/reports/spacecost.py on lines 526..547
myems-api/reports/spaceincome.py on lines 507..528
myems-api/reports/spaceoutput.py on lines 507..528

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

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

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

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

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

Refactorings

Further Reading

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

        if energy_category_set is not None and len(energy_category_set) > 0:
            for energy_category_id in energy_category_set:
                associated_equipment_data[energy_category_id] = dict()
                associated_equipment_data[energy_category_id]['associated_equipment_names'] = list()
                associated_equipment_data[energy_category_id]['subtotals'] = list()
Severity: Major
Found in myems-api/reports/combinedequipmentstatistics.py and 11 other locations - About 1 day to fix
myems-api/reports/combinedequipmentcarbon.py on lines 530..552
myems-api/reports/combinedequipmentcost.py on lines 520..542
myems-api/reports/combinedequipmentefficiency.py on lines 773..795
myems-api/reports/combinedequipmentenergyitem.py on lines 523..545
myems-api/reports/combinedequipmentincome.py on lines 500..522
myems-api/reports/combinedequipmentoutput.py on lines 500..523
myems-api/reports/spacecarbon.py on lines 526..547
myems-api/reports/spacecost.py on lines 526..547
myems-api/reports/spaceenergyitem.py on lines 531..553
myems-api/reports/spaceincome.py on lines 507..528
myems-api/reports/spaceoutput.py on lines 507..528

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

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 rows_spaces is not None and len(rows_spaces) > 0:
                for row in rows_spaces:
                    children_result = {"id": row[0],
                                       "name": row[1],
                                       "uuid": row[2],
Severity: Major
Found in myems-api/core/space.py and 1 other location - About 1 day to fix
myems-api/core/space.py on lines 3712..3728

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

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

    @staticmethod
    @user_logger
    def on_delete(req, resp, id_):
        admin_control(req)
        if not id_.isdigit() or int(id_) <= 0:
Severity: Major
Found in myems-api/core/emailmessage.py and 3 other locations - About 1 day to fix
myems-api/core/textmessage.py on lines 426..456
myems-api/core/user.py on lines 1519..1551
myems-api/core/wechatmessage.py on lines 475..507

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

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

    @staticmethod
    @user_logger
    def on_delete(req, resp, id_):
        admin_control(req)
        if not id_.isdigit() or int(id_) <= 0:
Severity: Major
Found in myems-api/core/user.py and 3 other locations - About 1 day to fix
myems-api/core/emailmessage.py on lines 457..489
myems-api/core/textmessage.py on lines 426..456
myems-api/core/wechatmessage.py on lines 475..507

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

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.factory('KnowledgeFileService', function ($http) {
    return {
        getAllKnowledgeFiles: function (headers, callback) {
            $http.get(getAPI() + 'knowledgefiles', {headers})
            .then(function (response) {
myems-admin/app/services/settings/costcenter/costfile.service.js on lines 2..37

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

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.factory('CostFileService', function($http) {
    return {
        getAllCostFiles:function(headers, callback){
            $http.get(getAPI()+'costfiles', {headers})
            .then(function (response) {
myems-admin/app/services/settings/knowledgefile/knowledgefile.service.js on lines 2..40

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

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

    $scope.importEnergyStoragePowerStation = function() {
        var modalInstance = $uibModal.open({
            templateUrl: 'views/common/import.html',
            controller: 'ModalImportCtrl',
            windowClass: "animated fadeIn",
myems-admin/app/controllers/settings/datasource/datasource.controller.js on lines 226..262
myems-admin/app/controllers/settings/meter/meter.controller.js on lines 337..373
myems-admin/app/controllers/settings/meter/virtualmeter.controller.js on lines 280..316
myems-admin/app/controllers/settings/space/space.controller.js on lines 331..367
myems-admin/app/controllers/settings/tenant/tenant.controller.js on lines 259..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 338.

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

    $scope.importMeter = function() {
        var modalInstance = $uibModal.open({
            templateUrl: 'views/common/import.html',
            controller: 'ModalImportCtrl',
            windowClass: "animated fadeIn",
myems-admin/app/controllers/settings/datasource/datasource.controller.js on lines 226..262
myems-admin/app/controllers/settings/energystoragepowerstation/energystoragepowerstation.controller.js on lines 252..288
myems-admin/app/controllers/settings/meter/virtualmeter.controller.js on lines 280..316
myems-admin/app/controllers/settings/space/space.controller.js on lines 331..367
myems-admin/app/controllers/settings/tenant/tenant.controller.js on lines 259..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 338.

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

    $scope.importTenant = function() {
        var modalInstance = $uibModal.open({
            templateUrl: 'views/common/import.html',
            controller: 'ModalImportCtrl',
            windowClass: "animated fadeIn",
myems-admin/app/controllers/settings/datasource/datasource.controller.js on lines 226..262
myems-admin/app/controllers/settings/energystoragepowerstation/energystoragepowerstation.controller.js on lines 252..288
myems-admin/app/controllers/settings/meter/meter.controller.js on lines 337..373
myems-admin/app/controllers/settings/meter/virtualmeter.controller.js on lines 280..316
myems-admin/app/controllers/settings/space/space.controller.js on lines 331..367

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

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

    $scope.importSpace = function() {
        var modalInstance = $uibModal.open({
            templateUrl: 'views/common/import.html',
            controller: 'ModalImportCtrl',
            windowClass: "animated fadeIn",
myems-admin/app/controllers/settings/datasource/datasource.controller.js on lines 226..262
myems-admin/app/controllers/settings/energystoragepowerstation/energystoragepowerstation.controller.js on lines 252..288
myems-admin/app/controllers/settings/meter/meter.controller.js on lines 337..373
myems-admin/app/controllers/settings/meter/virtualmeter.controller.js on lines 280..316
myems-admin/app/controllers/settings/tenant/tenant.controller.js on lines 259..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 338.

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

    $scope.importVirtualMeter = function() {
        var modalInstance = $uibModal.open({
            templateUrl: 'views/common/import.html',
            controller: 'ModalImportCtrl',
            windowClass: "animated fadeIn",
myems-admin/app/controllers/settings/datasource/datasource.controller.js on lines 226..262
myems-admin/app/controllers/settings/energystoragepowerstation/energystoragepowerstation.controller.js on lines 252..288
myems-admin/app/controllers/settings/meter/meter.controller.js on lines 337..373
myems-admin/app/controllers/settings/space/space.controller.js on lines 331..367
myems-admin/app/controllers/settings/tenant/tenant.controller.js on lines 259..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 338.

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