Showing 4,753 of 10,532 total issues

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

  useEffect(() => {
    let is_logged_in = getCookieValue('is_logged_in');
    let user_name = getCookieValue('user_name');
    let user_display_name = getCookieValue('user_display_name');
    let user_uuid = getCookieValue('user_uuid');
Severity: Major
Found in myems-web/src/components/MyEMS/auth/ChangePasswordForm.js and 16 other locations - About 7 hrs to fix
myems-web/src/components/MyEMS/AdvancedReporting/AdvancedReporting.js on lines 18..35
myems-web/src/components/MyEMS/AuxiliarySystem/DistributionSystem.js on lines 27..44
myems-web/src/components/MyEMS/AuxiliarySystem/EnergyFlowDiagram.js on lines 34..51
myems-web/src/components/MyEMS/EnergyStoragePowerStation/EnergyStoragePowerStationDetails.js on lines 52..69
myems-web/src/components/MyEMS/EnergyStoragePowerStation/EnergyStoragePowerStationList.js on lines 33..50
myems-web/src/components/MyEMS/Meter/MeterRealtime.js on lines 33..50
myems-web/src/components/MyEMS/Meter/OfflineMeterInput.js on lines 31..48
myems-web/src/components/MyEMS/Microgrid/MicrogridDetails.js on lines 40..57
myems-web/src/components/MyEMS/Microgrid/MicrogridList.js on lines 33..50
myems-web/src/components/MyEMS/Monitoring/CombinedEquipments.js on lines 35..52
myems-web/src/components/MyEMS/Monitoring/SpaceEquipments.js on lines 35..52
myems-web/src/components/MyEMS/Space/EnterProduction.js on lines 32..49
myems-web/src/components/MyEMS/Space/SpaceEnvironmentMonitor.js on lines 33..50
myems-web/src/components/MyEMS/Tenant/TenantBill.js on lines 90..107
myems-web/src/components/navbar/NavbarTopDropDownMenus.js on lines 29..46
myems-web/src/components/navbar/NavbarVertical.js on lines 21..38

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

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

  useEffect(() => {
    let is_logged_in = getCookieValue('is_logged_in');
    let user_name = getCookieValue('user_name');
    let user_display_name = getCookieValue('user_display_name');
    let user_uuid = getCookieValue('user_uuid');
myems-web/src/components/MyEMS/AdvancedReporting/AdvancedReporting.js on lines 18..35
myems-web/src/components/MyEMS/AuxiliarySystem/DistributionSystem.js on lines 27..44
myems-web/src/components/MyEMS/AuxiliarySystem/EnergyFlowDiagram.js on lines 34..51
myems-web/src/components/MyEMS/EnergyStoragePowerStation/EnergyStoragePowerStationDetails.js on lines 52..69
myems-web/src/components/MyEMS/Meter/MeterRealtime.js on lines 33..50
myems-web/src/components/MyEMS/Meter/OfflineMeterInput.js on lines 31..48
myems-web/src/components/MyEMS/Microgrid/MicrogridDetails.js on lines 40..57
myems-web/src/components/MyEMS/Microgrid/MicrogridList.js on lines 33..50
myems-web/src/components/MyEMS/Monitoring/CombinedEquipments.js on lines 35..52
myems-web/src/components/MyEMS/Monitoring/SpaceEquipments.js on lines 35..52
myems-web/src/components/MyEMS/Space/EnterProduction.js on lines 32..49
myems-web/src/components/MyEMS/Space/SpaceEnvironmentMonitor.js on lines 33..50
myems-web/src/components/MyEMS/Tenant/TenantBill.js on lines 90..107
myems-web/src/components/MyEMS/auth/ChangePasswordForm.js on lines 13..30
myems-web/src/components/navbar/NavbarTopDropDownMenus.js on lines 29..46
myems-web/src/components/navbar/NavbarVertical.js on lines 21..38

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

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

  useEffect(() => {
    let is_logged_in = getCookieValue('is_logged_in');
    let user_name = getCookieValue('user_name');
    let user_display_name = getCookieValue('user_display_name');
    let user_uuid = getCookieValue('user_uuid');
Severity: Major
Found in myems-web/src/components/MyEMS/Meter/OfflineMeterInput.js and 16 other locations - About 7 hrs to fix
myems-web/src/components/MyEMS/AdvancedReporting/AdvancedReporting.js on lines 18..35
myems-web/src/components/MyEMS/AuxiliarySystem/DistributionSystem.js on lines 27..44
myems-web/src/components/MyEMS/AuxiliarySystem/EnergyFlowDiagram.js on lines 34..51
myems-web/src/components/MyEMS/EnergyStoragePowerStation/EnergyStoragePowerStationDetails.js on lines 52..69
myems-web/src/components/MyEMS/EnergyStoragePowerStation/EnergyStoragePowerStationList.js on lines 33..50
myems-web/src/components/MyEMS/Meter/MeterRealtime.js on lines 33..50
myems-web/src/components/MyEMS/Microgrid/MicrogridDetails.js on lines 40..57
myems-web/src/components/MyEMS/Microgrid/MicrogridList.js on lines 33..50
myems-web/src/components/MyEMS/Monitoring/CombinedEquipments.js on lines 35..52
myems-web/src/components/MyEMS/Monitoring/SpaceEquipments.js on lines 35..52
myems-web/src/components/MyEMS/Space/EnterProduction.js on lines 32..49
myems-web/src/components/MyEMS/Space/SpaceEnvironmentMonitor.js on lines 33..50
myems-web/src/components/MyEMS/Tenant/TenantBill.js on lines 90..107
myems-web/src/components/MyEMS/auth/ChangePasswordForm.js on lines 13..30
myems-web/src/components/navbar/NavbarTopDropDownMenus.js on lines 29..46
myems-web/src/components/navbar/NavbarVertical.js on lines 21..38

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

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

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

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

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

Refactorings

Further Reading

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

const columns = [
  {
    dataField: 'customer',
    text: '名称',
    formatter: customerFormatter,
Severity: Major
Found in myems-web/src/components/MyEMS/Shopfloor/PurchasesTable.js and 3 other locations - About 7 hrs to fix
myems-web/src/components/MyEMS/Store/PurchasesTable.js on lines 54..101
myems-web/src/components/MyEMS/Tenant/PurchasesTable.js on lines 54..101
myems-web/src/components/dashboard/PurchasesTable.js on lines 54..101

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

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

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

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

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

Refactorings

Further Reading

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

const columns = [
  {
    dataField: 'customer',
    text: 'Customer',
    formatter: customerFormatter,
Severity: Major
Found in myems-web/src/components/dashboard/PurchasesTable.js and 3 other locations - About 7 hrs to fix
myems-web/src/components/MyEMS/Shopfloor/PurchasesTable.js on lines 54..101
myems-web/src/components/MyEMS/Store/PurchasesTable.js on lines 54..101
myems-web/src/components/MyEMS/Tenant/PurchasesTable.js on lines 54..101

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

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

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

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

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

Refactorings

Further Reading

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

const columns = [
  {
    dataField: 'customer',
    text: '名称',
    formatter: customerFormatter,
Severity: Major
Found in myems-web/src/components/MyEMS/Store/PurchasesTable.js and 3 other locations - About 7 hrs to fix
myems-web/src/components/MyEMS/Shopfloor/PurchasesTable.js on lines 54..101
myems-web/src/components/MyEMS/Tenant/PurchasesTable.js on lines 54..101
myems-web/src/components/dashboard/PurchasesTable.js on lines 54..101

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

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

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

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

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

Refactorings

Further Reading

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

const columns = [
  {
    dataField: 'customer',
    text: '名称',
    formatter: customerFormatter,
Severity: Major
Found in myems-web/src/components/MyEMS/Tenant/PurchasesTable.js and 3 other locations - About 7 hrs to fix
myems-web/src/components/MyEMS/Shopfloor/PurchasesTable.js on lines 54..101
myems-web/src/components/MyEMS/Store/PurchasesTable.js on lines 54..101
myems-web/src/components/dashboard/PurchasesTable.js on lines 54..101

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

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

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

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

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

Refactorings

Further Reading

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

        if 'energy_category' not in new_values['data'].keys() or \
                'id' not in new_values['data']['energy_category'].keys() or \
                not isinstance(new_values['data']['energy_category']['id'], int) or \
                new_values['data']['energy_category']['id'] <= 0:
            raise falcon.HTTPError(status=falcon.HTTP_400, title='API.BAD_REQUEST',
Severity: Major
Found in myems-api/core/tariff.py and 1 other location - About 7 hrs to fix
myems-api/core/tariff.py on lines 108..112

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

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

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

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

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

Refactorings

Further Reading

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

        if 'energy_category' not in new_values['data'].keys() or \
                'id' not in new_values['data']['energy_category'].keys() or \
                not isinstance(new_values['data']['energy_category']['id'], int) or \
                new_values['data']['energy_category']['id'] <= 0:
            raise falcon.HTTPError(status=falcon.HTTP_400, title='API.BAD_REQUEST',
Severity: Major
Found in myems-api/core/tariff.py and 1 other location - About 7 hrs to fix
myems-api/core/tariff.py on lines 346..350

Duplicated Code

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

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

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

Tuning

This issue has a mass of 119.

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

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

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

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

Refactorings

Further Reading

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

const Summary = ({ calendar, title, badge, divider, to, children, file_bytes_base64 }) => (
  <Media>
    <Calendar {...calendar} />
    <Media body className="position-relative pl-3">
      <h6 className="fs-0 mb-0">
Severity: Major
Found in myems-web/src/components/MyEMS/AdvancedReporting/Summary.js and 1 other location - About 7 hrs to fix
myems-web/src/components/MyEMS/KnowledgeBase/Summary.js on lines 30..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 189.

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

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

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

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

Refactorings

Further Reading

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

const Summary = ({ calendar, title, badge, divider, to, children, file_bytes_base64 }) => (
  <Media>
    <Calendar {...calendar} />
    <Media body className="position-relative pl-3">
      <h6 className="fs-0 mb-0">
Severity: Major
Found in myems-web/src/components/MyEMS/KnowledgeBase/Summary.js and 1 other location - About 7 hrs to fix
myems-web/src/components/MyEMS/AdvancedReporting/Summary.js on lines 30..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 189.

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

    <Row noGutters>
      <Col lg className="mb-4 mb-lg-0 pr-lg-2">
        <Card>
          <FalconCardHeader title="Pie Chart" />
          <CardBody>
Severity: Major
Found in myems-web/src/components/plugins/Chart.js and 1 other location - About 7 hrs to fix
myems-web/src/components/plugins/Chart.js on lines 194..211

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

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

    <Row noGutters className="mt-3">
      <Col lg className="mb-4 mb-lg-0 pr-lg-2">
        <Card>
          <FalconCardHeader title="Bar Chart" />
          <CardBody>
Severity: Major
Found in myems-web/src/components/plugins/Chart.js and 1 other location - About 7 hrs to fix
myems-web/src/components/plugins/Chart.js on lines 175..192

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

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

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

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

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

Refactorings

Further Reading

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

      this.callDragEnter = function(a) {
        angular.isDefined(c.events) && c.events.dragEnter
          ? c.events.dragEnter({
              event: a.event,
              sourceTree: a.sourceTree,
Severity: Major
Found in myems-admin/js/jcui/angular.integralui.treeview.min.js and 1 other location - About 7 hrs to fix
myems-admin/js/jcui/angular.integralui.treeview.min.js on lines 1513..1533

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

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

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

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

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

Refactorings

Further Reading

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

      this.callDragLeave = function(a) {
        angular.isDefined(c.events) && c.events.dragLeave
          ? c.events.dragLeave({
              event: a.event,
              sourceTree: a.sourceTree,
Severity: Major
Found in myems-admin/js/jcui/angular.integralui.treeview.min.js and 1 other location - About 7 hrs to fix
myems-admin/js/jcui/angular.integralui.treeview.min.js on lines 1442..1462

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

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

      <Card>
        <CardBody className={classNames({ 'p-0  overflow-hidden': isList, 'pb-0': isGrid })}>
          {loading ? (
            <Loader />
          ) : (
Severity: Major
Found in myems-web/src/components/MyEMS/Monitoring/SpaceEquipments.js and 1 other location - About 7 hrs to fix
myems-web/src/components/MyEMS/Monitoring/CombinedEquipments.js on lines 320..336

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

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

      <Card>
        <CardBody className={classNames({ 'p-0  overflow-hidden': isList, 'pb-0': isGrid })}>
          {loading ? (
            <Loader />
          ) : (
myems-web/src/components/MyEMS/Monitoring/SpaceEquipments.js on lines 209..225

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

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

        if 'meter_uuid' in new_values['data'].keys():
            if new_values['data']['meter_uuid'] is not None and \
                    isinstance(new_values['data']['meter_uuid'], str) and \
                    len(str.strip(new_values['data']['meter_uuid'])) > 0:
                meter_uuid = str.strip(new_values['data']['meter_uuid'])
Severity: Major
Found in myems-api/core/energyflowdiagram.py and 14 other locations - About 7 hrs to fix
myems-api/core/combinedequipment.py on lines 948..952
myems-api/core/combinedequipment.py on lines 963..967
myems-api/core/combinedequipment.py on lines 970..974
myems-api/core/combinedequipment.py on lines 1328..1332
myems-api/core/combinedequipment.py on lines 1343..1347
myems-api/core/combinedequipment.py on lines 1350..1354
myems-api/core/energyflowdiagram.py on lines 835..839
myems-api/core/energyflowdiagram.py on lines 1455..1459
myems-api/core/equipment.py on lines 791..795
myems-api/core/equipment.py on lines 806..810
myems-api/core/equipment.py on lines 813..817
myems-api/core/equipment.py on lines 1159..1163
myems-api/core/equipment.py on lines 1174..1178
myems-api/core/equipment.py on lines 1181..1185

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

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

        if 'denominator_meter_uuid' in new_values['data'].keys():
            if new_values['data']['denominator_meter_uuid'] is not None and \
                    isinstance(new_values['data']['denominator_meter_uuid'], str) and \
                    len(str.strip(new_values['data']['denominator_meter_uuid'])) > 0:
                denominator_meter_uuid = str.strip(new_values['data']['denominator_meter_uuid'])
Severity: Major
Found in myems-api/core/combinedequipment.py and 14 other locations - About 7 hrs to fix
myems-api/core/combinedequipment.py on lines 948..952
myems-api/core/combinedequipment.py on lines 963..967
myems-api/core/combinedequipment.py on lines 1328..1332
myems-api/core/combinedequipment.py on lines 1343..1347
myems-api/core/combinedequipment.py on lines 1350..1354
myems-api/core/energyflowdiagram.py on lines 535..539
myems-api/core/energyflowdiagram.py on lines 835..839
myems-api/core/energyflowdiagram.py on lines 1455..1459
myems-api/core/equipment.py on lines 791..795
myems-api/core/equipment.py on lines 806..810
myems-api/core/equipment.py on lines 813..817
myems-api/core/equipment.py on lines 1159..1163
myems-api/core/equipment.py on lines 1174..1178
myems-api/core/equipment.py on lines 1181..1185

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

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

        if 'numerator_meter_uuid' in new_values['data'].keys():
            if new_values['data']['numerator_meter_uuid'] is not None and \
                    isinstance(new_values['data']['numerator_meter_uuid'], str) and \
                    len(str.strip(new_values['data']['numerator_meter_uuid'])) > 0:
                numerator_meter_uuid = str.strip(new_values['data']['numerator_meter_uuid'])
Severity: Major
Found in myems-api/core/combinedequipment.py and 14 other locations - About 7 hrs to fix
myems-api/core/combinedequipment.py on lines 948..952
myems-api/core/combinedequipment.py on lines 970..974
myems-api/core/combinedequipment.py on lines 1328..1332
myems-api/core/combinedequipment.py on lines 1343..1347
myems-api/core/combinedequipment.py on lines 1350..1354
myems-api/core/energyflowdiagram.py on lines 535..539
myems-api/core/energyflowdiagram.py on lines 835..839
myems-api/core/energyflowdiagram.py on lines 1455..1459
myems-api/core/equipment.py on lines 791..795
myems-api/core/equipment.py on lines 806..810
myems-api/core/equipment.py on lines 813..817
myems-api/core/equipment.py on lines 1159..1163
myems-api/core/equipment.py on lines 1174..1178
myems-api/core/equipment.py on lines 1181..1185

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

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