Showing 10,536 of 10,536 total issues

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

Severity: Major
Found in myems-api/reports/offlinemetersaving.py and 3 other locations - About 1 mo to fix
myems-api/reports/offlinemeterplan.py on lines 0..519
myems-api/reports/virtualmeterplan.py on lines 0..519
myems-api/reports/virtualmetersaving.py on lines 0..519

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

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

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

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

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

Refactorings

Further Reading

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

const WorkOrderRepair = ({ setRedirect, setRedirectUrl, t }) => {
  let current_moment = moment();

  // Query Parameters
  const [priority, setPriority] = useState('all');
Severity: Major
Found in myems-web/src/components/MyEMS/WorkOrder/Repair.js and 2 other locations - About 1 mo to fix
myems-web/src/components/MyEMS/WorkOrder/Inspection.js on lines 40..914
myems-web/src/components/MyEMS/WorkOrder/Installation.js on lines 40..914

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

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

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

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

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

Refactorings

Further Reading

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

const WorkOrderInstallation = ({ setRedirect, setRedirectUrl, t }) => {
  let current_moment = moment();

  // Query Parameters
    const [priority, setPriority] = useState('all');
Severity: Major
Found in myems-web/src/components/MyEMS/WorkOrder/Installation.js and 2 other locations - About 1 mo to fix
myems-web/src/components/MyEMS/WorkOrder/Inspection.js on lines 40..914
myems-web/src/components/MyEMS/WorkOrder/Repair.js on lines 40..914

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

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

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

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

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

Refactorings

Further Reading

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

const WorkOrderInspection = ({ setRedirect, setRedirectUrl, t }) => {
  let current_moment = moment();

  // Query Parameters
  const [priority, setPriority] = useState('all');
Severity: Major
Found in myems-web/src/components/MyEMS/WorkOrder/Inspection.js and 2 other locations - About 1 mo to fix
myems-web/src/components/MyEMS/WorkOrder/Installation.js on lines 40..914
myems-web/src/components/MyEMS/WorkOrder/Repair.js on lines 40..914

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

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

Severity: Major
Found in myems-aggregation/shopfloor_energy_input_item.py and 4 other locations - About 1 mo to fix
myems-aggregation/combined_equipment_energy_input_category.py on lines 0..622
myems-aggregation/combined_equipment_energy_input_item.py on lines 0..625
myems-aggregation/combined_equipment_energy_output_category.py on lines 0..622
myems-aggregation/shopfloor_energy_input_category.py on lines 0..619

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

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

myems-aggregation/combined_equipment_energy_input_item.py on lines 0..625
myems-aggregation/combined_equipment_energy_output_category.py on lines 0..622
myems-aggregation/shopfloor_energy_input_category.py on lines 0..619
myems-aggregation/shopfloor_energy_input_item.py on lines 0..622

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

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

myems-aggregation/combined_equipment_energy_input_category.py on lines 0..622
myems-aggregation/combined_equipment_energy_input_item.py on lines 0..625
myems-aggregation/shopfloor_energy_input_category.py on lines 0..619
myems-aggregation/shopfloor_energy_input_item.py on lines 0..622

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

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

Severity: Major
Found in myems-aggregation/combined_equipment_energy_input_item.py and 4 other locations - About 1 mo to fix
myems-aggregation/combined_equipment_energy_input_category.py on lines 0..622
myems-aggregation/combined_equipment_energy_output_category.py on lines 0..622
myems-aggregation/shopfloor_energy_input_category.py on lines 0..619
myems-aggregation/shopfloor_energy_input_item.py on lines 0..622

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

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

Severity: Major
Found in myems-aggregation/shopfloor_energy_input_category.py and 4 other locations - About 1 mo to fix
myems-aggregation/combined_equipment_energy_input_category.py on lines 0..622
myems-aggregation/combined_equipment_energy_input_item.py on lines 0..625
myems-aggregation/combined_equipment_energy_output_category.py on lines 0..622
myems-aggregation/shopfloor_energy_input_item.py on lines 0..622

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

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

    if "timestamps" not in reporting_period_data.keys() or \
            reporting_period_data['timestamps'] is None or \
            len(reporting_period_data['timestamps']) == 0:
        pass
    else:
Severity: Major
Found in myems-api/excelexporters/shopfloorstatistics.py and 11 other locations - About 1 mo to fix
myems-api/excelexporters/combinedequipmentenergycategory.py on lines 524..805
myems-api/excelexporters/combinedequipmentstatistics.py on lines 340..621
myems-api/excelexporters/equipmentenergycategory.py on lines 518..799
myems-api/excelexporters/equipmentstatistics.py on lines 345..626
myems-api/excelexporters/shopfloorenergycategory.py on lines 658..939
myems-api/excelexporters/spaceenergycategory.py on lines 729..1009
myems-api/excelexporters/spacestatistics.py on lines 460..741
myems-api/excelexporters/storeenergycategory.py on lines 667..948
myems-api/excelexporters/storestatistics.py on lines 451..732
myems-api/excelexporters/tenantenergycategory.py on lines 630..910
myems-api/excelexporters/tenantstatistics.py on lines 461..745

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

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

    if "timestamps" not in reporting_period_data.keys() or \
            reporting_period_data['timestamps'] is None or \
            len(reporting_period_data['timestamps']) == 0:
        pass
    else:
Severity: Major
Found in myems-api/excelexporters/equipmentstatistics.py and 11 other locations - About 1 mo to fix
myems-api/excelexporters/combinedequipmentenergycategory.py on lines 524..805
myems-api/excelexporters/combinedequipmentstatistics.py on lines 340..621
myems-api/excelexporters/equipmentenergycategory.py on lines 518..799
myems-api/excelexporters/shopfloorenergycategory.py on lines 658..939
myems-api/excelexporters/shopfloorstatistics.py on lines 452..733
myems-api/excelexporters/spaceenergycategory.py on lines 729..1009
myems-api/excelexporters/spacestatistics.py on lines 460..741
myems-api/excelexporters/storeenergycategory.py on lines 667..948
myems-api/excelexporters/storestatistics.py on lines 451..732
myems-api/excelexporters/tenantenergycategory.py on lines 630..910
myems-api/excelexporters/tenantstatistics.py on lines 461..745

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

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

    if "timestamps" not in reporting_period_data.keys() or \
            reporting_period_data['timestamps'] is None or \
            len(reporting_period_data['timestamps']) == 0:
        pass
    else:
Severity: Major
Found in myems-api/excelexporters/combinedequipmentstatistics.py and 11 other locations - About 1 mo to fix
myems-api/excelexporters/combinedequipmentenergycategory.py on lines 524..805
myems-api/excelexporters/equipmentenergycategory.py on lines 518..799
myems-api/excelexporters/equipmentstatistics.py on lines 345..626
myems-api/excelexporters/shopfloorenergycategory.py on lines 658..939
myems-api/excelexporters/shopfloorstatistics.py on lines 452..733
myems-api/excelexporters/spaceenergycategory.py on lines 729..1009
myems-api/excelexporters/spacestatistics.py on lines 460..741
myems-api/excelexporters/storeenergycategory.py on lines 667..948
myems-api/excelexporters/storestatistics.py on lines 451..732
myems-api/excelexporters/tenantenergycategory.py on lines 630..910
myems-api/excelexporters/tenantstatistics.py on lines 461..745

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

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

    if "timestamps" not in reporting_period_data.keys() or \
            reporting_period_data['timestamps'] is None or \
            len(reporting_period_data['timestamps']) == 0:
        pass
    else:
Severity: Major
Found in myems-api/excelexporters/spaceenergycategory.py and 11 other locations - About 1 mo to fix
myems-api/excelexporters/combinedequipmentenergycategory.py on lines 524..805
myems-api/excelexporters/combinedequipmentstatistics.py on lines 340..621
myems-api/excelexporters/equipmentenergycategory.py on lines 518..799
myems-api/excelexporters/equipmentstatistics.py on lines 345..626
myems-api/excelexporters/shopfloorenergycategory.py on lines 658..939
myems-api/excelexporters/shopfloorstatistics.py on lines 452..733
myems-api/excelexporters/spacestatistics.py on lines 460..741
myems-api/excelexporters/storeenergycategory.py on lines 667..948
myems-api/excelexporters/storestatistics.py on lines 451..732
myems-api/excelexporters/tenantenergycategory.py on lines 630..910
myems-api/excelexporters/tenantstatistics.py on lines 461..745

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

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

    if "timestamps" not in reporting_period_data.keys() or \
            reporting_period_data['timestamps'] is None or \
            len(reporting_period_data['timestamps']) == 0:
        pass
    else:
Severity: Major
Found in myems-api/excelexporters/shopfloorenergycategory.py and 11 other locations - About 1 mo to fix
myems-api/excelexporters/combinedequipmentenergycategory.py on lines 524..805
myems-api/excelexporters/combinedequipmentstatistics.py on lines 340..621
myems-api/excelexporters/equipmentenergycategory.py on lines 518..799
myems-api/excelexporters/equipmentstatistics.py on lines 345..626
myems-api/excelexporters/shopfloorstatistics.py on lines 452..733
myems-api/excelexporters/spaceenergycategory.py on lines 729..1009
myems-api/excelexporters/spacestatistics.py on lines 460..741
myems-api/excelexporters/storeenergycategory.py on lines 667..948
myems-api/excelexporters/storestatistics.py on lines 451..732
myems-api/excelexporters/tenantenergycategory.py on lines 630..910
myems-api/excelexporters/tenantstatistics.py on lines 461..745

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

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

    if "timestamps" not in reporting_period_data.keys() or \
            reporting_period_data['timestamps'] is None or \
            len(reporting_period_data['timestamps']) == 0:
        pass
    else:
Severity: Major
Found in myems-api/excelexporters/spacestatistics.py and 11 other locations - About 1 mo to fix
myems-api/excelexporters/combinedequipmentenergycategory.py on lines 524..805
myems-api/excelexporters/combinedequipmentstatistics.py on lines 340..621
myems-api/excelexporters/equipmentenergycategory.py on lines 518..799
myems-api/excelexporters/equipmentstatistics.py on lines 345..626
myems-api/excelexporters/shopfloorenergycategory.py on lines 658..939
myems-api/excelexporters/shopfloorstatistics.py on lines 452..733
myems-api/excelexporters/spaceenergycategory.py on lines 729..1009
myems-api/excelexporters/storeenergycategory.py on lines 667..948
myems-api/excelexporters/storestatistics.py on lines 451..732
myems-api/excelexporters/tenantenergycategory.py on lines 630..910
myems-api/excelexporters/tenantstatistics.py on lines 461..745

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

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

    if "timestamps" not in reporting_period_data.keys() or \
            reporting_period_data['timestamps'] is None or \
            len(reporting_period_data['timestamps']) == 0:
        pass
    else:
myems-api/excelexporters/combinedequipmentstatistics.py on lines 340..621
myems-api/excelexporters/equipmentenergycategory.py on lines 518..799
myems-api/excelexporters/equipmentstatistics.py on lines 345..626
myems-api/excelexporters/shopfloorenergycategory.py on lines 658..939
myems-api/excelexporters/shopfloorstatistics.py on lines 452..733
myems-api/excelexporters/spaceenergycategory.py on lines 729..1009
myems-api/excelexporters/spacestatistics.py on lines 460..741
myems-api/excelexporters/storeenergycategory.py on lines 667..948
myems-api/excelexporters/storestatistics.py on lines 451..732
myems-api/excelexporters/tenantenergycategory.py on lines 630..910
myems-api/excelexporters/tenantstatistics.py on lines 461..745

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

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

    if "timestamps" not in reporting_period_data.keys() or \
            reporting_period_data['timestamps'] is None or \
            len(reporting_period_data['timestamps']) == 0:
        pass
    else:
Severity: Major
Found in myems-api/excelexporters/storeenergycategory.py and 11 other locations - About 1 mo to fix
myems-api/excelexporters/combinedequipmentenergycategory.py on lines 524..805
myems-api/excelexporters/combinedequipmentstatistics.py on lines 340..621
myems-api/excelexporters/equipmentenergycategory.py on lines 518..799
myems-api/excelexporters/equipmentstatistics.py on lines 345..626
myems-api/excelexporters/shopfloorenergycategory.py on lines 658..939
myems-api/excelexporters/shopfloorstatistics.py on lines 452..733
myems-api/excelexporters/spaceenergycategory.py on lines 729..1009
myems-api/excelexporters/spacestatistics.py on lines 460..741
myems-api/excelexporters/storestatistics.py on lines 451..732
myems-api/excelexporters/tenantenergycategory.py on lines 630..910
myems-api/excelexporters/tenantstatistics.py on lines 461..745

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

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

    if "timestamps" not in reporting_period_data.keys() or \
            reporting_period_data['timestamps'] is None or \
            len(reporting_period_data['timestamps']) == 0:
        pass
    else:
Severity: Major
Found in myems-api/excelexporters/tenantenergycategory.py and 11 other locations - About 1 mo to fix
myems-api/excelexporters/combinedequipmentenergycategory.py on lines 524..805
myems-api/excelexporters/combinedequipmentstatistics.py on lines 340..621
myems-api/excelexporters/equipmentenergycategory.py on lines 518..799
myems-api/excelexporters/equipmentstatistics.py on lines 345..626
myems-api/excelexporters/shopfloorenergycategory.py on lines 658..939
myems-api/excelexporters/shopfloorstatistics.py on lines 452..733
myems-api/excelexporters/spaceenergycategory.py on lines 729..1009
myems-api/excelexporters/spacestatistics.py on lines 460..741
myems-api/excelexporters/storeenergycategory.py on lines 667..948
myems-api/excelexporters/storestatistics.py on lines 451..732
myems-api/excelexporters/tenantstatistics.py on lines 461..745

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

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

    if "timestamps" not in reporting_period_data.keys() or \
            reporting_period_data['timestamps'] is None or \
            len(reporting_period_data['timestamps']) == 0:
        pass
    else:
Severity: Major
Found in myems-api/excelexporters/equipmentenergycategory.py and 11 other locations - About 1 mo to fix
myems-api/excelexporters/combinedequipmentenergycategory.py on lines 524..805
myems-api/excelexporters/combinedequipmentstatistics.py on lines 340..621
myems-api/excelexporters/equipmentstatistics.py on lines 345..626
myems-api/excelexporters/shopfloorenergycategory.py on lines 658..939
myems-api/excelexporters/shopfloorstatistics.py on lines 452..733
myems-api/excelexporters/spaceenergycategory.py on lines 729..1009
myems-api/excelexporters/spacestatistics.py on lines 460..741
myems-api/excelexporters/storeenergycategory.py on lines 667..948
myems-api/excelexporters/storestatistics.py on lines 451..732
myems-api/excelexporters/tenantenergycategory.py on lines 630..910
myems-api/excelexporters/tenantstatistics.py on lines 461..745

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

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

    if "timestamps" not in reporting_period_data.keys() or \
            reporting_period_data['timestamps'] is None or \
            len(reporting_period_data['timestamps']) == 0:
        pass
    else:
Severity: Major
Found in myems-api/excelexporters/tenantstatistics.py and 11 other locations - About 1 mo to fix
myems-api/excelexporters/combinedequipmentenergycategory.py on lines 524..805
myems-api/excelexporters/combinedequipmentstatistics.py on lines 340..621
myems-api/excelexporters/equipmentenergycategory.py on lines 518..799
myems-api/excelexporters/equipmentstatistics.py on lines 345..626
myems-api/excelexporters/shopfloorenergycategory.py on lines 658..939
myems-api/excelexporters/shopfloorstatistics.py on lines 452..733
myems-api/excelexporters/spaceenergycategory.py on lines 729..1009
myems-api/excelexporters/spacestatistics.py on lines 460..741
myems-api/excelexporters/storeenergycategory.py on lines 667..948
myems-api/excelexporters/storestatistics.py on lines 451..732
myems-api/excelexporters/tenantenergycategory.py on lines 630..910

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

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