Showing 10,536 of 10,536 total issues

File energystoragecontainerpowerconversionsystem.controller.js has 690 lines of code (exceeds 250 allowed). Consider refactoring.
Open

'use strict';

app.controller('EnergyStorageContainerPowerconversionsystemController', function(
    $scope,
    $rootScope,

    File spaceefficiency.py has 688 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    import re
    from datetime import datetime, timedelta, timezone
    from decimal import Decimal
    import falcon
    import mysql.connector
    Severity: Major
    Found in myems-api/reports/spaceefficiency.py - About 1 day to fix

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

                <Nav tabs>
                  <NavItem className="cursor-pointer">
                    <NavLink
                      className={classNames({ active: activeTabLeft === '1' })}
                      onClick={() => {
      Severity: Major
      Found in myems-web/src/components/MyEMS/Microgrid/MicrogridDetails.js and 1 other location - About 1 day to fix
      myems-web/src/components/MyEMS/Microgrid/Dashboard.js on lines 447..478

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

      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

                  <Nav tabs>
                    <NavItem className="cursor-pointer">
                      <NavLink
                        className={classNames({ active: activeTabLeft === '1' })}
                        onClick={() => {
      Severity: Major
      Found in myems-web/src/components/MyEMS/Microgrid/Dashboard.js and 1 other location - About 1 day to fix
      myems-web/src/components/MyEMS/Microgrid/MicrogridDetails.js on lines 311..342

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

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

      app.factory('MicrogridSensorService', function($http) {
          return {
              addPair: function(microgridID,sensorID, headers, callback) {
                  $http.post(getAPI()+'microgrids/'+microgridID+'/sensors',{data:{'sensor_id':sensorID}}, {headers})
                  .then(function (response) {
      myems-admin/app/services/settings/combinedequipment/combinedequipmentcommand.service.js on lines 2..30
      myems-admin/app/services/settings/combinedequipment/combinedequipmentequipment.service.js on lines 2..30
      myems-admin/app/services/settings/costcenter/costcentertariff.service.js on lines 2..29
      myems-admin/app/services/settings/distributionsystem/distributioncircuitpoint.service.js on lines 2..30
      myems-admin/app/services/settings/energystoragepowerstation/energystoragepowerstationcontainer.service.js on lines 2..30
      myems-admin/app/services/settings/energystoragepowerstation/energystoragepowerstationuser.service.js on lines 2..30
      myems-admin/app/services/settings/equipment/equipmentcommand.service.js on lines 2..30
      myems-admin/app/services/settings/meter/metercommand.service.js on lines 2..30
      myems-admin/app/services/settings/meter/meterpoint.service.js on lines 2..30
      myems-admin/app/services/settings/microgrid/microgriduser.service.js on lines 2..30
      myems-admin/app/services/settings/sensor/sensorpoint.service.js on lines 2..30
      myems-admin/app/services/settings/shopfloor/shopfloorcommand.service.js on lines 2..30
      myems-admin/app/services/settings/shopfloor/shopfloorequipment.service.js on lines 2..30
      myems-admin/app/services/settings/shopfloor/shopfloorpoint.service.js on lines 2..30
      myems-admin/app/services/settings/shopfloor/shopfloorsensor.service.js on lines 2..30
      myems-admin/app/services/settings/space/spacecombinedequipment.service.js on lines 2..30
      myems-admin/app/services/settings/space/spacecommand.service.js on lines 2..30
      myems-admin/app/services/settings/space/spaceenergyflowdiagram.service.js on lines 2..30
      myems-admin/app/services/settings/space/spaceenergystoragepowerstation.service.js on lines 2..30
      myems-admin/app/services/settings/space/spaceequipment.service.js on lines 2..30
      myems-admin/app/services/settings/space/spacepoint.service.js on lines 2..30
      myems-admin/app/services/settings/space/spacesensor.service.js on lines 2..30
      myems-admin/app/services/settings/space/spaceshopfloor.service.js on lines 2..30
      myems-admin/app/services/settings/space/spacestore.service.js on lines 2..30
      myems-admin/app/services/settings/space/spacetenant.service.js on lines 2..30
      myems-admin/app/services/settings/store/storecommand.service.js on lines 2..30
      myems-admin/app/services/settings/store/storepoint.service.js on lines 2..30
      myems-admin/app/services/settings/store/storesensor.service.js on lines 2..30
      myems-admin/app/services/settings/tenant/tenantcommand.service.js on lines 2..30
      myems-admin/app/services/settings/tenant/tenantpoint.service.js on lines 2..30
      myems-admin/app/services/settings/tenant/tenantsensor.service.js on lines 2..30
      myems-admin/app/services/settings/virtualpowerplant/virtualpowerplantmicrogrid.service.js on lines 2..30

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

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

      app.factory('CombinedEquipmentEquipmentService', function($http) {
          return {
              addPair: function(combinedequipmentID,equipmentID, headers, callback) {
                  $http.post(getAPI()+'combinedequipments/'+combinedequipmentID+'/equipments', {data:{'equipment_id':equipmentID}}, {headers})
                  .then(function (response) {
      myems-admin/app/services/settings/combinedequipment/combinedequipmentcommand.service.js on lines 2..30
      myems-admin/app/services/settings/costcenter/costcentertariff.service.js on lines 2..29
      myems-admin/app/services/settings/distributionsystem/distributioncircuitpoint.service.js on lines 2..30
      myems-admin/app/services/settings/energystoragepowerstation/energystoragepowerstationcontainer.service.js on lines 2..30
      myems-admin/app/services/settings/energystoragepowerstation/energystoragepowerstationuser.service.js on lines 2..30
      myems-admin/app/services/settings/equipment/equipmentcommand.service.js on lines 2..30
      myems-admin/app/services/settings/meter/metercommand.service.js on lines 2..30
      myems-admin/app/services/settings/meter/meterpoint.service.js on lines 2..30
      myems-admin/app/services/settings/microgrid/microgridsensor.service.js on lines 2..30
      myems-admin/app/services/settings/microgrid/microgriduser.service.js on lines 2..30
      myems-admin/app/services/settings/sensor/sensorpoint.service.js on lines 2..30
      myems-admin/app/services/settings/shopfloor/shopfloorcommand.service.js on lines 2..30
      myems-admin/app/services/settings/shopfloor/shopfloorequipment.service.js on lines 2..30
      myems-admin/app/services/settings/shopfloor/shopfloorpoint.service.js on lines 2..30
      myems-admin/app/services/settings/shopfloor/shopfloorsensor.service.js on lines 2..30
      myems-admin/app/services/settings/space/spacecombinedequipment.service.js on lines 2..30
      myems-admin/app/services/settings/space/spacecommand.service.js on lines 2..30
      myems-admin/app/services/settings/space/spaceenergyflowdiagram.service.js on lines 2..30
      myems-admin/app/services/settings/space/spaceenergystoragepowerstation.service.js on lines 2..30
      myems-admin/app/services/settings/space/spaceequipment.service.js on lines 2..30
      myems-admin/app/services/settings/space/spacepoint.service.js on lines 2..30
      myems-admin/app/services/settings/space/spacesensor.service.js on lines 2..30
      myems-admin/app/services/settings/space/spaceshopfloor.service.js on lines 2..30
      myems-admin/app/services/settings/space/spacestore.service.js on lines 2..30
      myems-admin/app/services/settings/space/spacetenant.service.js on lines 2..30
      myems-admin/app/services/settings/store/storecommand.service.js on lines 2..30
      myems-admin/app/services/settings/store/storepoint.service.js on lines 2..30
      myems-admin/app/services/settings/store/storesensor.service.js on lines 2..30
      myems-admin/app/services/settings/tenant/tenantcommand.service.js on lines 2..30
      myems-admin/app/services/settings/tenant/tenantpoint.service.js on lines 2..30
      myems-admin/app/services/settings/tenant/tenantsensor.service.js on lines 2..30
      myems-admin/app/services/settings/virtualpowerplant/virtualpowerplantmicrogrid.service.js on lines 2..30

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

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

      app.factory('MeterCommandService', function($http) {
          return {
              addPair: function(meterID,commandID, headers, callback) {
                  $http.post(getAPI()+'meters/'+meterID+'/commands',{data:{'command_id':commandID}}, {headers})
                  .then(function (response) {
      myems-admin/app/services/settings/combinedequipment/combinedequipmentcommand.service.js on lines 2..30
      myems-admin/app/services/settings/combinedequipment/combinedequipmentequipment.service.js on lines 2..30
      myems-admin/app/services/settings/costcenter/costcentertariff.service.js on lines 2..29
      myems-admin/app/services/settings/distributionsystem/distributioncircuitpoint.service.js on lines 2..30
      myems-admin/app/services/settings/energystoragepowerstation/energystoragepowerstationcontainer.service.js on lines 2..30
      myems-admin/app/services/settings/energystoragepowerstation/energystoragepowerstationuser.service.js on lines 2..30
      myems-admin/app/services/settings/equipment/equipmentcommand.service.js on lines 2..30
      myems-admin/app/services/settings/meter/meterpoint.service.js on lines 2..30
      myems-admin/app/services/settings/microgrid/microgridsensor.service.js on lines 2..30
      myems-admin/app/services/settings/microgrid/microgriduser.service.js on lines 2..30
      myems-admin/app/services/settings/sensor/sensorpoint.service.js on lines 2..30
      myems-admin/app/services/settings/shopfloor/shopfloorcommand.service.js on lines 2..30
      myems-admin/app/services/settings/shopfloor/shopfloorequipment.service.js on lines 2..30
      myems-admin/app/services/settings/shopfloor/shopfloorpoint.service.js on lines 2..30
      myems-admin/app/services/settings/shopfloor/shopfloorsensor.service.js on lines 2..30
      myems-admin/app/services/settings/space/spacecombinedequipment.service.js on lines 2..30
      myems-admin/app/services/settings/space/spacecommand.service.js on lines 2..30
      myems-admin/app/services/settings/space/spaceenergyflowdiagram.service.js on lines 2..30
      myems-admin/app/services/settings/space/spaceenergystoragepowerstation.service.js on lines 2..30
      myems-admin/app/services/settings/space/spaceequipment.service.js on lines 2..30
      myems-admin/app/services/settings/space/spacepoint.service.js on lines 2..30
      myems-admin/app/services/settings/space/spacesensor.service.js on lines 2..30
      myems-admin/app/services/settings/space/spaceshopfloor.service.js on lines 2..30
      myems-admin/app/services/settings/space/spacestore.service.js on lines 2..30
      myems-admin/app/services/settings/space/spacetenant.service.js on lines 2..30
      myems-admin/app/services/settings/store/storecommand.service.js on lines 2..30
      myems-admin/app/services/settings/store/storepoint.service.js on lines 2..30
      myems-admin/app/services/settings/store/storesensor.service.js on lines 2..30
      myems-admin/app/services/settings/tenant/tenantcommand.service.js on lines 2..30
      myems-admin/app/services/settings/tenant/tenantpoint.service.js on lines 2..30
      myems-admin/app/services/settings/tenant/tenantsensor.service.js on lines 2..30
      myems-admin/app/services/settings/virtualpowerplant/virtualpowerplantmicrogrid.service.js on lines 2..30

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

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

      app.factory('SpaceEnergyStoragePowerStationService', function($http) {
          return {
              addPair: function(spaceID,energystoragepowerstationID, headers, callback) {
                  $http.post(getAPI()+'spaces/'+spaceID+'/energystoragepowerstations',{data:{'energy_storage_power_station_id':energystoragepowerstationID}}, {headers})
                  .then(function (response) {
      myems-admin/app/services/settings/combinedequipment/combinedequipmentcommand.service.js on lines 2..30
      myems-admin/app/services/settings/combinedequipment/combinedequipmentequipment.service.js on lines 2..30
      myems-admin/app/services/settings/costcenter/costcentertariff.service.js on lines 2..29
      myems-admin/app/services/settings/distributionsystem/distributioncircuitpoint.service.js on lines 2..30
      myems-admin/app/services/settings/energystoragepowerstation/energystoragepowerstationcontainer.service.js on lines 2..30
      myems-admin/app/services/settings/energystoragepowerstation/energystoragepowerstationuser.service.js on lines 2..30
      myems-admin/app/services/settings/equipment/equipmentcommand.service.js on lines 2..30
      myems-admin/app/services/settings/meter/metercommand.service.js on lines 2..30
      myems-admin/app/services/settings/meter/meterpoint.service.js on lines 2..30
      myems-admin/app/services/settings/microgrid/microgridsensor.service.js on lines 2..30
      myems-admin/app/services/settings/microgrid/microgriduser.service.js on lines 2..30
      myems-admin/app/services/settings/sensor/sensorpoint.service.js on lines 2..30
      myems-admin/app/services/settings/shopfloor/shopfloorcommand.service.js on lines 2..30
      myems-admin/app/services/settings/shopfloor/shopfloorequipment.service.js on lines 2..30
      myems-admin/app/services/settings/shopfloor/shopfloorpoint.service.js on lines 2..30
      myems-admin/app/services/settings/shopfloor/shopfloorsensor.service.js on lines 2..30
      myems-admin/app/services/settings/space/spacecombinedequipment.service.js on lines 2..30
      myems-admin/app/services/settings/space/spacecommand.service.js on lines 2..30
      myems-admin/app/services/settings/space/spaceenergyflowdiagram.service.js on lines 2..30
      myems-admin/app/services/settings/space/spaceequipment.service.js on lines 2..30
      myems-admin/app/services/settings/space/spacepoint.service.js on lines 2..30
      myems-admin/app/services/settings/space/spacesensor.service.js on lines 2..30
      myems-admin/app/services/settings/space/spaceshopfloor.service.js on lines 2..30
      myems-admin/app/services/settings/space/spacestore.service.js on lines 2..30
      myems-admin/app/services/settings/space/spacetenant.service.js on lines 2..30
      myems-admin/app/services/settings/store/storecommand.service.js on lines 2..30
      myems-admin/app/services/settings/store/storepoint.service.js on lines 2..30
      myems-admin/app/services/settings/store/storesensor.service.js on lines 2..30
      myems-admin/app/services/settings/tenant/tenantcommand.service.js on lines 2..30
      myems-admin/app/services/settings/tenant/tenantpoint.service.js on lines 2..30
      myems-admin/app/services/settings/tenant/tenantsensor.service.js on lines 2..30
      myems-admin/app/services/settings/virtualpowerplant/virtualpowerplantmicrogrid.service.js on lines 2..30

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

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

      app.factory('EquipmentCommandService', function($http) {
          return {
              addPair: function(equipmentID,commandID, headers, callback) {
                  $http.post(getAPI()+'equipments/'+equipmentID+'/commands',{data:{'command_id':commandID}}, {headers})
                  .then(function (response) {
      myems-admin/app/services/settings/combinedequipment/combinedequipmentcommand.service.js on lines 2..30
      myems-admin/app/services/settings/combinedequipment/combinedequipmentequipment.service.js on lines 2..30
      myems-admin/app/services/settings/costcenter/costcentertariff.service.js on lines 2..29
      myems-admin/app/services/settings/distributionsystem/distributioncircuitpoint.service.js on lines 2..30
      myems-admin/app/services/settings/energystoragepowerstation/energystoragepowerstationcontainer.service.js on lines 2..30
      myems-admin/app/services/settings/energystoragepowerstation/energystoragepowerstationuser.service.js on lines 2..30
      myems-admin/app/services/settings/meter/metercommand.service.js on lines 2..30
      myems-admin/app/services/settings/meter/meterpoint.service.js on lines 2..30
      myems-admin/app/services/settings/microgrid/microgridsensor.service.js on lines 2..30
      myems-admin/app/services/settings/microgrid/microgriduser.service.js on lines 2..30
      myems-admin/app/services/settings/sensor/sensorpoint.service.js on lines 2..30
      myems-admin/app/services/settings/shopfloor/shopfloorcommand.service.js on lines 2..30
      myems-admin/app/services/settings/shopfloor/shopfloorequipment.service.js on lines 2..30
      myems-admin/app/services/settings/shopfloor/shopfloorpoint.service.js on lines 2..30
      myems-admin/app/services/settings/shopfloor/shopfloorsensor.service.js on lines 2..30
      myems-admin/app/services/settings/space/spacecombinedequipment.service.js on lines 2..30
      myems-admin/app/services/settings/space/spacecommand.service.js on lines 2..30
      myems-admin/app/services/settings/space/spaceenergyflowdiagram.service.js on lines 2..30
      myems-admin/app/services/settings/space/spaceenergystoragepowerstation.service.js on lines 2..30
      myems-admin/app/services/settings/space/spaceequipment.service.js on lines 2..30
      myems-admin/app/services/settings/space/spacepoint.service.js on lines 2..30
      myems-admin/app/services/settings/space/spacesensor.service.js on lines 2..30
      myems-admin/app/services/settings/space/spaceshopfloor.service.js on lines 2..30
      myems-admin/app/services/settings/space/spacestore.service.js on lines 2..30
      myems-admin/app/services/settings/space/spacetenant.service.js on lines 2..30
      myems-admin/app/services/settings/store/storecommand.service.js on lines 2..30
      myems-admin/app/services/settings/store/storepoint.service.js on lines 2..30
      myems-admin/app/services/settings/store/storesensor.service.js on lines 2..30
      myems-admin/app/services/settings/tenant/tenantcommand.service.js on lines 2..30
      myems-admin/app/services/settings/tenant/tenantpoint.service.js on lines 2..30
      myems-admin/app/services/settings/tenant/tenantsensor.service.js on lines 2..30
      myems-admin/app/services/settings/virtualpowerplant/virtualpowerplantmicrogrid.service.js on lines 2..30

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

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

      app.factory('TenantPointService', function($http) {
          return {
              addPair: function(tenantID,pointID, headers, callback) {
                  $http.post(getAPI()+'tenants/'+tenantID+'/points',{data:{'point_id':pointID}}, {headers})
                  .then(function (response) {
      myems-admin/app/services/settings/combinedequipment/combinedequipmentcommand.service.js on lines 2..30
      myems-admin/app/services/settings/combinedequipment/combinedequipmentequipment.service.js on lines 2..30
      myems-admin/app/services/settings/costcenter/costcentertariff.service.js on lines 2..29
      myems-admin/app/services/settings/distributionsystem/distributioncircuitpoint.service.js on lines 2..30
      myems-admin/app/services/settings/energystoragepowerstation/energystoragepowerstationcontainer.service.js on lines 2..30
      myems-admin/app/services/settings/energystoragepowerstation/energystoragepowerstationuser.service.js on lines 2..30
      myems-admin/app/services/settings/equipment/equipmentcommand.service.js on lines 2..30
      myems-admin/app/services/settings/meter/metercommand.service.js on lines 2..30
      myems-admin/app/services/settings/meter/meterpoint.service.js on lines 2..30
      myems-admin/app/services/settings/microgrid/microgridsensor.service.js on lines 2..30
      myems-admin/app/services/settings/microgrid/microgriduser.service.js on lines 2..30
      myems-admin/app/services/settings/sensor/sensorpoint.service.js on lines 2..30
      myems-admin/app/services/settings/shopfloor/shopfloorcommand.service.js on lines 2..30
      myems-admin/app/services/settings/shopfloor/shopfloorequipment.service.js on lines 2..30
      myems-admin/app/services/settings/shopfloor/shopfloorpoint.service.js on lines 2..30
      myems-admin/app/services/settings/shopfloor/shopfloorsensor.service.js on lines 2..30
      myems-admin/app/services/settings/space/spacecombinedequipment.service.js on lines 2..30
      myems-admin/app/services/settings/space/spacecommand.service.js on lines 2..30
      myems-admin/app/services/settings/space/spaceenergyflowdiagram.service.js on lines 2..30
      myems-admin/app/services/settings/space/spaceenergystoragepowerstation.service.js on lines 2..30
      myems-admin/app/services/settings/space/spaceequipment.service.js on lines 2..30
      myems-admin/app/services/settings/space/spacepoint.service.js on lines 2..30
      myems-admin/app/services/settings/space/spacesensor.service.js on lines 2..30
      myems-admin/app/services/settings/space/spaceshopfloor.service.js on lines 2..30
      myems-admin/app/services/settings/space/spacestore.service.js on lines 2..30
      myems-admin/app/services/settings/space/spacetenant.service.js on lines 2..30
      myems-admin/app/services/settings/store/storecommand.service.js on lines 2..30
      myems-admin/app/services/settings/store/storepoint.service.js on lines 2..30
      myems-admin/app/services/settings/store/storesensor.service.js on lines 2..30
      myems-admin/app/services/settings/tenant/tenantcommand.service.js on lines 2..30
      myems-admin/app/services/settings/tenant/tenantsensor.service.js on lines 2..30
      myems-admin/app/services/settings/virtualpowerplant/virtualpowerplantmicrogrid.service.js on lines 2..30

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

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

      app.factory('SpacePointService', function($http) {
          return {
              addPair: function(spaceID,pointID, headers, callback) {
                  $http.post(getAPI()+'spaces/'+spaceID+'/points',{data:{'point_id':pointID}}, {headers})
                  .then(function (response) {
      myems-admin/app/services/settings/combinedequipment/combinedequipmentcommand.service.js on lines 2..30
      myems-admin/app/services/settings/combinedequipment/combinedequipmentequipment.service.js on lines 2..30
      myems-admin/app/services/settings/costcenter/costcentertariff.service.js on lines 2..29
      myems-admin/app/services/settings/distributionsystem/distributioncircuitpoint.service.js on lines 2..30
      myems-admin/app/services/settings/energystoragepowerstation/energystoragepowerstationcontainer.service.js on lines 2..30
      myems-admin/app/services/settings/energystoragepowerstation/energystoragepowerstationuser.service.js on lines 2..30
      myems-admin/app/services/settings/equipment/equipmentcommand.service.js on lines 2..30
      myems-admin/app/services/settings/meter/metercommand.service.js on lines 2..30
      myems-admin/app/services/settings/meter/meterpoint.service.js on lines 2..30
      myems-admin/app/services/settings/microgrid/microgridsensor.service.js on lines 2..30
      myems-admin/app/services/settings/microgrid/microgriduser.service.js on lines 2..30
      myems-admin/app/services/settings/sensor/sensorpoint.service.js on lines 2..30
      myems-admin/app/services/settings/shopfloor/shopfloorcommand.service.js on lines 2..30
      myems-admin/app/services/settings/shopfloor/shopfloorequipment.service.js on lines 2..30
      myems-admin/app/services/settings/shopfloor/shopfloorpoint.service.js on lines 2..30
      myems-admin/app/services/settings/shopfloor/shopfloorsensor.service.js on lines 2..30
      myems-admin/app/services/settings/space/spacecombinedequipment.service.js on lines 2..30
      myems-admin/app/services/settings/space/spacecommand.service.js on lines 2..30
      myems-admin/app/services/settings/space/spaceenergyflowdiagram.service.js on lines 2..30
      myems-admin/app/services/settings/space/spaceenergystoragepowerstation.service.js on lines 2..30
      myems-admin/app/services/settings/space/spaceequipment.service.js on lines 2..30
      myems-admin/app/services/settings/space/spacesensor.service.js on lines 2..30
      myems-admin/app/services/settings/space/spaceshopfloor.service.js on lines 2..30
      myems-admin/app/services/settings/space/spacestore.service.js on lines 2..30
      myems-admin/app/services/settings/space/spacetenant.service.js on lines 2..30
      myems-admin/app/services/settings/store/storecommand.service.js on lines 2..30
      myems-admin/app/services/settings/store/storepoint.service.js on lines 2..30
      myems-admin/app/services/settings/store/storesensor.service.js on lines 2..30
      myems-admin/app/services/settings/tenant/tenantcommand.service.js on lines 2..30
      myems-admin/app/services/settings/tenant/tenantpoint.service.js on lines 2..30
      myems-admin/app/services/settings/tenant/tenantsensor.service.js on lines 2..30
      myems-admin/app/services/settings/virtualpowerplant/virtualpowerplantmicrogrid.service.js on lines 2..30

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

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

      app.factory('ShopfloorPointService', function($http) {
          return {
              addPair: function(shopfloorID,pointID, headers, callback) {
                  $http.post(getAPI()+'shopfloors/'+shopfloorID+'/points',{data:{'point_id':pointID}}, {headers})
                  .then(function (response) {
      myems-admin/app/services/settings/combinedequipment/combinedequipmentcommand.service.js on lines 2..30
      myems-admin/app/services/settings/combinedequipment/combinedequipmentequipment.service.js on lines 2..30
      myems-admin/app/services/settings/costcenter/costcentertariff.service.js on lines 2..29
      myems-admin/app/services/settings/distributionsystem/distributioncircuitpoint.service.js on lines 2..30
      myems-admin/app/services/settings/energystoragepowerstation/energystoragepowerstationcontainer.service.js on lines 2..30
      myems-admin/app/services/settings/energystoragepowerstation/energystoragepowerstationuser.service.js on lines 2..30
      myems-admin/app/services/settings/equipment/equipmentcommand.service.js on lines 2..30
      myems-admin/app/services/settings/meter/metercommand.service.js on lines 2..30
      myems-admin/app/services/settings/meter/meterpoint.service.js on lines 2..30
      myems-admin/app/services/settings/microgrid/microgridsensor.service.js on lines 2..30
      myems-admin/app/services/settings/microgrid/microgriduser.service.js on lines 2..30
      myems-admin/app/services/settings/sensor/sensorpoint.service.js on lines 2..30
      myems-admin/app/services/settings/shopfloor/shopfloorcommand.service.js on lines 2..30
      myems-admin/app/services/settings/shopfloor/shopfloorequipment.service.js on lines 2..30
      myems-admin/app/services/settings/shopfloor/shopfloorsensor.service.js on lines 2..30
      myems-admin/app/services/settings/space/spacecombinedequipment.service.js on lines 2..30
      myems-admin/app/services/settings/space/spacecommand.service.js on lines 2..30
      myems-admin/app/services/settings/space/spaceenergyflowdiagram.service.js on lines 2..30
      myems-admin/app/services/settings/space/spaceenergystoragepowerstation.service.js on lines 2..30
      myems-admin/app/services/settings/space/spaceequipment.service.js on lines 2..30
      myems-admin/app/services/settings/space/spacepoint.service.js on lines 2..30
      myems-admin/app/services/settings/space/spacesensor.service.js on lines 2..30
      myems-admin/app/services/settings/space/spaceshopfloor.service.js on lines 2..30
      myems-admin/app/services/settings/space/spacestore.service.js on lines 2..30
      myems-admin/app/services/settings/space/spacetenant.service.js on lines 2..30
      myems-admin/app/services/settings/store/storecommand.service.js on lines 2..30
      myems-admin/app/services/settings/store/storepoint.service.js on lines 2..30
      myems-admin/app/services/settings/store/storesensor.service.js on lines 2..30
      myems-admin/app/services/settings/tenant/tenantcommand.service.js on lines 2..30
      myems-admin/app/services/settings/tenant/tenantpoint.service.js on lines 2..30
      myems-admin/app/services/settings/tenant/tenantsensor.service.js on lines 2..30
      myems-admin/app/services/settings/virtualpowerplant/virtualpowerplantmicrogrid.service.js on lines 2..30

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

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

      app.factory('VirtualPowerPlantMicrogridService', function($http) {
          return {
              addPair: function(virtualpowerplantID,microgridID, headers, callback) {
                  $http.post(getAPI()+'virtualpowerplants/'+virtualpowerplantID+'/microgrids',{data:{'microgrid_id':microgridID}}, {headers})
                  .then(function (response) {
      myems-admin/app/services/settings/combinedequipment/combinedequipmentcommand.service.js on lines 2..30
      myems-admin/app/services/settings/combinedequipment/combinedequipmentequipment.service.js on lines 2..30
      myems-admin/app/services/settings/costcenter/costcentertariff.service.js on lines 2..29
      myems-admin/app/services/settings/distributionsystem/distributioncircuitpoint.service.js on lines 2..30
      myems-admin/app/services/settings/energystoragepowerstation/energystoragepowerstationcontainer.service.js on lines 2..30
      myems-admin/app/services/settings/energystoragepowerstation/energystoragepowerstationuser.service.js on lines 2..30
      myems-admin/app/services/settings/equipment/equipmentcommand.service.js on lines 2..30
      myems-admin/app/services/settings/meter/metercommand.service.js on lines 2..30
      myems-admin/app/services/settings/meter/meterpoint.service.js on lines 2..30
      myems-admin/app/services/settings/microgrid/microgridsensor.service.js on lines 2..30
      myems-admin/app/services/settings/microgrid/microgriduser.service.js on lines 2..30
      myems-admin/app/services/settings/sensor/sensorpoint.service.js on lines 2..30
      myems-admin/app/services/settings/shopfloor/shopfloorcommand.service.js on lines 2..30
      myems-admin/app/services/settings/shopfloor/shopfloorequipment.service.js on lines 2..30
      myems-admin/app/services/settings/shopfloor/shopfloorpoint.service.js on lines 2..30
      myems-admin/app/services/settings/shopfloor/shopfloorsensor.service.js on lines 2..30
      myems-admin/app/services/settings/space/spacecombinedequipment.service.js on lines 2..30
      myems-admin/app/services/settings/space/spacecommand.service.js on lines 2..30
      myems-admin/app/services/settings/space/spaceenergyflowdiagram.service.js on lines 2..30
      myems-admin/app/services/settings/space/spaceenergystoragepowerstation.service.js on lines 2..30
      myems-admin/app/services/settings/space/spaceequipment.service.js on lines 2..30
      myems-admin/app/services/settings/space/spacepoint.service.js on lines 2..30
      myems-admin/app/services/settings/space/spacesensor.service.js on lines 2..30
      myems-admin/app/services/settings/space/spaceshopfloor.service.js on lines 2..30
      myems-admin/app/services/settings/space/spacestore.service.js on lines 2..30
      myems-admin/app/services/settings/space/spacetenant.service.js on lines 2..30
      myems-admin/app/services/settings/store/storecommand.service.js on lines 2..30
      myems-admin/app/services/settings/store/storepoint.service.js on lines 2..30
      myems-admin/app/services/settings/store/storesensor.service.js on lines 2..30
      myems-admin/app/services/settings/tenant/tenantcommand.service.js on lines 2..30
      myems-admin/app/services/settings/tenant/tenantpoint.service.js on lines 2..30
      myems-admin/app/services/settings/tenant/tenantsensor.service.js on lines 2..30

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

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

      app.factory('MeterPointService', function($http) {
          return {
              addPair: function(meterID, pointID, headers, callback) {
                  $http.post(getAPI() + 'meters/' + meterID + '/points', {data:{'point_id':pointID}}, {headers})
                  .then(function (response) {
      myems-admin/app/services/settings/combinedequipment/combinedequipmentcommand.service.js on lines 2..30
      myems-admin/app/services/settings/combinedequipment/combinedequipmentequipment.service.js on lines 2..30
      myems-admin/app/services/settings/costcenter/costcentertariff.service.js on lines 2..29
      myems-admin/app/services/settings/distributionsystem/distributioncircuitpoint.service.js on lines 2..30
      myems-admin/app/services/settings/energystoragepowerstation/energystoragepowerstationcontainer.service.js on lines 2..30
      myems-admin/app/services/settings/energystoragepowerstation/energystoragepowerstationuser.service.js on lines 2..30
      myems-admin/app/services/settings/equipment/equipmentcommand.service.js on lines 2..30
      myems-admin/app/services/settings/meter/metercommand.service.js on lines 2..30
      myems-admin/app/services/settings/microgrid/microgridsensor.service.js on lines 2..30
      myems-admin/app/services/settings/microgrid/microgriduser.service.js on lines 2..30
      myems-admin/app/services/settings/sensor/sensorpoint.service.js on lines 2..30
      myems-admin/app/services/settings/shopfloor/shopfloorcommand.service.js on lines 2..30
      myems-admin/app/services/settings/shopfloor/shopfloorequipment.service.js on lines 2..30
      myems-admin/app/services/settings/shopfloor/shopfloorpoint.service.js on lines 2..30
      myems-admin/app/services/settings/shopfloor/shopfloorsensor.service.js on lines 2..30
      myems-admin/app/services/settings/space/spacecombinedequipment.service.js on lines 2..30
      myems-admin/app/services/settings/space/spacecommand.service.js on lines 2..30
      myems-admin/app/services/settings/space/spaceenergyflowdiagram.service.js on lines 2..30
      myems-admin/app/services/settings/space/spaceenergystoragepowerstation.service.js on lines 2..30
      myems-admin/app/services/settings/space/spaceequipment.service.js on lines 2..30
      myems-admin/app/services/settings/space/spacepoint.service.js on lines 2..30
      myems-admin/app/services/settings/space/spacesensor.service.js on lines 2..30
      myems-admin/app/services/settings/space/spaceshopfloor.service.js on lines 2..30
      myems-admin/app/services/settings/space/spacestore.service.js on lines 2..30
      myems-admin/app/services/settings/space/spacetenant.service.js on lines 2..30
      myems-admin/app/services/settings/store/storecommand.service.js on lines 2..30
      myems-admin/app/services/settings/store/storepoint.service.js on lines 2..30
      myems-admin/app/services/settings/store/storesensor.service.js on lines 2..30
      myems-admin/app/services/settings/tenant/tenantcommand.service.js on lines 2..30
      myems-admin/app/services/settings/tenant/tenantpoint.service.js on lines 2..30
      myems-admin/app/services/settings/tenant/tenantsensor.service.js on lines 2..30
      myems-admin/app/services/settings/virtualpowerplant/virtualpowerplantmicrogrid.service.js on lines 2..30

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

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

      app.factory('StoreCommandService', function($http) {
          return {
              addPair: function(storeID,commandID, headers, callback) {
                  $http.post(getAPI()+'stores/'+storeID+'/commands',{data:{'command_id':commandID}}, {headers})
                  .then(function (response) {
      myems-admin/app/services/settings/combinedequipment/combinedequipmentcommand.service.js on lines 2..30
      myems-admin/app/services/settings/combinedequipment/combinedequipmentequipment.service.js on lines 2..30
      myems-admin/app/services/settings/costcenter/costcentertariff.service.js on lines 2..29
      myems-admin/app/services/settings/distributionsystem/distributioncircuitpoint.service.js on lines 2..30
      myems-admin/app/services/settings/energystoragepowerstation/energystoragepowerstationcontainer.service.js on lines 2..30
      myems-admin/app/services/settings/energystoragepowerstation/energystoragepowerstationuser.service.js on lines 2..30
      myems-admin/app/services/settings/equipment/equipmentcommand.service.js on lines 2..30
      myems-admin/app/services/settings/meter/metercommand.service.js on lines 2..30
      myems-admin/app/services/settings/meter/meterpoint.service.js on lines 2..30
      myems-admin/app/services/settings/microgrid/microgridsensor.service.js on lines 2..30
      myems-admin/app/services/settings/microgrid/microgriduser.service.js on lines 2..30
      myems-admin/app/services/settings/sensor/sensorpoint.service.js on lines 2..30
      myems-admin/app/services/settings/shopfloor/shopfloorcommand.service.js on lines 2..30
      myems-admin/app/services/settings/shopfloor/shopfloorequipment.service.js on lines 2..30
      myems-admin/app/services/settings/shopfloor/shopfloorpoint.service.js on lines 2..30
      myems-admin/app/services/settings/shopfloor/shopfloorsensor.service.js on lines 2..30
      myems-admin/app/services/settings/space/spacecombinedequipment.service.js on lines 2..30
      myems-admin/app/services/settings/space/spacecommand.service.js on lines 2..30
      myems-admin/app/services/settings/space/spaceenergyflowdiagram.service.js on lines 2..30
      myems-admin/app/services/settings/space/spaceenergystoragepowerstation.service.js on lines 2..30
      myems-admin/app/services/settings/space/spaceequipment.service.js on lines 2..30
      myems-admin/app/services/settings/space/spacepoint.service.js on lines 2..30
      myems-admin/app/services/settings/space/spacesensor.service.js on lines 2..30
      myems-admin/app/services/settings/space/spaceshopfloor.service.js on lines 2..30
      myems-admin/app/services/settings/space/spacestore.service.js on lines 2..30
      myems-admin/app/services/settings/space/spacetenant.service.js on lines 2..30
      myems-admin/app/services/settings/store/storepoint.service.js on lines 2..30
      myems-admin/app/services/settings/store/storesensor.service.js on lines 2..30
      myems-admin/app/services/settings/tenant/tenantcommand.service.js on lines 2..30
      myems-admin/app/services/settings/tenant/tenantpoint.service.js on lines 2..30
      myems-admin/app/services/settings/tenant/tenantsensor.service.js on lines 2..30
      myems-admin/app/services/settings/virtualpowerplant/virtualpowerplantmicrogrid.service.js on lines 2..30

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

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

      app.factory('EnergyStoragePowerStationUserService', function($http) {
          return {
              addPair: function(energystoragepowerstationID,userID, headers, callback) {
                  $http.post(getAPI()+'energystoragepowerstations/'+energystoragepowerstationID+'/users',{data:{'user_id':userID}}, {headers})
                  .then(function (response) {
      myems-admin/app/services/settings/combinedequipment/combinedequipmentcommand.service.js on lines 2..30
      myems-admin/app/services/settings/combinedequipment/combinedequipmentequipment.service.js on lines 2..30
      myems-admin/app/services/settings/costcenter/costcentertariff.service.js on lines 2..29
      myems-admin/app/services/settings/distributionsystem/distributioncircuitpoint.service.js on lines 2..30
      myems-admin/app/services/settings/energystoragepowerstation/energystoragepowerstationcontainer.service.js on lines 2..30
      myems-admin/app/services/settings/equipment/equipmentcommand.service.js on lines 2..30
      myems-admin/app/services/settings/meter/metercommand.service.js on lines 2..30
      myems-admin/app/services/settings/meter/meterpoint.service.js on lines 2..30
      myems-admin/app/services/settings/microgrid/microgridsensor.service.js on lines 2..30
      myems-admin/app/services/settings/microgrid/microgriduser.service.js on lines 2..30
      myems-admin/app/services/settings/sensor/sensorpoint.service.js on lines 2..30
      myems-admin/app/services/settings/shopfloor/shopfloorcommand.service.js on lines 2..30
      myems-admin/app/services/settings/shopfloor/shopfloorequipment.service.js on lines 2..30
      myems-admin/app/services/settings/shopfloor/shopfloorpoint.service.js on lines 2..30
      myems-admin/app/services/settings/shopfloor/shopfloorsensor.service.js on lines 2..30
      myems-admin/app/services/settings/space/spacecombinedequipment.service.js on lines 2..30
      myems-admin/app/services/settings/space/spacecommand.service.js on lines 2..30
      myems-admin/app/services/settings/space/spaceenergyflowdiagram.service.js on lines 2..30
      myems-admin/app/services/settings/space/spaceenergystoragepowerstation.service.js on lines 2..30
      myems-admin/app/services/settings/space/spaceequipment.service.js on lines 2..30
      myems-admin/app/services/settings/space/spacepoint.service.js on lines 2..30
      myems-admin/app/services/settings/space/spacesensor.service.js on lines 2..30
      myems-admin/app/services/settings/space/spaceshopfloor.service.js on lines 2..30
      myems-admin/app/services/settings/space/spacestore.service.js on lines 2..30
      myems-admin/app/services/settings/space/spacetenant.service.js on lines 2..30
      myems-admin/app/services/settings/store/storecommand.service.js on lines 2..30
      myems-admin/app/services/settings/store/storepoint.service.js on lines 2..30
      myems-admin/app/services/settings/store/storesensor.service.js on lines 2..30
      myems-admin/app/services/settings/tenant/tenantcommand.service.js on lines 2..30
      myems-admin/app/services/settings/tenant/tenantpoint.service.js on lines 2..30
      myems-admin/app/services/settings/tenant/tenantsensor.service.js on lines 2..30
      myems-admin/app/services/settings/virtualpowerplant/virtualpowerplantmicrogrid.service.js on lines 2..30

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

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

      app.factory('SpaceTenantService', function($http) {
          return {
              addPair: function(spaceID,tenantID, headers, callback) {
                  $http.post(getAPI()+'spaces/'+spaceID+'/tenants',{data:{'tenant_id':tenantID}}, {headers})
                  .then(function (response) {
      myems-admin/app/services/settings/combinedequipment/combinedequipmentcommand.service.js on lines 2..30
      myems-admin/app/services/settings/combinedequipment/combinedequipmentequipment.service.js on lines 2..30
      myems-admin/app/services/settings/costcenter/costcentertariff.service.js on lines 2..29
      myems-admin/app/services/settings/distributionsystem/distributioncircuitpoint.service.js on lines 2..30
      myems-admin/app/services/settings/energystoragepowerstation/energystoragepowerstationcontainer.service.js on lines 2..30
      myems-admin/app/services/settings/energystoragepowerstation/energystoragepowerstationuser.service.js on lines 2..30
      myems-admin/app/services/settings/equipment/equipmentcommand.service.js on lines 2..30
      myems-admin/app/services/settings/meter/metercommand.service.js on lines 2..30
      myems-admin/app/services/settings/meter/meterpoint.service.js on lines 2..30
      myems-admin/app/services/settings/microgrid/microgridsensor.service.js on lines 2..30
      myems-admin/app/services/settings/microgrid/microgriduser.service.js on lines 2..30
      myems-admin/app/services/settings/sensor/sensorpoint.service.js on lines 2..30
      myems-admin/app/services/settings/shopfloor/shopfloorcommand.service.js on lines 2..30
      myems-admin/app/services/settings/shopfloor/shopfloorequipment.service.js on lines 2..30
      myems-admin/app/services/settings/shopfloor/shopfloorpoint.service.js on lines 2..30
      myems-admin/app/services/settings/shopfloor/shopfloorsensor.service.js on lines 2..30
      myems-admin/app/services/settings/space/spacecombinedequipment.service.js on lines 2..30
      myems-admin/app/services/settings/space/spacecommand.service.js on lines 2..30
      myems-admin/app/services/settings/space/spaceenergyflowdiagram.service.js on lines 2..30
      myems-admin/app/services/settings/space/spaceenergystoragepowerstation.service.js on lines 2..30
      myems-admin/app/services/settings/space/spaceequipment.service.js on lines 2..30
      myems-admin/app/services/settings/space/spacepoint.service.js on lines 2..30
      myems-admin/app/services/settings/space/spacesensor.service.js on lines 2..30
      myems-admin/app/services/settings/space/spaceshopfloor.service.js on lines 2..30
      myems-admin/app/services/settings/space/spacestore.service.js on lines 2..30
      myems-admin/app/services/settings/store/storecommand.service.js on lines 2..30
      myems-admin/app/services/settings/store/storepoint.service.js on lines 2..30
      myems-admin/app/services/settings/store/storesensor.service.js on lines 2..30
      myems-admin/app/services/settings/tenant/tenantcommand.service.js on lines 2..30
      myems-admin/app/services/settings/tenant/tenantpoint.service.js on lines 2..30
      myems-admin/app/services/settings/tenant/tenantsensor.service.js on lines 2..30
      myems-admin/app/services/settings/virtualpowerplant/virtualpowerplantmicrogrid.service.js on lines 2..30

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

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

      app.factory('CostCenterTariffService', function($http) {
          return {
              addPair: function(costcenterid, tariffid, headers, callback ) {
                  $http.post(getAPI()+'costcenters/'+costcenterid+'/tariffs',{data:{'tariff_id':tariffid}}, {headers})
                  .then(function (response) {
      myems-admin/app/services/settings/combinedequipment/combinedequipmentcommand.service.js on lines 2..30
      myems-admin/app/services/settings/combinedequipment/combinedequipmentequipment.service.js on lines 2..30
      myems-admin/app/services/settings/distributionsystem/distributioncircuitpoint.service.js on lines 2..30
      myems-admin/app/services/settings/energystoragepowerstation/energystoragepowerstationcontainer.service.js on lines 2..30
      myems-admin/app/services/settings/energystoragepowerstation/energystoragepowerstationuser.service.js on lines 2..30
      myems-admin/app/services/settings/equipment/equipmentcommand.service.js on lines 2..30
      myems-admin/app/services/settings/meter/metercommand.service.js on lines 2..30
      myems-admin/app/services/settings/meter/meterpoint.service.js on lines 2..30
      myems-admin/app/services/settings/microgrid/microgridsensor.service.js on lines 2..30
      myems-admin/app/services/settings/microgrid/microgriduser.service.js on lines 2..30
      myems-admin/app/services/settings/sensor/sensorpoint.service.js on lines 2..30
      myems-admin/app/services/settings/shopfloor/shopfloorcommand.service.js on lines 2..30
      myems-admin/app/services/settings/shopfloor/shopfloorequipment.service.js on lines 2..30
      myems-admin/app/services/settings/shopfloor/shopfloorpoint.service.js on lines 2..30
      myems-admin/app/services/settings/shopfloor/shopfloorsensor.service.js on lines 2..30
      myems-admin/app/services/settings/space/spacecombinedequipment.service.js on lines 2..30
      myems-admin/app/services/settings/space/spacecommand.service.js on lines 2..30
      myems-admin/app/services/settings/space/spaceenergyflowdiagram.service.js on lines 2..30
      myems-admin/app/services/settings/space/spaceenergystoragepowerstation.service.js on lines 2..30
      myems-admin/app/services/settings/space/spaceequipment.service.js on lines 2..30
      myems-admin/app/services/settings/space/spacepoint.service.js on lines 2..30
      myems-admin/app/services/settings/space/spacesensor.service.js on lines 2..30
      myems-admin/app/services/settings/space/spaceshopfloor.service.js on lines 2..30
      myems-admin/app/services/settings/space/spacestore.service.js on lines 2..30
      myems-admin/app/services/settings/space/spacetenant.service.js on lines 2..30
      myems-admin/app/services/settings/store/storecommand.service.js on lines 2..30
      myems-admin/app/services/settings/store/storepoint.service.js on lines 2..30
      myems-admin/app/services/settings/store/storesensor.service.js on lines 2..30
      myems-admin/app/services/settings/tenant/tenantcommand.service.js on lines 2..30
      myems-admin/app/services/settings/tenant/tenantpoint.service.js on lines 2..30
      myems-admin/app/services/settings/tenant/tenantsensor.service.js on lines 2..30
      myems-admin/app/services/settings/virtualpowerplant/virtualpowerplantmicrogrid.service.js on lines 2..30

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

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

      app.factory('DistributionCircuitPointService', function($http) {
          return {
              addPair: function(distributioncircuitID,pointID, headers, callback) {
                  $http.post(getAPI()+'distributioncircuits/'+distributioncircuitID+'/points',{data:{'point_id':pointID}}, {headers})
                  .then(function (response) {
      myems-admin/app/services/settings/combinedequipment/combinedequipmentcommand.service.js on lines 2..30
      myems-admin/app/services/settings/combinedequipment/combinedequipmentequipment.service.js on lines 2..30
      myems-admin/app/services/settings/costcenter/costcentertariff.service.js on lines 2..29
      myems-admin/app/services/settings/energystoragepowerstation/energystoragepowerstationcontainer.service.js on lines 2..30
      myems-admin/app/services/settings/energystoragepowerstation/energystoragepowerstationuser.service.js on lines 2..30
      myems-admin/app/services/settings/equipment/equipmentcommand.service.js on lines 2..30
      myems-admin/app/services/settings/meter/metercommand.service.js on lines 2..30
      myems-admin/app/services/settings/meter/meterpoint.service.js on lines 2..30
      myems-admin/app/services/settings/microgrid/microgridsensor.service.js on lines 2..30
      myems-admin/app/services/settings/microgrid/microgriduser.service.js on lines 2..30
      myems-admin/app/services/settings/sensor/sensorpoint.service.js on lines 2..30
      myems-admin/app/services/settings/shopfloor/shopfloorcommand.service.js on lines 2..30
      myems-admin/app/services/settings/shopfloor/shopfloorequipment.service.js on lines 2..30
      myems-admin/app/services/settings/shopfloor/shopfloorpoint.service.js on lines 2..30
      myems-admin/app/services/settings/shopfloor/shopfloorsensor.service.js on lines 2..30
      myems-admin/app/services/settings/space/spacecombinedequipment.service.js on lines 2..30
      myems-admin/app/services/settings/space/spacecommand.service.js on lines 2..30
      myems-admin/app/services/settings/space/spaceenergyflowdiagram.service.js on lines 2..30
      myems-admin/app/services/settings/space/spaceenergystoragepowerstation.service.js on lines 2..30
      myems-admin/app/services/settings/space/spaceequipment.service.js on lines 2..30
      myems-admin/app/services/settings/space/spacepoint.service.js on lines 2..30
      myems-admin/app/services/settings/space/spacesensor.service.js on lines 2..30
      myems-admin/app/services/settings/space/spaceshopfloor.service.js on lines 2..30
      myems-admin/app/services/settings/space/spacestore.service.js on lines 2..30
      myems-admin/app/services/settings/space/spacetenant.service.js on lines 2..30
      myems-admin/app/services/settings/store/storecommand.service.js on lines 2..30
      myems-admin/app/services/settings/store/storepoint.service.js on lines 2..30
      myems-admin/app/services/settings/store/storesensor.service.js on lines 2..30
      myems-admin/app/services/settings/tenant/tenantcommand.service.js on lines 2..30
      myems-admin/app/services/settings/tenant/tenantpoint.service.js on lines 2..30
      myems-admin/app/services/settings/tenant/tenantsensor.service.js on lines 2..30
      myems-admin/app/services/settings/virtualpowerplant/virtualpowerplantmicrogrid.service.js on lines 2..30

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

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

      app.factory('SpaceCombinedEquipmentService', function($http) {
          return {
              addPair: function(spaceID,combinedequipmentID, headers, callback) {
                  $http.post(getAPI()+'spaces/'+spaceID+'/combinedequipments',{data:{'combined_equipment_id':combinedequipmentID}}, {headers})
                  .then(function (response) {
      myems-admin/app/services/settings/combinedequipment/combinedequipmentcommand.service.js on lines 2..30
      myems-admin/app/services/settings/combinedequipment/combinedequipmentequipment.service.js on lines 2..30
      myems-admin/app/services/settings/costcenter/costcentertariff.service.js on lines 2..29
      myems-admin/app/services/settings/distributionsystem/distributioncircuitpoint.service.js on lines 2..30
      myems-admin/app/services/settings/energystoragepowerstation/energystoragepowerstationcontainer.service.js on lines 2..30
      myems-admin/app/services/settings/energystoragepowerstation/energystoragepowerstationuser.service.js on lines 2..30
      myems-admin/app/services/settings/equipment/equipmentcommand.service.js on lines 2..30
      myems-admin/app/services/settings/meter/metercommand.service.js on lines 2..30
      myems-admin/app/services/settings/meter/meterpoint.service.js on lines 2..30
      myems-admin/app/services/settings/microgrid/microgridsensor.service.js on lines 2..30
      myems-admin/app/services/settings/microgrid/microgriduser.service.js on lines 2..30
      myems-admin/app/services/settings/sensor/sensorpoint.service.js on lines 2..30
      myems-admin/app/services/settings/shopfloor/shopfloorcommand.service.js on lines 2..30
      myems-admin/app/services/settings/shopfloor/shopfloorequipment.service.js on lines 2..30
      myems-admin/app/services/settings/shopfloor/shopfloorpoint.service.js on lines 2..30
      myems-admin/app/services/settings/shopfloor/shopfloorsensor.service.js on lines 2..30
      myems-admin/app/services/settings/space/spacecommand.service.js on lines 2..30
      myems-admin/app/services/settings/space/spaceenergyflowdiagram.service.js on lines 2..30
      myems-admin/app/services/settings/space/spaceenergystoragepowerstation.service.js on lines 2..30
      myems-admin/app/services/settings/space/spaceequipment.service.js on lines 2..30
      myems-admin/app/services/settings/space/spacepoint.service.js on lines 2..30
      myems-admin/app/services/settings/space/spacesensor.service.js on lines 2..30
      myems-admin/app/services/settings/space/spaceshopfloor.service.js on lines 2..30
      myems-admin/app/services/settings/space/spacestore.service.js on lines 2..30
      myems-admin/app/services/settings/space/spacetenant.service.js on lines 2..30
      myems-admin/app/services/settings/store/storecommand.service.js on lines 2..30
      myems-admin/app/services/settings/store/storepoint.service.js on lines 2..30
      myems-admin/app/services/settings/store/storesensor.service.js on lines 2..30
      myems-admin/app/services/settings/tenant/tenantcommand.service.js on lines 2..30
      myems-admin/app/services/settings/tenant/tenantpoint.service.js on lines 2..30
      myems-admin/app/services/settings/tenant/tenantsensor.service.js on lines 2..30
      myems-admin/app/services/settings/virtualpowerplant/virtualpowerplantmicrogrid.service.js on lines 2..30

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

      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