Showing 4,754 of 10,533 total issues

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

        if 'rule_id' in new_values['data'].keys():
            if new_values['data']['rule_id'] <= 0:
                raise falcon.HTTPError(status=falcon.HTTP_400, title='API.BAD_REQUEST',
                                       description='API.INVALID_RULE_ID')
            rule_id = new_values['data']['rule_id']
Severity: Major
Found in myems-api/core/textmessage.py and 18 other locations - About 4 hrs to fix
myems-api/core/emailmessage.py on lines 116..122
myems-api/core/emailmessage.py on lines 316..322
myems-api/core/shopfloor.py on lines 115..121
myems-api/core/shopfloor.py on lines 123..129
myems-api/core/shopfloor.py on lines 371..377
myems-api/core/shopfloor.py on lines 379..385
myems-api/core/shopfloor.py on lines 2204..2210
myems-api/core/shopfloor.py on lines 2212..2218
myems-api/core/space.py on lines 131..137
myems-api/core/space.py on lines 166..172
myems-api/core/space.py on lines 174..180
myems-api/core/space.py on lines 547..553
myems-api/core/space.py on lines 3970..3976
myems-api/core/space.py on lines 4005..4011
myems-api/core/space.py on lines 4013..4019
myems-api/core/textmessage.py on lines 106..112
myems-api/core/wechatmessage.py on lines 110..116
myems-api/core/wechatmessage.py on lines 318..324

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

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

        if 'id' in new_values['cost_center'].keys():
            if new_values['cost_center']['id'] <= 0:
                raise falcon.HTTPError(status=falcon.HTTP_400, title='API.BAD_REQUEST',
                                       description='API.INVALID_COST_CENTER_ID')
            cost_center_id = new_values['cost_center']['id']
Severity: Major
Found in myems-api/core/shopfloor.py and 18 other locations - About 4 hrs to fix
myems-api/core/emailmessage.py on lines 116..122
myems-api/core/emailmessage.py on lines 316..322
myems-api/core/shopfloor.py on lines 115..121
myems-api/core/shopfloor.py on lines 123..129
myems-api/core/shopfloor.py on lines 371..377
myems-api/core/shopfloor.py on lines 379..385
myems-api/core/shopfloor.py on lines 2204..2210
myems-api/core/space.py on lines 131..137
myems-api/core/space.py on lines 166..172
myems-api/core/space.py on lines 174..180
myems-api/core/space.py on lines 547..553
myems-api/core/space.py on lines 3970..3976
myems-api/core/space.py on lines 4005..4011
myems-api/core/space.py on lines 4013..4019
myems-api/core/textmessage.py on lines 106..112
myems-api/core/textmessage.py on lines 291..297
myems-api/core/wechatmessage.py on lines 110..116
myems-api/core/wechatmessage.py on lines 318..324

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

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

        if 'id' in new_values['cost_center'].keys():
            if new_values['cost_center']['id'] <= 0:
                raise falcon.HTTPError(status=falcon.HTTP_400, title='API.BAD_REQUEST',
                                       description='API.INVALID_COST_CENTER_ID')
            cost_center_id = new_values['cost_center']['id']
Severity: Major
Found in myems-api/core/space.py and 18 other locations - About 4 hrs to fix
myems-api/core/emailmessage.py on lines 116..122
myems-api/core/emailmessage.py on lines 316..322
myems-api/core/shopfloor.py on lines 115..121
myems-api/core/shopfloor.py on lines 123..129
myems-api/core/shopfloor.py on lines 371..377
myems-api/core/shopfloor.py on lines 379..385
myems-api/core/shopfloor.py on lines 2204..2210
myems-api/core/shopfloor.py on lines 2212..2218
myems-api/core/space.py on lines 131..137
myems-api/core/space.py on lines 166..172
myems-api/core/space.py on lines 174..180
myems-api/core/space.py on lines 547..553
myems-api/core/space.py on lines 3970..3976
myems-api/core/space.py on lines 4005..4011
myems-api/core/textmessage.py on lines 106..112
myems-api/core/textmessage.py on lines 291..297
myems-api/core/wechatmessage.py on lines 110..116
myems-api/core/wechatmessage.py on lines 318..324

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

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

const selectRow = onSelect => ({
  mode: 'checkbox',
  clickToSelect: false,
  selectionHeaderRenderer: ({ mode, ...rest }) => <SelectRowInput type="checkbox" {...rest} />,
  selectionRenderer: ({ mode, ...rest }) => <SelectRowInput type={mode} {...rest} />,
Severity: Major
Found in myems-web/src/components/dashboard/PurchasesTable.js and 5 other locations - About 4 hrs to fix
myems-web/src/components/MyEMS/EnergyStoragePowerStation/EnergyStoragePowerStationTable.js on lines 47..56
myems-web/src/components/MyEMS/Microgrid/MicrogridTable.js on lines 40..49
myems-web/src/components/MyEMS/Shopfloor/PurchasesTable.js on lines 117..126
myems-web/src/components/MyEMS/Store/PurchasesTable.js on lines 117..126
myems-web/src/components/MyEMS/Tenant/PurchasesTable.js on lines 117..126

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

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

const selectRow = onSelect => ({
  mode: 'checkbox',
  clickToSelect: false,
  selectionHeaderRenderer: ({ mode, ...rest }) => <SelectRowInput type="checkbox" {...rest} />,
  selectionRenderer: ({ mode, ...rest }) => <SelectRowInput type={mode} {...rest} />,
Severity: Major
Found in myems-web/src/components/MyEMS/Shopfloor/PurchasesTable.js and 5 other locations - About 4 hrs to fix
myems-web/src/components/MyEMS/EnergyStoragePowerStation/EnergyStoragePowerStationTable.js on lines 47..56
myems-web/src/components/MyEMS/Microgrid/MicrogridTable.js on lines 40..49
myems-web/src/components/MyEMS/Store/PurchasesTable.js on lines 117..126
myems-web/src/components/MyEMS/Tenant/PurchasesTable.js on lines 117..126
myems-web/src/components/dashboard/PurchasesTable.js on lines 117..126

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

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

const selectRow = onSelect => ({
  mode: 'checkbox',
  clickToSelect: false,
  selectionHeaderRenderer: ({ mode, ...rest }) => <SelectRowInput type="checkbox" {...rest} />,
  selectionRenderer: ({ mode, ...rest }) => <SelectRowInput type={mode} {...rest} />,
Severity: Major
Found in myems-web/src/components/MyEMS/Microgrid/MicrogridTable.js and 5 other locations - About 4 hrs to fix
myems-web/src/components/MyEMS/EnergyStoragePowerStation/EnergyStoragePowerStationTable.js on lines 47..56
myems-web/src/components/MyEMS/Shopfloor/PurchasesTable.js on lines 117..126
myems-web/src/components/MyEMS/Store/PurchasesTable.js on lines 117..126
myems-web/src/components/MyEMS/Tenant/PurchasesTable.js on lines 117..126
myems-web/src/components/dashboard/PurchasesTable.js on lines 117..126

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

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

const selectRow = onSelect => ({
  mode: 'checkbox',
  clickToSelect: false,
  selectionHeaderRenderer: ({ mode, ...rest }) => <SelectRowInput type="checkbox" {...rest} />,
  selectionRenderer: ({ mode, ...rest }) => <SelectRowInput type={mode} {...rest} />,
Severity: Major
Found in myems-web/src/components/MyEMS/Tenant/PurchasesTable.js and 5 other locations - About 4 hrs to fix
myems-web/src/components/MyEMS/EnergyStoragePowerStation/EnergyStoragePowerStationTable.js on lines 47..56
myems-web/src/components/MyEMS/Microgrid/MicrogridTable.js on lines 40..49
myems-web/src/components/MyEMS/Shopfloor/PurchasesTable.js on lines 117..126
myems-web/src/components/MyEMS/Store/PurchasesTable.js on lines 117..126
myems-web/src/components/dashboard/PurchasesTable.js on lines 117..126

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

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

const selectRow = onSelect => ({
  mode: 'checkbox',
  clickToSelect: false,
  selectionHeaderRenderer: ({ mode, ...rest }) => <SelectRowInput type="checkbox" {...rest} />,
  selectionRenderer: ({ mode, ...rest }) => <SelectRowInput type={mode} {...rest} />,
Severity: Major
Found in myems-web/src/components/MyEMS/Store/PurchasesTable.js and 5 other locations - About 4 hrs to fix
myems-web/src/components/MyEMS/EnergyStoragePowerStation/EnergyStoragePowerStationTable.js on lines 47..56
myems-web/src/components/MyEMS/Microgrid/MicrogridTable.js on lines 40..49
myems-web/src/components/MyEMS/Shopfloor/PurchasesTable.js on lines 117..126
myems-web/src/components/MyEMS/Tenant/PurchasesTable.js on lines 117..126
myems-web/src/components/dashboard/PurchasesTable.js on lines 117..126

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

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

const selectRow = onSelect => ({
  mode: 'checkbox',
  clickToSelect: false,
  selectionHeaderRenderer: ({ mode, ...rest }) => <SelectRowInput type="checkbox" {...rest} />,
  selectionRenderer: ({ mode, ...rest }) => <SelectRowInput type={mode} {...rest} />,
myems-web/src/components/MyEMS/Microgrid/MicrogridTable.js on lines 40..49
myems-web/src/components/MyEMS/Shopfloor/PurchasesTable.js on lines 117..126
myems-web/src/components/MyEMS/Store/PurchasesTable.js on lines 117..126
myems-web/src/components/MyEMS/Tenant/PurchasesTable.js on lines 117..126
myems-web/src/components/dashboard/PurchasesTable.js on lines 117..126

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

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

    await fetch(
      APIBaseURL +
      '/reports/enterproduction?' +
      'spaceid=' +
      selectedSpaceID +
Severity: Major
Found in myems-web/src/components/MyEMS/Space/EnterProduction.js and 1 other location - About 4 hrs to fix
myems-web/src/components/MyEMS/Meter/OfflineMeterInput.js on lines 123..168

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

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

  const handleSubmit = e => {
    e.preventDefault();
    console.log(moment(reportingPeriodDateRange[0]).format('YYYY-MM-DDTHH:mm:ss'));
    console.log(moment(reportingPeriodDateRange[1]).format('YYYY-MM-DDTHH:mm:ss'));

Severity: Major
Found in myems-web/src/components/MyEMS/Meter/OfflineMeterInput.js and 1 other location - About 4 hrs to fix
myems-web/src/components/MyEMS/Space/EnterProduction.js on lines 191..206

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

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

  const handleSubmit = e => {
    e.preventDefault();
    console.log(moment(reportingPeriodDateRange[0]).format('YYYY-MM-DDTHH:mm:ss'));
    console.log(moment(reportingPeriodDateRange[1]).format('YYYY-MM-DDTHH:mm:ss'));

Severity: Major
Found in myems-web/src/components/MyEMS/Space/EnterProduction.js and 1 other location - About 4 hrs to fix
myems-web/src/components/MyEMS/Meter/OfflineMeterInput.js on lines 233..248

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

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

  min: function(values){
    var min = Number.MAX_VALUE,
        i;

    if (values instanceof Array) {
myems-admin/js/plugins/jvectormap/jquery-jvectormap-2.0.2.min.js on lines 298..316

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

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

  max: function(values){
    var max = Number.MIN_VALUE,
        i;

    if (values instanceof Array) {
myems-admin/js/plugins/jvectormap/jquery-jvectormap-2.0.2.min.js on lines 278..296

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

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

    groupSegCols: function(segs) {
        var view = this.view;
        var segCols = [];
        var i;

Severity: Major
Found in myems-admin/js/plugins/fullcalendar/fullcalendar.js and 1 other location - About 4 hrs to fix
myems-admin/js/plugins/fullcalendar/fullcalendar.js on lines 5323..5337

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

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

    groupSegRows: function(segs) {
        var view = this.view;
        var segRows = [];
        var i;

Severity: Major
Found in myems-admin/js/plugins/fullcalendar/fullcalendar.js and 1 other location - About 4 hrs to fix
myems-admin/js/plugins/fullcalendar/fullcalendar.js on lines 6407..6421

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

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

            if rows is not None and len(rows) > 0:
                for row in rows:
                    result = {"id": row[0], "name": row[1], "description": row[2]}
                    workingcalendars_result.append(result)
                meta_result['working_calendars'] = workingcalendars_result
Severity: Major
Found in myems-api/core/tenant.py and 45 other locations - About 4 hrs to fix
myems-api/core/combinedequipment.py on lines 2357..2361
myems-api/core/combinedequipment.py on lines 2371..2375
myems-api/core/combinedequipment.py on lines 3030..3034
myems-api/core/combinedequipment.py on lines 3044..3048
myems-api/core/distributionsystem.py on lines 643..647
myems-api/core/equipment.py on lines 2174..2180
myems-api/core/equipment.py on lines 2776..2782
myems-api/core/shopfloor.py on lines 1998..2002
myems-api/core/shopfloor.py on lines 2011..2015
myems-api/core/shopfloor.py on lines 2136..2140
myems-api/core/shopfloor.py on lines 2149..2153
myems-api/core/shopfloor.py on lines 2559..2563
myems-api/core/shopfloor.py on lines 2572..2576
myems-api/core/shopfloor.py on lines 2697..2701
myems-api/core/shopfloor.py on lines 2710..2714
myems-api/core/space.py on lines 3737..3741
myems-api/core/space.py on lines 3828..3832
myems-api/core/space.py on lines 3841..3845
myems-api/core/space.py on lines 3854..3858
myems-api/core/space.py on lines 3892..3896
myems-api/core/space.py on lines 3905..3909
myems-api/core/space.py on lines 3918..3922
myems-api/core/space.py on lines 3931..3935
myems-api/core/space.py on lines 4649..4653
myems-api/core/space.py on lines 4740..4744
myems-api/core/space.py on lines 4753..4757
myems-api/core/space.py on lines 4766..4770
myems-api/core/space.py on lines 4804..4808
myems-api/core/space.py on lines 4817..4821
myems-api/core/space.py on lines 4830..4834
myems-api/core/space.py on lines 4843..4847
myems-api/core/store.py on lines 1958..1962
myems-api/core/store.py on lines 2074..2078
myems-api/core/store.py on lines 2087..2091
myems-api/core/store.py on lines 2534..2538
myems-api/core/store.py on lines 2548..2552
myems-api/core/store.py on lines 2561..2565
myems-api/core/store.py on lines 2574..2578
myems-api/core/store.py on lines 2612..2616
myems-api/core/store.py on lines 2625..2629
myems-api/core/tenant.py on lines 2082..2086
myems-api/core/tenant.py on lines 2202..2206
myems-api/core/tenant.py on lines 2710..2714
myems-api/core/tenant.py on lines 2830..2834
myems-api/core/tenant.py on lines 2843..2847

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

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

            if rows is not None and len(rows) > 0:
                for row in rows:
                    result = {"id": row[0], "name": row[1], "description": row[2]}
                    workingcalendar_result.append(result)
                meta_result['working_calendars'] = workingcalendar_result
Severity: Major
Found in myems-api/core/space.py and 45 other locations - About 4 hrs to fix
myems-api/core/combinedequipment.py on lines 2357..2361
myems-api/core/combinedequipment.py on lines 2371..2375
myems-api/core/combinedequipment.py on lines 3030..3034
myems-api/core/combinedequipment.py on lines 3044..3048
myems-api/core/distributionsystem.py on lines 643..647
myems-api/core/equipment.py on lines 2174..2180
myems-api/core/equipment.py on lines 2776..2782
myems-api/core/shopfloor.py on lines 1998..2002
myems-api/core/shopfloor.py on lines 2011..2015
myems-api/core/shopfloor.py on lines 2136..2140
myems-api/core/shopfloor.py on lines 2149..2153
myems-api/core/shopfloor.py on lines 2559..2563
myems-api/core/shopfloor.py on lines 2572..2576
myems-api/core/shopfloor.py on lines 2697..2701
myems-api/core/shopfloor.py on lines 2710..2714
myems-api/core/space.py on lines 3737..3741
myems-api/core/space.py on lines 3828..3832
myems-api/core/space.py on lines 3841..3845
myems-api/core/space.py on lines 3854..3858
myems-api/core/space.py on lines 3892..3896
myems-api/core/space.py on lines 3905..3909
myems-api/core/space.py on lines 3918..3922
myems-api/core/space.py on lines 4649..4653
myems-api/core/space.py on lines 4740..4744
myems-api/core/space.py on lines 4753..4757
myems-api/core/space.py on lines 4766..4770
myems-api/core/space.py on lines 4804..4808
myems-api/core/space.py on lines 4817..4821
myems-api/core/space.py on lines 4830..4834
myems-api/core/space.py on lines 4843..4847
myems-api/core/store.py on lines 1958..1962
myems-api/core/store.py on lines 2074..2078
myems-api/core/store.py on lines 2087..2091
myems-api/core/store.py on lines 2534..2538
myems-api/core/store.py on lines 2548..2552
myems-api/core/store.py on lines 2561..2565
myems-api/core/store.py on lines 2574..2578
myems-api/core/store.py on lines 2612..2616
myems-api/core/store.py on lines 2625..2629
myems-api/core/tenant.py on lines 2082..2086
myems-api/core/tenant.py on lines 2202..2206
myems-api/core/tenant.py on lines 2215..2219
myems-api/core/tenant.py on lines 2710..2714
myems-api/core/tenant.py on lines 2830..2834
myems-api/core/tenant.py on lines 2843..2847

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

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

            if rows is not None and len(rows) > 0:
                for row in rows:
                    result = {"id": row[0], "name": row[1], "uuid": row[2]}
                    store_result.append(result)
                meta_result['stores'] = store_result
Severity: Major
Found in myems-api/core/space.py and 45 other locations - About 4 hrs to fix
myems-api/core/combinedequipment.py on lines 2357..2361
myems-api/core/combinedequipment.py on lines 2371..2375
myems-api/core/combinedequipment.py on lines 3030..3034
myems-api/core/combinedequipment.py on lines 3044..3048
myems-api/core/distributionsystem.py on lines 643..647
myems-api/core/equipment.py on lines 2174..2180
myems-api/core/equipment.py on lines 2776..2782
myems-api/core/shopfloor.py on lines 1998..2002
myems-api/core/shopfloor.py on lines 2011..2015
myems-api/core/shopfloor.py on lines 2136..2140
myems-api/core/shopfloor.py on lines 2149..2153
myems-api/core/shopfloor.py on lines 2559..2563
myems-api/core/shopfloor.py on lines 2572..2576
myems-api/core/shopfloor.py on lines 2697..2701
myems-api/core/shopfloor.py on lines 2710..2714
myems-api/core/space.py on lines 3737..3741
myems-api/core/space.py on lines 3828..3832
myems-api/core/space.py on lines 3841..3845
myems-api/core/space.py on lines 3854..3858
myems-api/core/space.py on lines 3892..3896
myems-api/core/space.py on lines 3905..3909
myems-api/core/space.py on lines 3918..3922
myems-api/core/space.py on lines 3931..3935
myems-api/core/space.py on lines 4649..4653
myems-api/core/space.py on lines 4740..4744
myems-api/core/space.py on lines 4753..4757
myems-api/core/space.py on lines 4766..4770
myems-api/core/space.py on lines 4804..4808
myems-api/core/space.py on lines 4817..4821
myems-api/core/space.py on lines 4843..4847
myems-api/core/store.py on lines 1958..1962
myems-api/core/store.py on lines 2074..2078
myems-api/core/store.py on lines 2087..2091
myems-api/core/store.py on lines 2534..2538
myems-api/core/store.py on lines 2548..2552
myems-api/core/store.py on lines 2561..2565
myems-api/core/store.py on lines 2574..2578
myems-api/core/store.py on lines 2612..2616
myems-api/core/store.py on lines 2625..2629
myems-api/core/tenant.py on lines 2082..2086
myems-api/core/tenant.py on lines 2202..2206
myems-api/core/tenant.py on lines 2215..2219
myems-api/core/tenant.py on lines 2710..2714
myems-api/core/tenant.py on lines 2830..2834
myems-api/core/tenant.py on lines 2843..2847

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

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

            if rows is not None and len(rows) > 0:
                for row in rows:
                    result = {"id": row[0], "name": row[1], "description": row[2]}
                    workingcalendar_result.append(result)
                meta_result['working_calendar'] = workingcalendar_result
Severity: Major
Found in myems-api/core/store.py and 45 other locations - About 4 hrs to fix
myems-api/core/combinedequipment.py on lines 2357..2361
myems-api/core/combinedequipment.py on lines 2371..2375
myems-api/core/combinedequipment.py on lines 3030..3034
myems-api/core/combinedequipment.py on lines 3044..3048
myems-api/core/distributionsystem.py on lines 643..647
myems-api/core/equipment.py on lines 2174..2180
myems-api/core/equipment.py on lines 2776..2782
myems-api/core/shopfloor.py on lines 1998..2002
myems-api/core/shopfloor.py on lines 2011..2015
myems-api/core/shopfloor.py on lines 2136..2140
myems-api/core/shopfloor.py on lines 2149..2153
myems-api/core/shopfloor.py on lines 2559..2563
myems-api/core/shopfloor.py on lines 2572..2576
myems-api/core/shopfloor.py on lines 2697..2701
myems-api/core/shopfloor.py on lines 2710..2714
myems-api/core/space.py on lines 3737..3741
myems-api/core/space.py on lines 3828..3832
myems-api/core/space.py on lines 3841..3845
myems-api/core/space.py on lines 3854..3858
myems-api/core/space.py on lines 3892..3896
myems-api/core/space.py on lines 3905..3909
myems-api/core/space.py on lines 3918..3922
myems-api/core/space.py on lines 3931..3935
myems-api/core/space.py on lines 4649..4653
myems-api/core/space.py on lines 4740..4744
myems-api/core/space.py on lines 4753..4757
myems-api/core/space.py on lines 4766..4770
myems-api/core/space.py on lines 4804..4808
myems-api/core/space.py on lines 4817..4821
myems-api/core/space.py on lines 4830..4834
myems-api/core/space.py on lines 4843..4847
myems-api/core/store.py on lines 1958..1962
myems-api/core/store.py on lines 2074..2078
myems-api/core/store.py on lines 2534..2538
myems-api/core/store.py on lines 2548..2552
myems-api/core/store.py on lines 2561..2565
myems-api/core/store.py on lines 2574..2578
myems-api/core/store.py on lines 2612..2616
myems-api/core/store.py on lines 2625..2629
myems-api/core/tenant.py on lines 2082..2086
myems-api/core/tenant.py on lines 2202..2206
myems-api/core/tenant.py on lines 2215..2219
myems-api/core/tenant.py on lines 2710..2714
myems-api/core/tenant.py on lines 2830..2834
myems-api/core/tenant.py on lines 2843..2847

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

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