Showing 4,754 of 10,533 total issues

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

app.controller('ModalEditShopfloorCtrl', function ($scope, $uibModalInstance, params) {
    $scope.operation = "SHOPFLOOR.EDIT_SHOPFLOOR";
    $scope.shopfloor = params.shopfloor;
    $scope.costcenters = params.costcenters;
    $scope.contacts = params.contacts;
myems-admin/app/controllers/settings/energyflowdiagram/energyflowdiagramlink.controller.js on lines 304..316
myems-admin/app/controllers/settings/energystoragecontainer/energystoragecontainer.controller.js on lines 199..212
myems-admin/app/controllers/settings/energystoragecontainer/energystoragecontainerbattery.controller.js on lines 462..474
myems-admin/app/controllers/settings/energystoragecontainer/energystoragecontainergrid.controller.js on lines 387..399
myems-admin/app/controllers/settings/energystoragecontainer/energystoragecontainerload.controller.js on lines 379..391
myems-admin/app/controllers/settings/energystoragecontainer/energystoragecontainerpowerconversionsystem.controller.js on lines 684..697
myems-admin/app/controllers/settings/microgrid/microgridbattery.controller.js on lines 229..241
myems-admin/app/controllers/settings/microgrid/microgridevcharger.controller.js on lines 221..233
myems-admin/app/controllers/settings/microgrid/microgridgenerator.controller.js on lines 221..233
myems-admin/app/controllers/settings/microgrid/microgridgrid.controller.js on lines 224..236
myems-admin/app/controllers/settings/microgrid/microgridheatpump.controller.js on lines 226..238
myems-admin/app/controllers/settings/microgrid/microgridload.controller.js on lines 221..233
myems-admin/app/controllers/settings/microgrid/microgridphotovoltaic.controller.js on lines 222..234
myems-admin/app/controllers/settings/microgrid/microgridpowerconversionsystem.controller.js on lines 232..245
myems-admin/app/controllers/settings/photovoltaicpowerstation/photovoltaicpowerstation.controller.js on lines 290..303
myems-admin/app/controllers/settings/store/store.controller.js on lines 297..310
myems-admin/app/controllers/settings/virtualpowerplant/virtualpowerplant.controller.js on lines 290..304
myems-admin/app/controllers/settings/windfarm/windfarm.controller.js on lines 290..303

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

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

  app.controller('ModalAddEnergyStorageContainerPowerconversionsystemCtrl', function($scope, $uibModalInstance, params) {

      $scope.operation = "ENERGY_STORAGE_CONTAINER.ADD_ENERGY_STORAGE_CONTAINER_POWER_CONVERSION_SYSTEM";
    $scope.points=params.points;
    $scope.meters=params.meters;
myems-admin/app/controllers/settings/energyflowdiagram/energyflowdiagramlink.controller.js on lines 304..316
myems-admin/app/controllers/settings/energystoragecontainer/energystoragecontainer.controller.js on lines 199..212
myems-admin/app/controllers/settings/energystoragecontainer/energystoragecontainerbattery.controller.js on lines 462..474
myems-admin/app/controllers/settings/energystoragecontainer/energystoragecontainergrid.controller.js on lines 387..399
myems-admin/app/controllers/settings/energystoragecontainer/energystoragecontainerload.controller.js on lines 379..391
myems-admin/app/controllers/settings/microgrid/microgridbattery.controller.js on lines 229..241
myems-admin/app/controllers/settings/microgrid/microgridevcharger.controller.js on lines 221..233
myems-admin/app/controllers/settings/microgrid/microgridgenerator.controller.js on lines 221..233
myems-admin/app/controllers/settings/microgrid/microgridgrid.controller.js on lines 224..236
myems-admin/app/controllers/settings/microgrid/microgridheatpump.controller.js on lines 226..238
myems-admin/app/controllers/settings/microgrid/microgridload.controller.js on lines 221..233
myems-admin/app/controllers/settings/microgrid/microgridphotovoltaic.controller.js on lines 222..234
myems-admin/app/controllers/settings/microgrid/microgridpowerconversionsystem.controller.js on lines 232..245
myems-admin/app/controllers/settings/photovoltaicpowerstation/photovoltaicpowerstation.controller.js on lines 290..303
myems-admin/app/controllers/settings/shopfloor/shopfloor.controller.js on lines 295..308
myems-admin/app/controllers/settings/store/store.controller.js on lines 297..310
myems-admin/app/controllers/settings/virtualpowerplant/virtualpowerplant.controller.js on lines 290..304
myems-admin/app/controllers/settings/windfarm/windfarm.controller.js on lines 290..303

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

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

  app.controller('ModalEditMicrogridBatteryCtrl', function($scope, $uibModalInstance, params) {
      $scope.operation = "MICROGRID.EDIT_MICROGRID_BATTERY";
      $scope.microgridbattery = params.microgridbattery;
    $scope.points=params.points;
    $scope.meters=params.meters;
myems-admin/app/controllers/settings/energyflowdiagram/energyflowdiagramlink.controller.js on lines 304..316
myems-admin/app/controllers/settings/energystoragecontainer/energystoragecontainer.controller.js on lines 199..212
myems-admin/app/controllers/settings/energystoragecontainer/energystoragecontainerbattery.controller.js on lines 462..474
myems-admin/app/controllers/settings/energystoragecontainer/energystoragecontainergrid.controller.js on lines 387..399
myems-admin/app/controllers/settings/energystoragecontainer/energystoragecontainerload.controller.js on lines 379..391
myems-admin/app/controllers/settings/energystoragecontainer/energystoragecontainerpowerconversionsystem.controller.js on lines 684..697
myems-admin/app/controllers/settings/microgrid/microgridevcharger.controller.js on lines 221..233
myems-admin/app/controllers/settings/microgrid/microgridgenerator.controller.js on lines 221..233
myems-admin/app/controllers/settings/microgrid/microgridgrid.controller.js on lines 224..236
myems-admin/app/controllers/settings/microgrid/microgridheatpump.controller.js on lines 226..238
myems-admin/app/controllers/settings/microgrid/microgridload.controller.js on lines 221..233
myems-admin/app/controllers/settings/microgrid/microgridphotovoltaic.controller.js on lines 222..234
myems-admin/app/controllers/settings/microgrid/microgridpowerconversionsystem.controller.js on lines 232..245
myems-admin/app/controllers/settings/photovoltaicpowerstation/photovoltaicpowerstation.controller.js on lines 290..303
myems-admin/app/controllers/settings/shopfloor/shopfloor.controller.js on lines 295..308
myems-admin/app/controllers/settings/store/store.controller.js on lines 297..310
myems-admin/app/controllers/settings/virtualpowerplant/virtualpowerplant.controller.js on lines 290..304
myems-admin/app/controllers/settings/windfarm/windfarm.controller.js on lines 290..303

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

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

  const dateRangePickerLocale = {
    sunday: t('sunday'),
    monday: t('monday'),
    tuesday: t('tuesday'),
    wednesday: t('wednesday'),
Severity: Major
Found in myems-web/src/components/MyEMS/Space/EnterProduction.js and 1 other location - About 4 hrs to fix
myems-web/src/components/MyEMS/Meter/OfflineMeterInput.js on lines 174..189

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

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

  const dateRangePickerLocale = {
    sunday: t('sunday'),
    monday: t('monday'),
    tuesday: t('tuesday'),
    wednesday: t('wednesday'),
Severity: Major
Found in myems-web/src/components/MyEMS/Meter/OfflineMeterInput.js and 1 other location - About 4 hrs to fix
myems-web/src/components/MyEMS/Space/EnterProduction.js on lines 132..147

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

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

      this.callClick = function(a) {
        a = b.getCheckValue(a);
        var d = "checked" == a ? !0 : !1;
        angular.isDefined(c.events) && c.events.click
          ? c.events.click({ checked: d, checkState: a })
Severity: Major
Found in myems-admin/js/jcui/angular.integralui.checkbox.min.js and 2 other locations - About 4 hrs to fix
myems-admin/js/jcui/angular.integralui.checkbox.min.js on lines 120..126
myems-admin/js/jcui/angular.integralui.checkbox.min.js on lines 134..140

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

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

      this.callCheckStateChanged = function(a) {
        a = b.getCheckValue(a);
        var d = "checked" == a ? !0 : !1;
        angular.isDefined(c.events) && c.events.checkstateChanged
          ? c.events.checkstateChanged({ checked: d, checkState: a })
Severity: Major
Found in myems-admin/js/jcui/angular.integralui.checkbox.min.js and 2 other locations - About 4 hrs to fix
myems-admin/js/jcui/angular.integralui.checkbox.min.js on lines 120..126
myems-admin/js/jcui/angular.integralui.checkbox.min.js on lines 141..147

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

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

      this.callCheckedChanged = function(a) {
        a = b.getCheckValue(a);
        var d = "checked" == a ? !0 : !1;
        angular.isDefined(c.events) && c.events.checkedChanged
          ? c.events.checkedChanged({ checked: d, checkState: a })
Severity: Major
Found in myems-admin/js/jcui/angular.integralui.checkbox.min.js and 2 other locations - About 4 hrs to fix
myems-admin/js/jcui/angular.integralui.checkbox.min.js on lines 134..140
myems-admin/js/jcui/angular.integralui.checkbox.min.js on lines 141..147

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

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

          c = f.isString(c)
            ? c
            : c
            ? {
                disabled: f.isFieldAvailable(
Severity: Major
Found in myems-admin/js/jcui/angular.integralui.treeview.min.js and 1 other location - About 4 hrs to fix
myems-admin/js/jcui/angular.integralui.treeview.min.js on lines 2604..2629

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

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

          k = f.isString(k)
            ? k
            : k
            ? {
                disabled: f.isFieldAvailable(
Severity: Major
Found in myems-admin/js/jcui/angular.integralui.treeview.min.js and 1 other location - About 4 hrs to fix
myems-admin/js/jcui/angular.integralui.treeview.min.js on lines 2578..2600

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

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

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

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

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

Refactorings

Further Reading

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

                if (cssFiles.length > 0) {
                    var cssDeferred = $q.defer();
                    $delegate.cssLoader(cssFiles, function (err) {
                        if (angular.isDefined(err) && $delegate.cssLoader.hasOwnProperty('ocLazyLoadLoader')) {
                            $delegate._$log.error(err);
Severity: Major
Found in myems-admin/js/plugins/oclazyload/ocLazyLoad.js and 1 other location - About 4 hrs to fix
myems-admin/js/plugins/oclazyload/ocLazyLoad.js on lines 1039..1050

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

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

      this.callCheckedChanging = function(a) {
        a = b.getCheckValue(a);
        var d = "checked" == a ? !0 : !1;
        return angular.isDefined(c.events) && c.events.checkedChanging
          ? c.events.checkedChanging({ checked: d, checkState: a })
Severity: Major
Found in myems-admin/js/jcui/angular.integralui.checkbox.min.js and 1 other location - About 4 hrs to fix
myems-admin/js/jcui/angular.integralui.checkbox.min.js on lines 127..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 134.

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

      this.callCheckStateChanging = function(a) {
        a = b.getCheckValue(a);
        var d = "checked" == a ? !0 : !1;
        return angular.isDefined(c.events) && c.events.checkstateChanging
          ? c.events.checkstateChanging({ checked: d, checkState: a })
Severity: Major
Found in myems-admin/js/jcui/angular.integralui.checkbox.min.js and 1 other location - About 4 hrs to fix
myems-admin/js/jcui/angular.integralui.checkbox.min.js on lines 113..119

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

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

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

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

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

Refactorings

Further Reading

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

                if (templatesFiles.length > 0) {
                    var templatesDeferred = $q.defer();
                    $delegate.templatesLoader(templatesFiles, function (err) {
                        if (angular.isDefined(err) && $delegate.templatesLoader.hasOwnProperty('ocLazyLoadLoader')) {
                            $delegate._$log.error(err);
Severity: Major
Found in myems-admin/js/plugins/oclazyload/ocLazyLoad.js and 1 other location - About 4 hrs to fix
myems-admin/js/plugins/oclazyload/ocLazyLoad.js on lines 1026..1037

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

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

            if offline_meter_list_in_expression is not None and len(offline_meter_list_in_expression) > 0:
                for offline_meter_in_expression in offline_meter_list_in_expression:
                    offline_meter_id = str(offline_meter_in_expression['offline_meter_id'])
                    actual_value = energy_offline_meter_hourly[offline_meter_id].get(current_datetime_utc, Decimal(0.0))
                    subs[offline_meter_in_expression['variable_name']] = actual_value
Severity: Major
Found in myems-normalization/virtualmeter.py and 2 other locations - About 4 hrs to fix
myems-normalization/virtualmeter.py on lines 412..416
myems-normalization/virtualmeter.py on lines 418..422

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

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

        if rows_date_local is not None and len(rows_date_local) > 0:
            for row in rows_date_local:
                date_local_dict = {'id': row[0],
                                   'working_calendar_id': row[1],
                                   'date_local': row[2].strftime('%Y-%m-%d'),
Severity: Major
Found in myems-api/core/workingcalendar.py and 2 other locations - About 4 hrs to fix
myems-api/core/workingcalendar.py on lines 312..318
myems-api/core/workingcalendar.py on lines 704..710

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

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

        if rows_date_local is not None and len(rows_date_local) > 0:
            for row in rows_date_local:
                date_local_dict = {'id': row[0],
                                   'working_calendar_id': row[1],
                                   'date_local': row[2].strftime('%Y-%m-%d'),
Severity: Major
Found in myems-api/core/workingcalendar.py and 2 other locations - About 4 hrs to fix
myems-api/core/workingcalendar.py on lines 312..318
myems-api/core/workingcalendar.py on lines 557..563

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

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

        if rows_date_local is not None and len(rows_date_local) > 0:
            for row in rows_date_local:
                date_local_dict = {'id': row[0],
                                   'working_calendar_id': row[1],
                                   'date_local': row[2].strftime('%Y-%m-%d'),
Severity: Major
Found in myems-api/core/workingcalendar.py and 2 other locations - About 4 hrs to fix
myems-api/core/workingcalendar.py on lines 557..563
myems-api/core/workingcalendar.py on lines 704..710

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

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

            if meter_list_in_expression is not None and len(meter_list_in_expression) > 0:
                for meter_in_expression in meter_list_in_expression:
                    meter_id = str(meter_in_expression['meter_id'])
                    actual_value = energy_meter_hourly[meter_id].get(current_datetime_utc, Decimal(0.0))
                    subs[meter_in_expression['variable_name']] = actual_value
Severity: Major
Found in myems-normalization/virtualmeter.py and 2 other locations - About 4 hrs to fix
myems-normalization/virtualmeter.py on lines 418..422
myems-normalization/virtualmeter.py on lines 424..428

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

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

            if virtual_meter_list_in_expression is not None and len(virtual_meter_list_in_expression) > 0:
                for virtual_meter_in_expression in virtual_meter_list_in_expression:
                    virtual_meter_id = str(virtual_meter_in_expression['virtual_meter_id'])
                    actual_value = energy_virtual_meter_hourly[virtual_meter_id].get(current_datetime_utc, Decimal(0.0))
                    subs[virtual_meter_in_expression['variable_name']] = actual_value
Severity: Major
Found in myems-normalization/virtualmeter.py and 2 other locations - About 4 hrs to fix
myems-normalization/virtualmeter.py on lines 412..416
myems-normalization/virtualmeter.py on lines 424..428

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

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