Showing 10,536 of 10,536 total issues

File dropzone.js has 2726 lines of code (exceeds 250 allowed). Consider refactoring.
Open

"use strict";

function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }

function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
Severity: Major
Found in myems-admin/js/plugins/dropzone/dropzone.js - About 1 wk to fix

    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

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

    def get_energy_category_peak_types(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 149..246

    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

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

    app.controller('TenantCommandController', function (
        $scope,
        $window,
        $timeout,
        $translate,
    myems-admin/app/controllers/settings/combinedequipment/combinedequipmentcommand.controller.js on lines 3..114
    myems-admin/app/controllers/settings/equipment/equipmentcommand.controller.js on lines 3..114
    myems-admin/app/controllers/settings/meter/metercommand.controller.js on lines 3..114
    myems-admin/app/controllers/settings/shopfloor/shopfloorcommand.controller.js on lines 3..114
    myems-admin/app/controllers/settings/store/storecommand.controller.js on lines 3..114

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

    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

    app.controller('EquipmentCommandController', function (
        $scope,
        $window,
        $timeout,
        $translate,
    myems-admin/app/controllers/settings/combinedequipment/combinedequipmentcommand.controller.js on lines 3..114
    myems-admin/app/controllers/settings/meter/metercommand.controller.js on lines 3..114
    myems-admin/app/controllers/settings/shopfloor/shopfloorcommand.controller.js on lines 3..114
    myems-admin/app/controllers/settings/store/storecommand.controller.js on lines 3..114
    myems-admin/app/controllers/settings/tenant/tenantcommand.controller.js on lines 3..114

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

    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

    app.controller('MeterCommandController', function (
        $scope,
        $window,
        $timeout,
        $translate,
    myems-admin/app/controllers/settings/combinedequipment/combinedequipmentcommand.controller.js on lines 3..114
    myems-admin/app/controllers/settings/equipment/equipmentcommand.controller.js on lines 3..114
    myems-admin/app/controllers/settings/shopfloor/shopfloorcommand.controller.js on lines 3..114
    myems-admin/app/controllers/settings/store/storecommand.controller.js on lines 3..114
    myems-admin/app/controllers/settings/tenant/tenantcommand.controller.js on lines 3..114

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

    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

    app.controller('ShopfloorCommandController', function (
        $scope,
        $window,
        $timeout,
        $translate,
    myems-admin/app/controllers/settings/combinedequipment/combinedequipmentcommand.controller.js on lines 3..114
    myems-admin/app/controllers/settings/equipment/equipmentcommand.controller.js on lines 3..114
    myems-admin/app/controllers/settings/meter/metercommand.controller.js on lines 3..114
    myems-admin/app/controllers/settings/store/storecommand.controller.js on lines 3..114
    myems-admin/app/controllers/settings/tenant/tenantcommand.controller.js on lines 3..114

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

    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

    app.controller('CombinedEquipmentCommandController', function (
        $scope,
        $window,
        $timeout,
        $translate,
    myems-admin/app/controllers/settings/equipment/equipmentcommand.controller.js on lines 3..114
    myems-admin/app/controllers/settings/meter/metercommand.controller.js on lines 3..114
    myems-admin/app/controllers/settings/shopfloor/shopfloorcommand.controller.js on lines 3..114
    myems-admin/app/controllers/settings/store/storecommand.controller.js on lines 3..114
    myems-admin/app/controllers/settings/tenant/tenantcommand.controller.js on lines 3..114

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

    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

    app.controller('StoreCommandController', function (
        $scope,
        $window,
        $timeout,
        $translate,
    myems-admin/app/controllers/settings/combinedequipment/combinedequipmentcommand.controller.js on lines 3..114
    myems-admin/app/controllers/settings/equipment/equipmentcommand.controller.js on lines 3..114
    myems-admin/app/controllers/settings/meter/metercommand.controller.js on lines 3..114
    myems-admin/app/controllers/settings/shopfloor/shopfloorcommand.controller.js on lines 3..114
    myems-admin/app/controllers/settings/tenant/tenantcommand.controller.js on lines 3..114

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

    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 EnergyStorageContainerScheduleCollection:
        def __init__(self):
            """Initializes Class"""
            pass
    
    
    Severity: Major
    Found in myems-api/core/energystoragecontainer.py and 1 other location - About 1 wk to fix
    myems-api/core/microgrid.py on lines 4487..4590

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

    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 MicrogridScheduleCollection:
        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/energystoragecontainer.py on lines 5633..5736

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

    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

    File tenant.py has 2601 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    import uuid
    from datetime import datetime, timedelta, timezone
    import falcon
    import mysql.connector
    import simplejson as json
    Severity: Major
    Found in myems-api/core/tenant.py - About 1 wk to fix

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

      app.controller('StoreWorkingCalendarController', function(
          $scope ,
          $window,
          $timeout,
          $translate,
      myems-admin/app/controllers/settings/shopfloor/shopfloorworkingcalendar.controller.js on lines 3..114
      myems-admin/app/controllers/settings/tenant/tenantworkingcalendar.controller.js on lines 3..114

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

      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('ShopfloorWorkingCalendarController', function(
          $scope ,
          $window,
          $timeout,
          $translate,
      myems-admin/app/controllers/settings/store/storeworkingcalendar.controller.js on lines 3..114
      myems-admin/app/controllers/settings/tenant/tenantworkingcalendar.controller.js on lines 3..114

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

      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('TenantWorkingCalendarController', function(
          $scope ,
          $window,
          $timeout,
          $translate,
      myems-admin/app/controllers/settings/shopfloor/shopfloorworkingcalendar.controller.js on lines 3..114
      myems-admin/app/controllers/settings/store/storeworkingcalendar.controller.js on lines 3..114

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

      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: verify parameters
          if cost_center_id is None:
              return dict()
      
      
      Severity: Major
      Found in myems-aggregation/tariff.py and 1 other location - About 1 wk to fix
      myems-aggregation/tariff.py on lines 112..207

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

      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_item_tariffs(cost_center_id, energy_item_id, start_datetime_utc, end_datetime_utc):
          # todo: verify parameters
          if cost_center_id is None:
              return dict()
      
      
      Severity: Major
      Found in myems-aggregation/tariff.py and 1 other location - About 1 wk to fix
      myems-aggregation/tariff.py on lines 12..106

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

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

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

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

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

      Refactorings

      Further Reading

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

      app.controller('ShopfloorEquipmentController', function (
          $scope,
          $window,
          $translate,
          ShopfloorService,
      myems-admin/app/controllers/settings/energystoragepowerstation/energystoragepowerstationcontainer.controller.js on lines 3..110
      myems-admin/app/controllers/settings/energystoragepowerstation/energystoragepowerstationuser.controller.js on lines 3..110
      myems-admin/app/controllers/settings/microgrid/microgridsensor.controller.js on lines 3..110
      myems-admin/app/controllers/settings/microgrid/microgriduser.controller.js on lines 3..110
      myems-admin/app/controllers/settings/shopfloor/shopfloorsensor.controller.js on lines 3..110
      myems-admin/app/controllers/settings/store/storesensor.controller.js on lines 3..110
      myems-admin/app/controllers/settings/tenant/tenantsensor.controller.js on lines 3..110
      myems-admin/app/controllers/settings/virtualpowerplant/virtualpowerplantmicrogrid.controller.js on lines 3..110

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

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

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

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

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

      Refactorings

      Further Reading

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

      app.controller('VirtualPowerPlantMicrogridController', function (
          $scope,
          $window,
          $translate,
          VirtualPowerPlantService,
      myems-admin/app/controllers/settings/energystoragepowerstation/energystoragepowerstationcontainer.controller.js on lines 3..110
      myems-admin/app/controllers/settings/energystoragepowerstation/energystoragepowerstationuser.controller.js on lines 3..110
      myems-admin/app/controllers/settings/microgrid/microgridsensor.controller.js on lines 3..110
      myems-admin/app/controllers/settings/microgrid/microgriduser.controller.js on lines 3..110
      myems-admin/app/controllers/settings/shopfloor/shopfloorequipment.controller.js on lines 3..110
      myems-admin/app/controllers/settings/shopfloor/shopfloorsensor.controller.js on lines 3..110
      myems-admin/app/controllers/settings/store/storesensor.controller.js on lines 3..110
      myems-admin/app/controllers/settings/tenant/tenantsensor.controller.js on lines 3..110

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

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

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

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

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

      Refactorings

      Further Reading

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

      app.controller('MicrogridUserController', function (
          $scope,
          $window,
          $translate,
          MicrogridService,
      myems-admin/app/controllers/settings/energystoragepowerstation/energystoragepowerstationcontainer.controller.js on lines 3..110
      myems-admin/app/controllers/settings/energystoragepowerstation/energystoragepowerstationuser.controller.js on lines 3..110
      myems-admin/app/controllers/settings/microgrid/microgridsensor.controller.js on lines 3..110
      myems-admin/app/controllers/settings/shopfloor/shopfloorequipment.controller.js on lines 3..110
      myems-admin/app/controllers/settings/shopfloor/shopfloorsensor.controller.js on lines 3..110
      myems-admin/app/controllers/settings/store/storesensor.controller.js on lines 3..110
      myems-admin/app/controllers/settings/tenant/tenantsensor.controller.js on lines 3..110
      myems-admin/app/controllers/settings/virtualpowerplant/virtualpowerplantmicrogrid.controller.js on lines 3..110

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

      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