Showing 4,754 of 10,533 total issues

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

        if rows_files is not None and len(rows_files) > 0:
            for row_file in rows_files:
                excel_file_list.append({"id": row_file[0],
                                        "name": row_file[1],
                                        "file_object": row_file[2]})
Severity: Major
Found in myems-normalization/offlinemeter.py and 1 other location - About 4 hrs to fix
myems-normalization/datarepair.py on lines 62..70

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

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

          json['parameters']['names'].forEach((currentName, index) => {
            let pointItem = {};
            pointItem['name'] = currentName;
            pointItem['value'] = undefined;
            let currentValues = json['parameters']['values'][index];
Severity: Major
Found in myems-web/src/components/MyEMS/Space/RealtimeData.js and 3 other locations - About 4 hrs to fix
myems-web/src/components/MyEMS/Meter/RealtimeChart.js on lines 98..107
myems-web/src/components/MyEMS/Meter/RealtimeChart.js on lines 153..162
myems-web/src/components/MyEMS/Space/RealtimeData.js on lines 113..122

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

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

            json['parameters']['names'].forEach((currentName, index) => {
              let pointItem = {};
              pointItem['name'] = currentName;
              pointItem['value'] = undefined;
              let currentValues = json['parameters']['values'][index];
Severity: Major
Found in myems-web/src/components/MyEMS/Meter/RealtimeChart.js and 3 other locations - About 4 hrs to fix
myems-web/src/components/MyEMS/Meter/RealtimeChart.js on lines 98..107
myems-web/src/components/MyEMS/Space/RealtimeData.js on lines 60..69
myems-web/src/components/MyEMS/Space/RealtimeData.js on lines 113..122

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

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

          json['parameters']['names'].forEach((currentName, index) => {
            let pointItem = {};
            pointItem['name'] = currentName;
            pointItem['value'] = undefined;
            let currentValues = json['parameters']['values'][index];
Severity: Major
Found in myems-web/src/components/MyEMS/Meter/RealtimeChart.js and 3 other locations - About 4 hrs to fix
myems-web/src/components/MyEMS/Meter/RealtimeChart.js on lines 153..162
myems-web/src/components/MyEMS/Space/RealtimeData.js on lines 60..69
myems-web/src/components/MyEMS/Space/RealtimeData.js on lines 113..122

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

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

            json['parameters']['names'].forEach((currentName, index) => {
              let pointItem = {};
              pointItem['name'] = currentName;
              pointItem['value'] = undefined;
              let currentValues = json['parameters']['values'][index];
Severity: Major
Found in myems-web/src/components/MyEMS/Space/RealtimeData.js and 3 other locations - About 4 hrs to fix
myems-web/src/components/MyEMS/Meter/RealtimeChart.js on lines 98..107
myems-web/src/components/MyEMS/Meter/RealtimeChart.js on lines 153..162
myems-web/src/components/MyEMS/Space/RealtimeData.js on lines 60..69

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

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

    (function (Category) {
        Category[Category["RESOLVE"] = 0] = "RESOLVE";
        Category[Category["TRANSITION"] = 1] = "TRANSITION";
        Category[Category["HOOK"] = 2] = "HOOK";
        Category[Category["UIVIEW"] = 3] = "UIVIEW";
Severity: Major
Found in myems-admin/js/ui-router/angular-ui-router.js and 1 other location - About 4 hrs to fix
myems-admin/js/ui-router/angular-ui-router.js on lines 3330..3336

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

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

      <Col md={6} className="pl-md-2">
        <Card className="h-100">
          <CardHeader>
            <h5 className="mb-1">Border Radius</h5>
            <p className="mb-0">Add classes to an element to easily round its corners.</p>
Severity: Major
Found in myems-web/src/components/utilities/Borders.js and 1 other location - About 4 hrs to fix
myems-web/src/components/utilities/Borders.js on lines 146..156

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

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

      <Col md={6} className="pr-md-2">
        <Card className="h-100">
          <CardHeader>
            <h5 className="mb-1">Border Color</h5>
            <p className="mb-0">Change the border color using utilities built on our theme colors</p>
Severity: Major
Found in myems-web/src/components/utilities/Borders.js and 1 other location - About 4 hrs to fix
myems-web/src/components/utilities/Borders.js on lines 157..167

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

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

    (function (TransitionHookPhase) {
        TransitionHookPhase[TransitionHookPhase["CREATE"] = 0] = "CREATE";
        TransitionHookPhase[TransitionHookPhase["BEFORE"] = 1] = "BEFORE";
        TransitionHookPhase[TransitionHookPhase["RUN"] = 2] = "RUN";
        TransitionHookPhase[TransitionHookPhase["SUCCESS"] = 3] = "SUCCESS";
Severity: Major
Found in myems-admin/js/ui-router/angular-ui-router.js and 1 other location - About 4 hrs to fix
myems-admin/js/ui-router/angular-ui-router.js on lines 1288..1294

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

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

    if "names" not in reporting_period_data.keys() or \
            reporting_period_data['names'] is None or \
            len(reporting_period_data['names']) == 0:
        filename = str(uuid.uuid4()) + '.xlsx'
        wb.save(filename)
Severity: Major
Found in myems-api/excelexporters/equipmentload.py and 9 other locations - About 4 hrs to fix
myems-api/excelexporters/combinedequipmentload.py on lines 190..196
myems-api/excelexporters/combinedequipmentstatistics.py on lines 191..196
myems-api/excelexporters/equipmentstatistics.py on lines 188..193
myems-api/excelexporters/shopfloorload.py on lines 190..195
myems-api/excelexporters/shopfloorstatistics.py on lines 190..195
myems-api/excelexporters/spacestatistics.py on lines 188..193
myems-api/excelexporters/storeload.py on lines 190..195
myems-api/excelexporters/storestatistics.py on lines 189..194
myems-api/excelexporters/tenantstatistics.py on lines 190..195

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

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

    if "names" not in reporting_period_data.keys() or \
            reporting_period_data['names'] is None or \
            len(reporting_period_data['names']) == 0:
        filename = str(uuid.uuid4()) + '.xlsx'
        wb.save(filename)
Severity: Major
Found in myems-api/excelexporters/combinedequipmentstatistics.py and 9 other locations - About 4 hrs to fix
myems-api/excelexporters/combinedequipmentload.py on lines 190..196
myems-api/excelexporters/equipmentload.py on lines 186..191
myems-api/excelexporters/equipmentstatistics.py on lines 188..193
myems-api/excelexporters/shopfloorload.py on lines 190..195
myems-api/excelexporters/shopfloorstatistics.py on lines 190..195
myems-api/excelexporters/spacestatistics.py on lines 188..193
myems-api/excelexporters/storeload.py on lines 190..195
myems-api/excelexporters/storestatistics.py on lines 189..194
myems-api/excelexporters/tenantstatistics.py on lines 190..195

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

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

    if "names" not in reporting_period_data.keys() or \
            reporting_period_data['names'] is None or \
            len(reporting_period_data['names']) == 0:
        filename = str(uuid.uuid4()) + '.xlsx'
        wb.save(filename)
Severity: Major
Found in myems-api/excelexporters/shopfloorstatistics.py and 9 other locations - About 4 hrs to fix
myems-api/excelexporters/combinedequipmentload.py on lines 190..196
myems-api/excelexporters/combinedequipmentstatistics.py on lines 191..196
myems-api/excelexporters/equipmentload.py on lines 186..191
myems-api/excelexporters/equipmentstatistics.py on lines 188..193
myems-api/excelexporters/shopfloorload.py on lines 190..195
myems-api/excelexporters/spacestatistics.py on lines 188..193
myems-api/excelexporters/storeload.py on lines 190..195
myems-api/excelexporters/storestatistics.py on lines 189..194
myems-api/excelexporters/tenantstatistics.py on lines 190..195

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

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

    if "names" not in reporting_period_data.keys() or \
            reporting_period_data['names'] is None or \
            len(reporting_period_data['names']) == 0:
        filename = str(uuid.uuid4()) + '.xlsx'
        wb.save(filename)
Severity: Major
Found in myems-api/excelexporters/shopfloorload.py and 9 other locations - About 4 hrs to fix
myems-api/excelexporters/combinedequipmentload.py on lines 190..196
myems-api/excelexporters/combinedequipmentstatistics.py on lines 191..196
myems-api/excelexporters/equipmentload.py on lines 186..191
myems-api/excelexporters/equipmentstatistics.py on lines 188..193
myems-api/excelexporters/shopfloorstatistics.py on lines 190..195
myems-api/excelexporters/spacestatistics.py on lines 188..193
myems-api/excelexporters/storeload.py on lines 190..195
myems-api/excelexporters/storestatistics.py on lines 189..194
myems-api/excelexporters/tenantstatistics.py on lines 190..195

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

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

    if "names" not in reporting_period_data.keys() or \
            reporting_period_data['names'] is None or \
            len(reporting_period_data['names']) == 0:
        filename = str(uuid.uuid4()) + '.xlsx'
        wb.save(filename)
Severity: Major
Found in myems-api/excelexporters/combinedequipmentload.py and 9 other locations - About 4 hrs to fix
myems-api/excelexporters/combinedequipmentstatistics.py on lines 191..196
myems-api/excelexporters/equipmentload.py on lines 186..191
myems-api/excelexporters/equipmentstatistics.py on lines 188..193
myems-api/excelexporters/shopfloorload.py on lines 190..195
myems-api/excelexporters/shopfloorstatistics.py on lines 190..195
myems-api/excelexporters/spacestatistics.py on lines 188..193
myems-api/excelexporters/storeload.py on lines 190..195
myems-api/excelexporters/storestatistics.py on lines 189..194
myems-api/excelexporters/tenantstatistics.py on lines 190..195

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

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

    if "names" not in reporting_period_data.keys() or \
            reporting_period_data['names'] is None or \
            len(reporting_period_data['names']) == 0:
        filename = str(uuid.uuid4()) + '.xlsx'
        wb.save(filename)
Severity: Major
Found in myems-api/excelexporters/storestatistics.py and 9 other locations - About 4 hrs to fix
myems-api/excelexporters/combinedequipmentload.py on lines 190..196
myems-api/excelexporters/combinedequipmentstatistics.py on lines 191..196
myems-api/excelexporters/equipmentload.py on lines 186..191
myems-api/excelexporters/equipmentstatistics.py on lines 188..193
myems-api/excelexporters/shopfloorload.py on lines 190..195
myems-api/excelexporters/shopfloorstatistics.py on lines 190..195
myems-api/excelexporters/spacestatistics.py on lines 188..193
myems-api/excelexporters/storeload.py on lines 190..195
myems-api/excelexporters/tenantstatistics.py on lines 190..195

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

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

    if "names" not in reporting_period_data.keys() or \
            reporting_period_data['names'] is None or \
            len(reporting_period_data['names']) == 0:
        filename = str(uuid.uuid4()) + '.xlsx'
        wb.save(filename)
Severity: Major
Found in myems-api/excelexporters/storeload.py and 9 other locations - About 4 hrs to fix
myems-api/excelexporters/combinedequipmentload.py on lines 190..196
myems-api/excelexporters/combinedequipmentstatistics.py on lines 191..196
myems-api/excelexporters/equipmentload.py on lines 186..191
myems-api/excelexporters/equipmentstatistics.py on lines 188..193
myems-api/excelexporters/shopfloorload.py on lines 190..195
myems-api/excelexporters/shopfloorstatistics.py on lines 190..195
myems-api/excelexporters/spacestatistics.py on lines 188..193
myems-api/excelexporters/storestatistics.py on lines 189..194
myems-api/excelexporters/tenantstatistics.py on lines 190..195

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

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

    if "names" not in reporting_period_data.keys() or \
            reporting_period_data['names'] is None or \
            len(reporting_period_data['names']) == 0:
        filename = str(uuid.uuid4()) + '.xlsx'
        wb.save(filename)
Severity: Major
Found in myems-api/excelexporters/spacestatistics.py and 9 other locations - About 4 hrs to fix
myems-api/excelexporters/combinedequipmentload.py on lines 190..196
myems-api/excelexporters/combinedequipmentstatistics.py on lines 191..196
myems-api/excelexporters/equipmentload.py on lines 186..191
myems-api/excelexporters/equipmentstatistics.py on lines 188..193
myems-api/excelexporters/shopfloorload.py on lines 190..195
myems-api/excelexporters/shopfloorstatistics.py on lines 190..195
myems-api/excelexporters/storeload.py on lines 190..195
myems-api/excelexporters/storestatistics.py on lines 189..194
myems-api/excelexporters/tenantstatistics.py on lines 190..195

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

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

    if "names" not in reporting_period_data.keys() or \
            reporting_period_data['names'] is None or \
            len(reporting_period_data['names']) == 0:
        filename = str(uuid.uuid4()) + '.xlsx'
        wb.save(filename)
Severity: Major
Found in myems-api/excelexporters/tenantstatistics.py and 9 other locations - About 4 hrs to fix
myems-api/excelexporters/combinedequipmentload.py on lines 190..196
myems-api/excelexporters/combinedequipmentstatistics.py on lines 191..196
myems-api/excelexporters/equipmentload.py on lines 186..191
myems-api/excelexporters/equipmentstatistics.py on lines 188..193
myems-api/excelexporters/shopfloorload.py on lines 190..195
myems-api/excelexporters/shopfloorstatistics.py on lines 190..195
myems-api/excelexporters/spacestatistics.py on lines 188..193
myems-api/excelexporters/storeload.py on lines 190..195
myems-api/excelexporters/storestatistics.py on lines 189..194

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

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

    if "names" not in reporting_period_data.keys() or \
            reporting_period_data['names'] is None or \
            len(reporting_period_data['names']) == 0:
        filename = str(uuid.uuid4()) + '.xlsx'
        wb.save(filename)
Severity: Major
Found in myems-api/excelexporters/equipmentstatistics.py and 9 other locations - About 4 hrs to fix
myems-api/excelexporters/combinedequipmentload.py on lines 190..196
myems-api/excelexporters/combinedequipmentstatistics.py on lines 191..196
myems-api/excelexporters/equipmentload.py on lines 186..191
myems-api/excelexporters/shopfloorload.py on lines 190..195
myems-api/excelexporters/shopfloorstatistics.py on lines 190..195
myems-api/excelexporters/spacestatistics.py on lines 188..193
myems-api/excelexporters/storeload.py on lines 190..195
myems-api/excelexporters/storestatistics.py on lines 189..194
myems-api/excelexporters/tenantstatistics.py on lines 190..195

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

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

        if rows_sensors is not None and len(rows_sensors) > 0:
            for row in rows_sensors:
                meta_result = {"id": row[0],
                               "name": row[1],
                               "uuid": row[2],
Severity: Major
Found in myems-api/core/sensor.py and 2 other locations - About 4 hrs to fix
myems-api/core/costcenter.py on lines 39..45
myems-api/core/timezone.py on lines 36..42

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

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