GladysProject/Gladys

View on GitHub

Showing 1,932 of 2,674 total issues

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

    async changeOrderDir(state, e) {
      store.setState({
        getRtspCameraOrderDir: e.target.value
      });
      await actions.getRtspCameraDevices(store.getState());
Severity: Major
Found in front/src/routes/integration/all/rtsp-camera/actions.js and 21 other locations - About 1 hr to fix
front/src/actions/house.js on lines 43..48
front/src/actions/house.js on lines 49..54
front/src/actions/scene.js on lines 34..39
front/src/actions/scene.js on lines 40..45
front/src/routes/integration/all/broadlink/device-page/actions.js on lines 69..74
front/src/routes/integration/all/broadlink/device-page/actions.js on lines 75..80
front/src/routes/integration/all/ewelink/actions.js on lines 197..202
front/src/routes/integration/all/ewelink/actions.js on lines 203..208
front/src/routes/integration/all/mqtt/device-page/actions.js on lines 65..70
front/src/routes/integration/all/mqtt/device-page/actions.js on lines 71..76
front/src/routes/integration/all/philips-hue/device-page/actions.js on lines 107..112
front/src/routes/integration/all/philips-hue/device-page/actions.js on lines 113..118
front/src/routes/integration/all/rtsp-camera/actions.js on lines 240..245
front/src/routes/integration/all/tasmota/actions.js on lines 122..127
front/src/routes/integration/all/tasmota/actions.js on lines 128..133
front/src/routes/integration/all/tp-link/device-page/actions.js on lines 105..110
front/src/routes/integration/all/tp-link/device-page/actions.js on lines 111..116
front/src/routes/integration/all/xiaomi/actions.js on lines 98..103
front/src/routes/integration/all/xiaomi/actions.js on lines 104..109
front/src/routes/integration/all/zwave/node-page/actions.js on lines 71..76
front/src/routes/integration/all/zwave/node-page/actions.js on lines 77..82

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

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

    async search(state, e) {
      store.setState({
        sceneSearch: e.target.value
      });
      await actions.getScenes(store.getState());
Severity: Major
Found in front/src/actions/scene.js and 21 other locations - About 1 hr to fix
front/src/actions/house.js on lines 43..48
front/src/actions/house.js on lines 49..54
front/src/actions/scene.js on lines 40..45
front/src/routes/integration/all/broadlink/device-page/actions.js on lines 69..74
front/src/routes/integration/all/broadlink/device-page/actions.js on lines 75..80
front/src/routes/integration/all/ewelink/actions.js on lines 197..202
front/src/routes/integration/all/ewelink/actions.js on lines 203..208
front/src/routes/integration/all/mqtt/device-page/actions.js on lines 65..70
front/src/routes/integration/all/mqtt/device-page/actions.js on lines 71..76
front/src/routes/integration/all/philips-hue/device-page/actions.js on lines 107..112
front/src/routes/integration/all/philips-hue/device-page/actions.js on lines 113..118
front/src/routes/integration/all/rtsp-camera/actions.js on lines 240..245
front/src/routes/integration/all/rtsp-camera/actions.js on lines 246..251
front/src/routes/integration/all/tasmota/actions.js on lines 122..127
front/src/routes/integration/all/tasmota/actions.js on lines 128..133
front/src/routes/integration/all/tp-link/device-page/actions.js on lines 105..110
front/src/routes/integration/all/tp-link/device-page/actions.js on lines 111..116
front/src/routes/integration/all/xiaomi/actions.js on lines 98..103
front/src/routes/integration/all/xiaomi/actions.js on lines 104..109
front/src/routes/integration/all/zwave/node-page/actions.js on lines 71..76
front/src/routes/integration/all/zwave/node-page/actions.js on lines 77..82

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

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

    async changeOrderDir(state, e) {
      store.setState({
        getMqttDeviceOrderDir: e.target.value
      });
      await actions.getMqttDevices(store.getState());
front/src/actions/house.js on lines 43..48
front/src/actions/house.js on lines 49..54
front/src/actions/scene.js on lines 34..39
front/src/actions/scene.js on lines 40..45
front/src/routes/integration/all/broadlink/device-page/actions.js on lines 69..74
front/src/routes/integration/all/broadlink/device-page/actions.js on lines 75..80
front/src/routes/integration/all/ewelink/actions.js on lines 197..202
front/src/routes/integration/all/ewelink/actions.js on lines 203..208
front/src/routes/integration/all/mqtt/device-page/actions.js on lines 65..70
front/src/routes/integration/all/philips-hue/device-page/actions.js on lines 107..112
front/src/routes/integration/all/philips-hue/device-page/actions.js on lines 113..118
front/src/routes/integration/all/rtsp-camera/actions.js on lines 240..245
front/src/routes/integration/all/rtsp-camera/actions.js on lines 246..251
front/src/routes/integration/all/tasmota/actions.js on lines 122..127
front/src/routes/integration/all/tasmota/actions.js on lines 128..133
front/src/routes/integration/all/tp-link/device-page/actions.js on lines 105..110
front/src/routes/integration/all/tp-link/device-page/actions.js on lines 111..116
front/src/routes/integration/all/xiaomi/actions.js on lines 98..103
front/src/routes/integration/all/xiaomi/actions.js on lines 104..109
front/src/routes/integration/all/zwave/node-page/actions.js on lines 71..76
front/src/routes/integration/all/zwave/node-page/actions.js on lines 77..82

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

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

    async search(state, e) {
      store.setState({
        mqttDeviceSearch: e.target.value
      });
      await actions.getMqttDevices(store.getState());
front/src/actions/house.js on lines 43..48
front/src/actions/house.js on lines 49..54
front/src/actions/scene.js on lines 34..39
front/src/actions/scene.js on lines 40..45
front/src/routes/integration/all/broadlink/device-page/actions.js on lines 69..74
front/src/routes/integration/all/broadlink/device-page/actions.js on lines 75..80
front/src/routes/integration/all/ewelink/actions.js on lines 197..202
front/src/routes/integration/all/ewelink/actions.js on lines 203..208
front/src/routes/integration/all/mqtt/device-page/actions.js on lines 71..76
front/src/routes/integration/all/philips-hue/device-page/actions.js on lines 107..112
front/src/routes/integration/all/philips-hue/device-page/actions.js on lines 113..118
front/src/routes/integration/all/rtsp-camera/actions.js on lines 240..245
front/src/routes/integration/all/rtsp-camera/actions.js on lines 246..251
front/src/routes/integration/all/tasmota/actions.js on lines 122..127
front/src/routes/integration/all/tasmota/actions.js on lines 128..133
front/src/routes/integration/all/tp-link/device-page/actions.js on lines 105..110
front/src/routes/integration/all/tp-link/device-page/actions.js on lines 111..116
front/src/routes/integration/all/xiaomi/actions.js on lines 98..103
front/src/routes/integration/all/xiaomi/actions.js on lines 104..109
front/src/routes/integration/all/zwave/node-page/actions.js on lines 71..76
front/src/routes/integration/all/zwave/node-page/actions.js on lines 77..82

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

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

    async search(state, e) {
      store.setState({
        philipsHueDeviceSearch: e.target.value
      });
      await actions.getPhilipsHueDevices(store.getState());
front/src/actions/house.js on lines 43..48
front/src/actions/house.js on lines 49..54
front/src/actions/scene.js on lines 34..39
front/src/actions/scene.js on lines 40..45
front/src/routes/integration/all/broadlink/device-page/actions.js on lines 69..74
front/src/routes/integration/all/broadlink/device-page/actions.js on lines 75..80
front/src/routes/integration/all/ewelink/actions.js on lines 197..202
front/src/routes/integration/all/ewelink/actions.js on lines 203..208
front/src/routes/integration/all/mqtt/device-page/actions.js on lines 65..70
front/src/routes/integration/all/mqtt/device-page/actions.js on lines 71..76
front/src/routes/integration/all/philips-hue/device-page/actions.js on lines 113..118
front/src/routes/integration/all/rtsp-camera/actions.js on lines 240..245
front/src/routes/integration/all/rtsp-camera/actions.js on lines 246..251
front/src/routes/integration/all/tasmota/actions.js on lines 122..127
front/src/routes/integration/all/tasmota/actions.js on lines 128..133
front/src/routes/integration/all/tp-link/device-page/actions.js on lines 105..110
front/src/routes/integration/all/tp-link/device-page/actions.js on lines 111..116
front/src/routes/integration/all/xiaomi/actions.js on lines 98..103
front/src/routes/integration/all/xiaomi/actions.js on lines 104..109
front/src/routes/integration/all/zwave/node-page/actions.js on lines 71..76
front/src/routes/integration/all/zwave/node-page/actions.js on lines 77..82

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

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

    async changeOrderDir(state, e) {
      store.setState({
        getTpLinkDeviceOrderDir: e.target.value
      });
      await actions.getTpLinkDevices(store.getState());
front/src/actions/house.js on lines 43..48
front/src/actions/house.js on lines 49..54
front/src/actions/scene.js on lines 34..39
front/src/actions/scene.js on lines 40..45
front/src/routes/integration/all/broadlink/device-page/actions.js on lines 69..74
front/src/routes/integration/all/broadlink/device-page/actions.js on lines 75..80
front/src/routes/integration/all/ewelink/actions.js on lines 197..202
front/src/routes/integration/all/ewelink/actions.js on lines 203..208
front/src/routes/integration/all/mqtt/device-page/actions.js on lines 65..70
front/src/routes/integration/all/mqtt/device-page/actions.js on lines 71..76
front/src/routes/integration/all/philips-hue/device-page/actions.js on lines 107..112
front/src/routes/integration/all/philips-hue/device-page/actions.js on lines 113..118
front/src/routes/integration/all/rtsp-camera/actions.js on lines 240..245
front/src/routes/integration/all/rtsp-camera/actions.js on lines 246..251
front/src/routes/integration/all/tasmota/actions.js on lines 122..127
front/src/routes/integration/all/tasmota/actions.js on lines 128..133
front/src/routes/integration/all/tp-link/device-page/actions.js on lines 105..110
front/src/routes/integration/all/xiaomi/actions.js on lines 98..103
front/src/routes/integration/all/xiaomi/actions.js on lines 104..109
front/src/routes/integration/all/zwave/node-page/actions.js on lines 71..76
front/src/routes/integration/all/zwave/node-page/actions.js on lines 77..82

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

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

    async search(state, e) {
      store.setState({
        zwaveDeviceSearch: e.target.value
      });
      await actions.getZWaveDevices(store.getState());
front/src/actions/house.js on lines 43..48
front/src/actions/house.js on lines 49..54
front/src/actions/scene.js on lines 34..39
front/src/actions/scene.js on lines 40..45
front/src/routes/integration/all/broadlink/device-page/actions.js on lines 69..74
front/src/routes/integration/all/broadlink/device-page/actions.js on lines 75..80
front/src/routes/integration/all/ewelink/actions.js on lines 197..202
front/src/routes/integration/all/ewelink/actions.js on lines 203..208
front/src/routes/integration/all/mqtt/device-page/actions.js on lines 65..70
front/src/routes/integration/all/mqtt/device-page/actions.js on lines 71..76
front/src/routes/integration/all/philips-hue/device-page/actions.js on lines 107..112
front/src/routes/integration/all/philips-hue/device-page/actions.js on lines 113..118
front/src/routes/integration/all/rtsp-camera/actions.js on lines 240..245
front/src/routes/integration/all/rtsp-camera/actions.js on lines 246..251
front/src/routes/integration/all/tasmota/actions.js on lines 122..127
front/src/routes/integration/all/tasmota/actions.js on lines 128..133
front/src/routes/integration/all/tp-link/device-page/actions.js on lines 105..110
front/src/routes/integration/all/tp-link/device-page/actions.js on lines 111..116
front/src/routes/integration/all/xiaomi/actions.js on lines 98..103
front/src/routes/integration/all/xiaomi/actions.js on lines 104..109
front/src/routes/integration/all/zwave/node-page/actions.js on lines 77..82

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

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

    async changeOrderDir(state, e) {
      store.setState({
        getEweLinkOrderDir: e.target.value
      });
      await actions.getEweLinkDevices(store.getState());
Severity: Major
Found in front/src/routes/integration/all/ewelink/actions.js and 21 other locations - About 1 hr to fix
front/src/actions/house.js on lines 43..48
front/src/actions/house.js on lines 49..54
front/src/actions/scene.js on lines 34..39
front/src/actions/scene.js on lines 40..45
front/src/routes/integration/all/broadlink/device-page/actions.js on lines 69..74
front/src/routes/integration/all/broadlink/device-page/actions.js on lines 75..80
front/src/routes/integration/all/ewelink/actions.js on lines 197..202
front/src/routes/integration/all/mqtt/device-page/actions.js on lines 65..70
front/src/routes/integration/all/mqtt/device-page/actions.js on lines 71..76
front/src/routes/integration/all/philips-hue/device-page/actions.js on lines 107..112
front/src/routes/integration/all/philips-hue/device-page/actions.js on lines 113..118
front/src/routes/integration/all/rtsp-camera/actions.js on lines 240..245
front/src/routes/integration/all/rtsp-camera/actions.js on lines 246..251
front/src/routes/integration/all/tasmota/actions.js on lines 122..127
front/src/routes/integration/all/tasmota/actions.js on lines 128..133
front/src/routes/integration/all/tp-link/device-page/actions.js on lines 105..110
front/src/routes/integration/all/tp-link/device-page/actions.js on lines 111..116
front/src/routes/integration/all/xiaomi/actions.js on lines 98..103
front/src/routes/integration/all/xiaomi/actions.js on lines 104..109
front/src/routes/integration/all/zwave/node-page/actions.js on lines 71..76
front/src/routes/integration/all/zwave/node-page/actions.js on lines 77..82

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

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

    async search(state, e) {
      store.setState({
        housesSearch: e.target.value
      });
      await actions.getHouses(store.getState());
Severity: Major
Found in front/src/actions/house.js and 21 other locations - About 1 hr to fix
front/src/actions/house.js on lines 49..54
front/src/actions/scene.js on lines 34..39
front/src/actions/scene.js on lines 40..45
front/src/routes/integration/all/broadlink/device-page/actions.js on lines 69..74
front/src/routes/integration/all/broadlink/device-page/actions.js on lines 75..80
front/src/routes/integration/all/ewelink/actions.js on lines 197..202
front/src/routes/integration/all/ewelink/actions.js on lines 203..208
front/src/routes/integration/all/mqtt/device-page/actions.js on lines 65..70
front/src/routes/integration/all/mqtt/device-page/actions.js on lines 71..76
front/src/routes/integration/all/philips-hue/device-page/actions.js on lines 107..112
front/src/routes/integration/all/philips-hue/device-page/actions.js on lines 113..118
front/src/routes/integration/all/rtsp-camera/actions.js on lines 240..245
front/src/routes/integration/all/rtsp-camera/actions.js on lines 246..251
front/src/routes/integration/all/tasmota/actions.js on lines 122..127
front/src/routes/integration/all/tasmota/actions.js on lines 128..133
front/src/routes/integration/all/tp-link/device-page/actions.js on lines 105..110
front/src/routes/integration/all/tp-link/device-page/actions.js on lines 111..116
front/src/routes/integration/all/xiaomi/actions.js on lines 98..103
front/src/routes/integration/all/xiaomi/actions.js on lines 104..109
front/src/routes/integration/all/zwave/node-page/actions.js on lines 71..76
front/src/routes/integration/all/zwave/node-page/actions.js on lines 77..82

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

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

    local_temperature: {
      feature: {
        category: DEVICE_FEATURE_CATEGORIES.TEMPERATURE_SENSOR,
        type: DEVICE_FEATURE_TYPES.SENSOR.DECIMAL,
        unit: DEVICE_FEATURE_UNITS.CELSIUS,
Severity: Major
Found in server/services/zigbee2mqtt/exposes/numericType.js and 6 other locations - About 1 hr to fix
server/services/zigbee2mqtt/exposes/numericType.js on lines 105..113
server/services/zigbee2mqtt/exposes/numericType.js on lines 114..122
server/services/zigbee2mqtt/exposes/numericType.js on lines 226..234
server/services/zigbee2mqtt/exposes/numericType.js on lines 764..772
server/services/zigbee2mqtt/exposes/numericType.js on lines 773..781
server/services/zigbee2mqtt/exposes/numericType.js on lines 782..790

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

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

    angle_x: {
      feature: {
        category: DEVICE_FEATURE_CATEGORIES.VIBRATION_SENSOR,
        type: DEVICE_FEATURE_TYPES.VIBRATION_SENSOR.ANGLE_X,
        unit: DEVICE_FEATURE_UNITS.DEGREE,
Severity: Major
Found in server/services/zigbee2mqtt/exposes/numericType.js and 6 other locations - About 1 hr to fix
server/services/zigbee2mqtt/exposes/numericType.js on lines 105..113
server/services/zigbee2mqtt/exposes/numericType.js on lines 114..122
server/services/zigbee2mqtt/exposes/numericType.js on lines 169..177
server/services/zigbee2mqtt/exposes/numericType.js on lines 226..234
server/services/zigbee2mqtt/exposes/numericType.js on lines 773..781
server/services/zigbee2mqtt/exposes/numericType.js on lines 782..790

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

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

    temperature: {
      feature: {
        category: DEVICE_FEATURE_CATEGORIES.TEMPERATURE_SENSOR,
        type: DEVICE_FEATURE_TYPES.SENSOR.DECIMAL,
        unit: DEVICE_FEATURE_UNITS.CELSIUS,
Severity: Major
Found in server/services/zigbee2mqtt/exposes/numericType.js and 6 other locations - About 1 hr to fix
server/services/zigbee2mqtt/exposes/numericType.js on lines 105..113
server/services/zigbee2mqtt/exposes/numericType.js on lines 114..122
server/services/zigbee2mqtt/exposes/numericType.js on lines 169..177
server/services/zigbee2mqtt/exposes/numericType.js on lines 764..772
server/services/zigbee2mqtt/exposes/numericType.js on lines 773..781
server/services/zigbee2mqtt/exposes/numericType.js on lines 782..790

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

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

    angle_z: {
      feature: {
        category: DEVICE_FEATURE_CATEGORIES.VIBRATION_SENSOR,
        type: DEVICE_FEATURE_TYPES.VIBRATION_SENSOR.ANGLE_Z,
        unit: DEVICE_FEATURE_UNITS.DEGREE,
Severity: Major
Found in server/services/zigbee2mqtt/exposes/numericType.js and 6 other locations - About 1 hr to fix
server/services/zigbee2mqtt/exposes/numericType.js on lines 105..113
server/services/zigbee2mqtt/exposes/numericType.js on lines 114..122
server/services/zigbee2mqtt/exposes/numericType.js on lines 169..177
server/services/zigbee2mqtt/exposes/numericType.js on lines 226..234
server/services/zigbee2mqtt/exposes/numericType.js on lines 764..772
server/services/zigbee2mqtt/exposes/numericType.js on lines 773..781

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

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

    device_temperature: {
      feature: {
        category: DEVICE_FEATURE_CATEGORIES.DEVICE_TEMPERATURE_SENSOR,
        type: DEVICE_FEATURE_TYPES.SENSOR.DECIMAL,
        unit: DEVICE_FEATURE_UNITS.CELSIUS,
Severity: Major
Found in server/services/zigbee2mqtt/exposes/numericType.js and 6 other locations - About 1 hr to fix
server/services/zigbee2mqtt/exposes/numericType.js on lines 105..113
server/services/zigbee2mqtt/exposes/numericType.js on lines 169..177
server/services/zigbee2mqtt/exposes/numericType.js on lines 226..234
server/services/zigbee2mqtt/exposes/numericType.js on lines 764..772
server/services/zigbee2mqtt/exposes/numericType.js on lines 773..781
server/services/zigbee2mqtt/exposes/numericType.js on lines 782..790

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

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

    angle_y: {
      feature: {
        category: DEVICE_FEATURE_CATEGORIES.VIBRATION_SENSOR,
        type: DEVICE_FEATURE_TYPES.VIBRATION_SENSOR.ANGLE_Y,
        unit: DEVICE_FEATURE_UNITS.DEGREE,
Severity: Major
Found in server/services/zigbee2mqtt/exposes/numericType.js and 6 other locations - About 1 hr to fix
server/services/zigbee2mqtt/exposes/numericType.js on lines 105..113
server/services/zigbee2mqtt/exposes/numericType.js on lines 114..122
server/services/zigbee2mqtt/exposes/numericType.js on lines 169..177
server/services/zigbee2mqtt/exposes/numericType.js on lines 226..234
server/services/zigbee2mqtt/exposes/numericType.js on lines 764..772
server/services/zigbee2mqtt/exposes/numericType.js on lines 782..790

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

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

    cpu_temperature: {
      feature: {
        category: DEVICE_FEATURE_CATEGORIES.DEVICE_TEMPERATURE_SENSOR,
        type: DEVICE_FEATURE_TYPES.SENSOR.DECIMAL,
        unit: DEVICE_FEATURE_UNITS.CELSIUS,
Severity: Major
Found in server/services/zigbee2mqtt/exposes/numericType.js and 6 other locations - About 1 hr to fix
server/services/zigbee2mqtt/exposes/numericType.js on lines 114..122
server/services/zigbee2mqtt/exposes/numericType.js on lines 169..177
server/services/zigbee2mqtt/exposes/numericType.js on lines 226..234
server/services/zigbee2mqtt/exposes/numericType.js on lines 764..772
server/services/zigbee2mqtt/exposes/numericType.js on lines 773..781
server/services/zigbee2mqtt/exposes/numericType.js on lines 782..790

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

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

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

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

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

Refactorings

Further Reading

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

  const deviceFeature = device.features.find(
    (dF) => dF.category === DEVICE_FEATURE_CATEGORIES.CAMERA && dF.type === DEVICE_FEATURE_TYPES.CAMERA.IMAGE,
  );
Severity: Major
Found in server/lib/device/camera/camera.getImage.js and 1 other location - About 1 hr to fix
server/lib/device/camera/camera.setImage.js on lines 24..26

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

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

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

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

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

Refactorings

Further Reading

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

    if (this.markerArray.length >= 1) {
      const group = leaflet.featureGroup(this.markerArray);
      this.leafletMap.fitBounds(group.getBounds(), { padding: [150, 150] });
    }
Severity: Major
Found in front/src/routes/map/Map.jsx and 1 other location - About 1 hr to fix
front/src/routes/map/NewAreaMap.jsx on lines 69..72

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

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

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

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

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

Refactorings

Further Reading

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

  this.mqttClient.publish(topic, message, undefined, (err) => {
    if (err) {
      logger.warn(`MQTT - Error publishing to ${topic} : ${err}`);
    }
  });
Severity: Major
Found in server/services/zwavejs-ui/lib/zwaveJSUI.publish.js and 1 other location - About 1 hr to fix
server/services/mqtt/lib/publish.js on lines 13..17

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

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

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

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

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

Refactorings

Further Reading

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

    this.mqttClient.publish(topic, message, undefined, (err) => {
      if (err) {
        logger.warn(`MQTT - Error publishing to ${topic} : ${err}`);
      }
    });
Severity: Major
Found in server/services/mqtt/lib/publish.js and 1 other location - About 1 hr to fix
server/services/zwavejs-ui/lib/zwaveJSUI.publish.js on lines 15..19

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

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