Showing 10,536 of 10,536 total issues

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

    $scope.addCombinedEquipment = function () {
        var modalInstance = $uibModal.open({
            templateUrl: 'views/settings/combinedequipment/combinedequipment.model.html',
            controller: 'ModalAddCombinedEquipmentCtrl',
            windowClass: "animated fadeIn",
myems-admin/app/controllers/settings/equipment/equipment.controller.js on lines 51..94

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

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

Function qrcode has 528 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  var qrcode = function(typeNumber, errorCorrectionLevel) {

    var PAD0 = 0xEC;
    var PAD1 = 0x11;

Severity: Major
Found in myems-admin/js/angular/qrcode.js - About 2 days to fix

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

      useEffect(() => {
        let isResponseOK = false;
        let user_uuid = getCookieValue('user_uuid');
        let token = getCookieValue('token');
        if (checkEmpty(token) || checkEmpty(user_uuid)) return;
    Severity: Major
    Found in myems-web/src/components/navbar/NavbarTopDropDownMenus.js and 1 other location - About 2 days to fix
    myems-web/src/components/navbar/NavbarVertical.js on lines 95..147

    Duplicated Code

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

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

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

    Tuning

    This issue has a mass of 456.

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

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

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

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

    Refactorings

    Further Reading

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

      useEffect(() => {
        let isResponseOK = false;
        let user_uuid = getCookieValue('user_uuid');
        let token = getCookieValue('token');
        if (checkEmpty(token) || checkEmpty(user_uuid)) return;
    Severity: Major
    Found in myems-web/src/components/navbar/NavbarVertical.js and 1 other location - About 2 days to fix
    myems-web/src/components/navbar/NavbarTopDropDownMenus.js on lines 70..121

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

    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

    Function generate_excel has a Cognitive Complexity of 129 (exceeds 5 allowed). Consider refactoring.
    Open

    def generate_excel(report,
                       name,
                       base_period_start_datetime_local,
                       base_period_end_datetime_local,
                       reporting_start_datetime_local,
    Severity: Minor
    Found in myems-api/excelexporters/storeenergyitem.py - About 2 days to fix

    Cognitive Complexity

    Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

    A method's cognitive complexity is based on a few simple rules:

    • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
    • Code is considered more complex for each "break in the linear flow of the code"
    • Code is considered more complex when "flow breaking structures are nested"

    Further reading

    Function generate_excel has a Cognitive Complexity of 129 (exceeds 5 allowed). Consider refactoring.
    Open

    def generate_excel(report,
                       name,
                       base_period_start_datetime_local,
                       base_period_end_datetime_local,
                       reporting_start_datetime_local,
    Severity: Minor
    Found in myems-api/excelexporters/tenantenergyitem.py - About 2 days to fix

    Cognitive Complexity

    Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

    A method's cognitive complexity is based on a few simple rules:

    • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
    • Code is considered more complex for each "break in the linear flow of the code"
    • Code is considered more complex when "flow breaking structures are nested"

    Further reading

    Function generate_excel has a Cognitive Complexity of 129 (exceeds 5 allowed). Consider refactoring.
    Open

    def generate_excel(report,
                       name,
                       base_period_start_datetime_local,
                       base_period_end_datetime_local,
                       reporting_start_datetime_local,
    Severity: Minor
    Found in myems-api/excelexporters/shopfloorenergyitem.py - About 2 days to fix

    Cognitive Complexity

    Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

    A method's cognitive complexity is based on a few simple rules:

    • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
    • Code is considered more complex for each "break in the linear flow of the code"
    • Code is considered more complex when "flow breaking structures are nested"

    Further reading

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

    app.factory('EnergyStorageContainerGridService', function($http) {
        return {
            getAllEnergyStorageContainerGrids: function(headers, callback) {
                $http.get(getAPI()+'energystoragecontainergrids', {headers})
                .then(function (response) {
    myems-admin/app/services/settings/energystoragecontainer/energystoragecontainerbattery.service.js on lines 2..46
    myems-admin/app/services/settings/energystoragecontainer/energystoragecontainerfirecontrol.service.js on lines 2..45
    myems-admin/app/services/settings/energystoragecontainer/energystoragecontainerhvac.service.js on lines 2..45
    myems-admin/app/services/settings/energystoragecontainer/energystoragecontainerload.service.js on lines 2..45
    myems-admin/app/services/settings/energystoragecontainer/energystoragecontainerpowerconversionsystem.service.js on lines 2..45
    myems-admin/app/services/settings/energystoragecontainer/energystoragecontainerschedule.service.js on lines 2..45
    myems-admin/app/services/settings/microgrid/microgridbattery.service.js on lines 2..46
    myems-admin/app/services/settings/microgrid/microgridevcharger.service.js on lines 2..46
    myems-admin/app/services/settings/microgrid/microgridgenerator.service.js on lines 2..45
    myems-admin/app/services/settings/microgrid/microgridgrid.service.js on lines 2..45
    myems-admin/app/services/settings/microgrid/microgridheatpump.service.js on lines 2..46
    myems-admin/app/services/settings/microgrid/microgridload.service.js on lines 2..45
    myems-admin/app/services/settings/microgrid/microgridphotovoltaic.service.js on lines 2..45
    myems-admin/app/services/settings/microgrid/microgridpowerconversionsystem.service.js on lines 2..45

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

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

    app.factory('MicrogridGeneratorService', function($http) {
        return {
            getAllMicrogridGenerators: function(headers, callback) {
                $http.get(getAPI()+'microgridgenerators', {headers})
                .then(function (response) {
    myems-admin/app/services/settings/energystoragecontainer/energystoragecontainerbattery.service.js on lines 2..46
    myems-admin/app/services/settings/energystoragecontainer/energystoragecontainerfirecontrol.service.js on lines 2..45
    myems-admin/app/services/settings/energystoragecontainer/energystoragecontainergrid.service.js on lines 2..45
    myems-admin/app/services/settings/energystoragecontainer/energystoragecontainerhvac.service.js on lines 2..45
    myems-admin/app/services/settings/energystoragecontainer/energystoragecontainerload.service.js on lines 2..45
    myems-admin/app/services/settings/energystoragecontainer/energystoragecontainerpowerconversionsystem.service.js on lines 2..45
    myems-admin/app/services/settings/energystoragecontainer/energystoragecontainerschedule.service.js on lines 2..45
    myems-admin/app/services/settings/microgrid/microgridbattery.service.js on lines 2..46
    myems-admin/app/services/settings/microgrid/microgridevcharger.service.js on lines 2..46
    myems-admin/app/services/settings/microgrid/microgridgrid.service.js on lines 2..45
    myems-admin/app/services/settings/microgrid/microgridheatpump.service.js on lines 2..46
    myems-admin/app/services/settings/microgrid/microgridload.service.js on lines 2..45
    myems-admin/app/services/settings/microgrid/microgridphotovoltaic.service.js on lines 2..45
    myems-admin/app/services/settings/microgrid/microgridpowerconversionsystem.service.js on lines 2..45

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

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

    app.factory('MicrogridLoadService', function($http) {
        return {
            getAllMicrogridLoads: function(headers, callback) {
                $http.get(getAPI()+'microgridloads', {headers})
                .then(function (response) {
    myems-admin/app/services/settings/energystoragecontainer/energystoragecontainerbattery.service.js on lines 2..46
    myems-admin/app/services/settings/energystoragecontainer/energystoragecontainerfirecontrol.service.js on lines 2..45
    myems-admin/app/services/settings/energystoragecontainer/energystoragecontainergrid.service.js on lines 2..45
    myems-admin/app/services/settings/energystoragecontainer/energystoragecontainerhvac.service.js on lines 2..45
    myems-admin/app/services/settings/energystoragecontainer/energystoragecontainerload.service.js on lines 2..45
    myems-admin/app/services/settings/energystoragecontainer/energystoragecontainerpowerconversionsystem.service.js on lines 2..45
    myems-admin/app/services/settings/energystoragecontainer/energystoragecontainerschedule.service.js on lines 2..45
    myems-admin/app/services/settings/microgrid/microgridbattery.service.js on lines 2..46
    myems-admin/app/services/settings/microgrid/microgridevcharger.service.js on lines 2..46
    myems-admin/app/services/settings/microgrid/microgridgenerator.service.js on lines 2..45
    myems-admin/app/services/settings/microgrid/microgridgrid.service.js on lines 2..45
    myems-admin/app/services/settings/microgrid/microgridheatpump.service.js on lines 2..46
    myems-admin/app/services/settings/microgrid/microgridphotovoltaic.service.js on lines 2..45
    myems-admin/app/services/settings/microgrid/microgridpowerconversionsystem.service.js on lines 2..45

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

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

    app.factory('EnergyStorageContainerLoadService', function($http) {
        return {
            getAllEnergyStorageContainerLoads: function(headers, callback) {
                $http.get(getAPI()+'energystoragecontainerloads', {headers})
                .then(function (response) {
    myems-admin/app/services/settings/energystoragecontainer/energystoragecontainerbattery.service.js on lines 2..46
    myems-admin/app/services/settings/energystoragecontainer/energystoragecontainerfirecontrol.service.js on lines 2..45
    myems-admin/app/services/settings/energystoragecontainer/energystoragecontainergrid.service.js on lines 2..45
    myems-admin/app/services/settings/energystoragecontainer/energystoragecontainerhvac.service.js on lines 2..45
    myems-admin/app/services/settings/energystoragecontainer/energystoragecontainerpowerconversionsystem.service.js on lines 2..45
    myems-admin/app/services/settings/energystoragecontainer/energystoragecontainerschedule.service.js on lines 2..45
    myems-admin/app/services/settings/microgrid/microgridbattery.service.js on lines 2..46
    myems-admin/app/services/settings/microgrid/microgridevcharger.service.js on lines 2..46
    myems-admin/app/services/settings/microgrid/microgridgenerator.service.js on lines 2..45
    myems-admin/app/services/settings/microgrid/microgridgrid.service.js on lines 2..45
    myems-admin/app/services/settings/microgrid/microgridheatpump.service.js on lines 2..46
    myems-admin/app/services/settings/microgrid/microgridload.service.js on lines 2..45
    myems-admin/app/services/settings/microgrid/microgridphotovoltaic.service.js on lines 2..45
    myems-admin/app/services/settings/microgrid/microgridpowerconversionsystem.service.js on lines 2..45

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

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

    app.factory('MicrogridHeatpumpService', function($http) {
        return {
            getAllMicrogridHeatpumps: function(headers, callback) {
                $http.get(getAPI()+'microgridheatpumps', {headers})
                .then(function (response) {
    myems-admin/app/services/settings/energystoragecontainer/energystoragecontainerbattery.service.js on lines 2..46
    myems-admin/app/services/settings/energystoragecontainer/energystoragecontainerfirecontrol.service.js on lines 2..45
    myems-admin/app/services/settings/energystoragecontainer/energystoragecontainergrid.service.js on lines 2..45
    myems-admin/app/services/settings/energystoragecontainer/energystoragecontainerhvac.service.js on lines 2..45
    myems-admin/app/services/settings/energystoragecontainer/energystoragecontainerload.service.js on lines 2..45
    myems-admin/app/services/settings/energystoragecontainer/energystoragecontainerpowerconversionsystem.service.js on lines 2..45
    myems-admin/app/services/settings/energystoragecontainer/energystoragecontainerschedule.service.js on lines 2..45
    myems-admin/app/services/settings/microgrid/microgridbattery.service.js on lines 2..46
    myems-admin/app/services/settings/microgrid/microgridevcharger.service.js on lines 2..46
    myems-admin/app/services/settings/microgrid/microgridgenerator.service.js on lines 2..45
    myems-admin/app/services/settings/microgrid/microgridgrid.service.js on lines 2..45
    myems-admin/app/services/settings/microgrid/microgridload.service.js on lines 2..45
    myems-admin/app/services/settings/microgrid/microgridphotovoltaic.service.js on lines 2..45
    myems-admin/app/services/settings/microgrid/microgridpowerconversionsystem.service.js on lines 2..45

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

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

    app.factory('MicrogridGridService', function($http) {
        return {
            getAllMicrogridGrids: function(headers, callback) {
                $http.get(getAPI()+'microgridgrids', {headers})
                .then(function (response) {
    myems-admin/app/services/settings/energystoragecontainer/energystoragecontainerbattery.service.js on lines 2..46
    myems-admin/app/services/settings/energystoragecontainer/energystoragecontainerfirecontrol.service.js on lines 2..45
    myems-admin/app/services/settings/energystoragecontainer/energystoragecontainergrid.service.js on lines 2..45
    myems-admin/app/services/settings/energystoragecontainer/energystoragecontainerhvac.service.js on lines 2..45
    myems-admin/app/services/settings/energystoragecontainer/energystoragecontainerload.service.js on lines 2..45
    myems-admin/app/services/settings/energystoragecontainer/energystoragecontainerpowerconversionsystem.service.js on lines 2..45
    myems-admin/app/services/settings/energystoragecontainer/energystoragecontainerschedule.service.js on lines 2..45
    myems-admin/app/services/settings/microgrid/microgridbattery.service.js on lines 2..46
    myems-admin/app/services/settings/microgrid/microgridevcharger.service.js on lines 2..46
    myems-admin/app/services/settings/microgrid/microgridgenerator.service.js on lines 2..45
    myems-admin/app/services/settings/microgrid/microgridheatpump.service.js on lines 2..46
    myems-admin/app/services/settings/microgrid/microgridload.service.js on lines 2..45
    myems-admin/app/services/settings/microgrid/microgridphotovoltaic.service.js on lines 2..45
    myems-admin/app/services/settings/microgrid/microgridpowerconversionsystem.service.js on lines 2..45

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

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

    app.factory('MicrogridEVChargerService', function($http) {
        return {
            getAllMicrogridEVChargers: function(headers, callback) {
                $http.get(getAPI()+'microgridevchargers', {headers})
                .then(function (response) {
    myems-admin/app/services/settings/energystoragecontainer/energystoragecontainerbattery.service.js on lines 2..46
    myems-admin/app/services/settings/energystoragecontainer/energystoragecontainerfirecontrol.service.js on lines 2..45
    myems-admin/app/services/settings/energystoragecontainer/energystoragecontainergrid.service.js on lines 2..45
    myems-admin/app/services/settings/energystoragecontainer/energystoragecontainerhvac.service.js on lines 2..45
    myems-admin/app/services/settings/energystoragecontainer/energystoragecontainerload.service.js on lines 2..45
    myems-admin/app/services/settings/energystoragecontainer/energystoragecontainerpowerconversionsystem.service.js on lines 2..45
    myems-admin/app/services/settings/energystoragecontainer/energystoragecontainerschedule.service.js on lines 2..45
    myems-admin/app/services/settings/microgrid/microgridbattery.service.js on lines 2..46
    myems-admin/app/services/settings/microgrid/microgridgenerator.service.js on lines 2..45
    myems-admin/app/services/settings/microgrid/microgridgrid.service.js on lines 2..45
    myems-admin/app/services/settings/microgrid/microgridheatpump.service.js on lines 2..46
    myems-admin/app/services/settings/microgrid/microgridload.service.js on lines 2..45
    myems-admin/app/services/settings/microgrid/microgridphotovoltaic.service.js on lines 2..45
    myems-admin/app/services/settings/microgrid/microgridpowerconversionsystem.service.js on lines 2..45

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

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

    app.factory('EnergyStorageContainerPowerconversionsystemService', function($http) {
        return {
            getAllEnergyStorageContainerPowerconversionsystems: function(headers, callback) {
                $http.get(getAPI()+'energystoragecontainerpowerconversionsystems', {headers})
                .then(function (response) {
    myems-admin/app/services/settings/energystoragecontainer/energystoragecontainerbattery.service.js on lines 2..46
    myems-admin/app/services/settings/energystoragecontainer/energystoragecontainerfirecontrol.service.js on lines 2..45
    myems-admin/app/services/settings/energystoragecontainer/energystoragecontainergrid.service.js on lines 2..45
    myems-admin/app/services/settings/energystoragecontainer/energystoragecontainerhvac.service.js on lines 2..45
    myems-admin/app/services/settings/energystoragecontainer/energystoragecontainerload.service.js on lines 2..45
    myems-admin/app/services/settings/energystoragecontainer/energystoragecontainerschedule.service.js on lines 2..45
    myems-admin/app/services/settings/microgrid/microgridbattery.service.js on lines 2..46
    myems-admin/app/services/settings/microgrid/microgridevcharger.service.js on lines 2..46
    myems-admin/app/services/settings/microgrid/microgridgenerator.service.js on lines 2..45
    myems-admin/app/services/settings/microgrid/microgridgrid.service.js on lines 2..45
    myems-admin/app/services/settings/microgrid/microgridheatpump.service.js on lines 2..46
    myems-admin/app/services/settings/microgrid/microgridload.service.js on lines 2..45
    myems-admin/app/services/settings/microgrid/microgridphotovoltaic.service.js on lines 2..45
    myems-admin/app/services/settings/microgrid/microgridpowerconversionsystem.service.js on lines 2..45

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

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

    app.factory('EnergyStorageContainerScheduleService', function($http) {
        return {
            getAllEnergyStorageContainerSchedules: function(headers, callback) {
                $http.get(getAPI()+'energystoragecontainerschedules', {headers})
                .then(function (response) {
    myems-admin/app/services/settings/energystoragecontainer/energystoragecontainerbattery.service.js on lines 2..46
    myems-admin/app/services/settings/energystoragecontainer/energystoragecontainerfirecontrol.service.js on lines 2..45
    myems-admin/app/services/settings/energystoragecontainer/energystoragecontainergrid.service.js on lines 2..45
    myems-admin/app/services/settings/energystoragecontainer/energystoragecontainerhvac.service.js on lines 2..45
    myems-admin/app/services/settings/energystoragecontainer/energystoragecontainerload.service.js on lines 2..45
    myems-admin/app/services/settings/energystoragecontainer/energystoragecontainerpowerconversionsystem.service.js on lines 2..45
    myems-admin/app/services/settings/microgrid/microgridbattery.service.js on lines 2..46
    myems-admin/app/services/settings/microgrid/microgridevcharger.service.js on lines 2..46
    myems-admin/app/services/settings/microgrid/microgridgenerator.service.js on lines 2..45
    myems-admin/app/services/settings/microgrid/microgridgrid.service.js on lines 2..45
    myems-admin/app/services/settings/microgrid/microgridheatpump.service.js on lines 2..46
    myems-admin/app/services/settings/microgrid/microgridload.service.js on lines 2..45
    myems-admin/app/services/settings/microgrid/microgridphotovoltaic.service.js on lines 2..45
    myems-admin/app/services/settings/microgrid/microgridpowerconversionsystem.service.js on lines 2..45

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

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

    app.factory('MicrogridPhotovoltaicService', function($http) {
        return {
            getAllMicrogridPhotovoltaics: function(headers, callback) {
                $http.get(getAPI()+'microgridphotovoltaics', {headers})
                .then(function (response) {
    myems-admin/app/services/settings/energystoragecontainer/energystoragecontainerbattery.service.js on lines 2..46
    myems-admin/app/services/settings/energystoragecontainer/energystoragecontainerfirecontrol.service.js on lines 2..45
    myems-admin/app/services/settings/energystoragecontainer/energystoragecontainergrid.service.js on lines 2..45
    myems-admin/app/services/settings/energystoragecontainer/energystoragecontainerhvac.service.js on lines 2..45
    myems-admin/app/services/settings/energystoragecontainer/energystoragecontainerload.service.js on lines 2..45
    myems-admin/app/services/settings/energystoragecontainer/energystoragecontainerpowerconversionsystem.service.js on lines 2..45
    myems-admin/app/services/settings/energystoragecontainer/energystoragecontainerschedule.service.js on lines 2..45
    myems-admin/app/services/settings/microgrid/microgridbattery.service.js on lines 2..46
    myems-admin/app/services/settings/microgrid/microgridevcharger.service.js on lines 2..46
    myems-admin/app/services/settings/microgrid/microgridgenerator.service.js on lines 2..45
    myems-admin/app/services/settings/microgrid/microgridgrid.service.js on lines 2..45
    myems-admin/app/services/settings/microgrid/microgridheatpump.service.js on lines 2..46
    myems-admin/app/services/settings/microgrid/microgridload.service.js on lines 2..45
    myems-admin/app/services/settings/microgrid/microgridpowerconversionsystem.service.js on lines 2..45

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

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

    app.factory('MicrogridBatteryService', function($http) {
        return {
            getAllMicrogridBatteries: function(headers, callback) {
                $http.get(getAPI()+'microgridbatteries', {headers})
                .then(function (response) {
    myems-admin/app/services/settings/energystoragecontainer/energystoragecontainerbattery.service.js on lines 2..46
    myems-admin/app/services/settings/energystoragecontainer/energystoragecontainerfirecontrol.service.js on lines 2..45
    myems-admin/app/services/settings/energystoragecontainer/energystoragecontainergrid.service.js on lines 2..45
    myems-admin/app/services/settings/energystoragecontainer/energystoragecontainerhvac.service.js on lines 2..45
    myems-admin/app/services/settings/energystoragecontainer/energystoragecontainerload.service.js on lines 2..45
    myems-admin/app/services/settings/energystoragecontainer/energystoragecontainerpowerconversionsystem.service.js on lines 2..45
    myems-admin/app/services/settings/energystoragecontainer/energystoragecontainerschedule.service.js on lines 2..45
    myems-admin/app/services/settings/microgrid/microgridevcharger.service.js on lines 2..46
    myems-admin/app/services/settings/microgrid/microgridgenerator.service.js on lines 2..45
    myems-admin/app/services/settings/microgrid/microgridgrid.service.js on lines 2..45
    myems-admin/app/services/settings/microgrid/microgridheatpump.service.js on lines 2..46
    myems-admin/app/services/settings/microgrid/microgridload.service.js on lines 2..45
    myems-admin/app/services/settings/microgrid/microgridphotovoltaic.service.js on lines 2..45
    myems-admin/app/services/settings/microgrid/microgridpowerconversionsystem.service.js on lines 2..45

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

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

    app.factory('EnergyStorageContainerHVACService', function($http) {
        return {
            getAllEnergyStorageContainerHVACs: function(headers, callback) {
                $http.get(getAPI()+'energystoragecontainerhvacs', {headers})
                .then(function (response) {
    myems-admin/app/services/settings/energystoragecontainer/energystoragecontainerbattery.service.js on lines 2..46
    myems-admin/app/services/settings/energystoragecontainer/energystoragecontainerfirecontrol.service.js on lines 2..45
    myems-admin/app/services/settings/energystoragecontainer/energystoragecontainergrid.service.js on lines 2..45
    myems-admin/app/services/settings/energystoragecontainer/energystoragecontainerload.service.js on lines 2..45
    myems-admin/app/services/settings/energystoragecontainer/energystoragecontainerpowerconversionsystem.service.js on lines 2..45
    myems-admin/app/services/settings/energystoragecontainer/energystoragecontainerschedule.service.js on lines 2..45
    myems-admin/app/services/settings/microgrid/microgridbattery.service.js on lines 2..46
    myems-admin/app/services/settings/microgrid/microgridevcharger.service.js on lines 2..46
    myems-admin/app/services/settings/microgrid/microgridgenerator.service.js on lines 2..45
    myems-admin/app/services/settings/microgrid/microgridgrid.service.js on lines 2..45
    myems-admin/app/services/settings/microgrid/microgridheatpump.service.js on lines 2..46
    myems-admin/app/services/settings/microgrid/microgridload.service.js on lines 2..45
    myems-admin/app/services/settings/microgrid/microgridphotovoltaic.service.js on lines 2..45
    myems-admin/app/services/settings/microgrid/microgridpowerconversionsystem.service.js on lines 2..45

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

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

    app.factory('MicrogridPowerconversionsystemService', function($http) {
        return {
            getAllMicrogridPowerconversionsystems: function(headers, callback) {
                $http.get(getAPI()+'microgridpowerconversionsystems', {headers})
                .then(function (response) {
    myems-admin/app/services/settings/energystoragecontainer/energystoragecontainerbattery.service.js on lines 2..46
    myems-admin/app/services/settings/energystoragecontainer/energystoragecontainerfirecontrol.service.js on lines 2..45
    myems-admin/app/services/settings/energystoragecontainer/energystoragecontainergrid.service.js on lines 2..45
    myems-admin/app/services/settings/energystoragecontainer/energystoragecontainerhvac.service.js on lines 2..45
    myems-admin/app/services/settings/energystoragecontainer/energystoragecontainerload.service.js on lines 2..45
    myems-admin/app/services/settings/energystoragecontainer/energystoragecontainerpowerconversionsystem.service.js on lines 2..45
    myems-admin/app/services/settings/energystoragecontainer/energystoragecontainerschedule.service.js on lines 2..45
    myems-admin/app/services/settings/microgrid/microgridbattery.service.js on lines 2..46
    myems-admin/app/services/settings/microgrid/microgridevcharger.service.js on lines 2..46
    myems-admin/app/services/settings/microgrid/microgridgenerator.service.js on lines 2..45
    myems-admin/app/services/settings/microgrid/microgridgrid.service.js on lines 2..45
    myems-admin/app/services/settings/microgrid/microgridheatpump.service.js on lines 2..46
    myems-admin/app/services/settings/microgrid/microgridload.service.js on lines 2..45
    myems-admin/app/services/settings/microgrid/microgridphotovoltaic.service.js on lines 2..45

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

    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