GladysProject/Gladys

View on GitHub

Showing 1,932 of 2,674 total issues

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

  async function getRooms(req, res) {
    const rooms = await gladys.house.getRooms(req.params.house_selector);
    res.json(rooms);
  }
Severity: Major
Found in server/api/controllers/house.controller.js and 6 other locations - About 55 mins to fix
server/api/controllers/dashboard.controller.js on lines 37..40
server/api/controllers/house.controller.js on lines 63..66
server/api/controllers/house.controller.js on lines 145..148
server/api/controllers/house.controller.js on lines 165..168
server/api/controllers/scene.controller.js on lines 54..57
server/api/controllers/user.controller.js on lines 78..81

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

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

  async function partialArm(req, res) {
    const house = await gladys.house.partialArm(req.params.house_selector);
    res.json(house);
  }
Severity: Major
Found in server/api/controllers/house.controller.js and 6 other locations - About 55 mins to fix
server/api/controllers/dashboard.controller.js on lines 37..40
server/api/controllers/house.controller.js on lines 63..66
server/api/controllers/house.controller.js on lines 125..128
server/api/controllers/house.controller.js on lines 145..148
server/api/controllers/scene.controller.js on lines 54..57
server/api/controllers/user.controller.js on lines 78..81

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

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

  async function installMqttContainer(req, res) {
    logger.debug('Install MQTT container');
    await zigbee2mqttManager.installMqttContainer();
    res.json({
      success: true,
Severity: Major
Found in server/services/zigbee2mqtt/api/zigbee2mqtt.controller.js and 6 other locations - About 55 mins to fix
server/services/node-red/api/node-red.controller.js on lines 21..27
server/services/node-red/api/node-red.controller.js on lines 34..40
server/services/zigbee2mqtt/api/zigbee2mqtt.controller.js on lines 57..63
server/services/zigbee2mqtt/api/zigbee2mqtt.controller.js on lines 83..89
server/services/zigbee2mqtt/api/zigbee2mqtt.controller.js on lines 96..102
server/services/zigbee2mqtt/api/zigbee2mqtt.controller.js on lines 109..115

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

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

  async function disarm(req, res) {
    const house = await gladys.house.disarm(req.params.house_selector);
    res.json(house);
  }
Severity: Major
Found in server/api/controllers/house.controller.js and 6 other locations - About 55 mins to fix
server/api/controllers/dashboard.controller.js on lines 37..40
server/api/controllers/house.controller.js on lines 63..66
server/api/controllers/house.controller.js on lines 125..128
server/api/controllers/house.controller.js on lines 165..168
server/api/controllers/scene.controller.js on lines 54..57
server/api/controllers/user.controller.js on lines 78..81

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

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

  async function installNodeRedContainer(req, res) {
    logger.debug('Install Node-RED container');
    await nodeRedManager.installContainer();
    res.json({
      success: true,
Severity: Major
Found in server/services/node-red/api/node-red.controller.js and 6 other locations - About 55 mins to fix
server/services/node-red/api/node-red.controller.js on lines 21..27
server/services/zigbee2mqtt/api/zigbee2mqtt.controller.js on lines 57..63
server/services/zigbee2mqtt/api/zigbee2mqtt.controller.js on lines 70..76
server/services/zigbee2mqtt/api/zigbee2mqtt.controller.js on lines 83..89
server/services/zigbee2mqtt/api/zigbee2mqtt.controller.js on lines 96..102
server/services/zigbee2mqtt/api/zigbee2mqtt.controller.js on lines 109..115

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

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

  async function installZ2mContainer(req, res) {
    logger.debug('Install Z2M container');
    await zigbee2mqttManager.installZ2mContainer();
    res.json({
      success: true,
Severity: Major
Found in server/services/zigbee2mqtt/api/zigbee2mqtt.controller.js and 6 other locations - About 55 mins to fix
server/services/node-red/api/node-red.controller.js on lines 21..27
server/services/node-red/api/node-red.controller.js on lines 34..40
server/services/zigbee2mqtt/api/zigbee2mqtt.controller.js on lines 57..63
server/services/zigbee2mqtt/api/zigbee2mqtt.controller.js on lines 70..76
server/services/zigbee2mqtt/api/zigbee2mqtt.controller.js on lines 96..102
server/services/zigbee2mqtt/api/zigbee2mqtt.controller.js on lines 109..115

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

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

  componentDidMount() {
    this.refreshData();
    this.props.session.dispatcher.addListener(WEBSOCKET_MESSAGE_TYPES.DEVICE.NEW_STATE, this.updateRoomTemperature);
  }
Severity: Major
Found in front/src/components/boxs/room-temperature/RoomTemperature.jsx and 5 other locations - About 55 mins to fix
front/src/components/boxs/chart/Chart.jsx on lines 241..247
front/src/components/boxs/music/MusicBox.jsx on lines 89..95
front/src/components/boxs/room-humidity/RoomHumidity.jsx on lines 63..66
front/src/routes/integration/all/zwavejs-ui/discover-page/DiscoverTab.jsx on lines 46..52
front/src/routes/locked/index.js on lines 146..149

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

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

  componentDidMount() {
    this.getData();
    this.props.session.dispatcher.addListener(
      WEBSOCKET_MESSAGE_TYPES.DEVICE.NEW_STATE,
      this.updateDeviceStateWebsocket
Severity: Major
Found in front/src/components/boxs/chart/Chart.jsx and 5 other locations - About 55 mins to fix
front/src/components/boxs/music/MusicBox.jsx on lines 89..95
front/src/components/boxs/room-humidity/RoomHumidity.jsx on lines 63..66
front/src/components/boxs/room-temperature/RoomTemperature.jsx on lines 70..73
front/src/routes/integration/all/zwavejs-ui/discover-page/DiscoverTab.jsx on lines 46..52
front/src/routes/locked/index.js on lines 146..149

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

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

  async function connect(req, res) {
    logger.debug('Entering connect step');
    await zigbee2mqttManager.init();
    res.json({
      success: true,
Severity: Major
Found in server/services/zigbee2mqtt/api/zigbee2mqtt.controller.js and 6 other locations - About 55 mins to fix
server/services/node-red/api/node-red.controller.js on lines 21..27
server/services/node-red/api/node-red.controller.js on lines 34..40
server/services/zigbee2mqtt/api/zigbee2mqtt.controller.js on lines 70..76
server/services/zigbee2mqtt/api/zigbee2mqtt.controller.js on lines 83..89
server/services/zigbee2mqtt/api/zigbee2mqtt.controller.js on lines 96..102
server/services/zigbee2mqtt/api/zigbee2mqtt.controller.js on lines 109..115

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

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

        <button onClick={props.addHouse} class="btn btn-outline-primary ml-2">
          <Text id="housesSettings.newButton" /> <i class="fe fe-plus" />
        </button>
Severity: Major
Found in front/src/routes/settings/settings-house/HousePage.jsx and 5 other locations - About 55 mins to fix
front/src/routes/dashboard/edit-dashboard/EditActions.jsx on lines 9..11
front/src/routes/dashboard/edit-dashboard/EditActions.jsx on lines 12..14
front/src/routes/dashboard/edit-dashboard/EditActions.jsx on lines 15..17
front/src/routes/dashboard/edit-dashboard/EditActions.jsx on lines 24..26
front/src/routes/dashboard/edit-dashboard/EditActions.jsx on lines 27..29

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

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

            <button onClick={props.deleteCurrentDashboard} className="btn btn-outline-danger btn-sm ml-2">
              <Text id="dashboard.editDashboardDeleteButton" /> <i class="fe fe-trash" />
            </button>
Severity: Major
Found in front/src/routes/dashboard/edit-dashboard/EditActions.jsx and 5 other locations - About 55 mins to fix
front/src/routes/dashboard/edit-dashboard/EditActions.jsx on lines 9..11
front/src/routes/dashboard/edit-dashboard/EditActions.jsx on lines 12..14
front/src/routes/dashboard/edit-dashboard/EditActions.jsx on lines 15..17
front/src/routes/dashboard/edit-dashboard/EditActions.jsx on lines 27..29
front/src/routes/settings/settings-house/HousePage.jsx on lines 23..25

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

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

  async function getBySelector(req, res) {
    const house = await gladys.house.getBySelector(req.params.house_selector);
    res.json(house);
  }
Severity: Major
Found in server/api/controllers/house.controller.js and 6 other locations - About 55 mins to fix
server/api/controllers/dashboard.controller.js on lines 37..40
server/api/controllers/house.controller.js on lines 125..128
server/api/controllers/house.controller.js on lines 145..148
server/api/controllers/house.controller.js on lines 165..168
server/api/controllers/scene.controller.js on lines 54..57
server/api/controllers/user.controller.js on lines 78..81

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

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

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

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

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

Refactorings

Further Reading

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

    if (isNullOrUndefined(get(this.props, 'action.ecowatt_network_status'))) {
      this.props.updateActionProperty(this.props.columnIndex, this.props.index, 'ecowatt_network_status', 'ok');
    }
Severity: Major
Found in front/src/routes/scene/edit-scene/actions/EcowattCondition.jsx and 4 other locations - About 55 mins to fix
front/src/routes/scene/edit-scene/actions/CalendarIsEventRunning.jsx on lines 97..104
front/src/routes/scene/edit-scene/actions/EdfTempoCondition.jsx on lines 32..34
front/src/routes/scene/edit-scene/actions/EdfTempoCondition.jsx on lines 35..37
front/src/routes/scene/edit-scene/actions/EdfTempoCondition.jsx on lines 38..45

Duplicated Code

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

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

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

Tuning

This issue has a mass of 54.

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

  componentDidMount() {
    this.refreshData();
    this.props.session.dispatcher.addListener(WEBSOCKET_MESSAGE_TYPES.DEVICE.NEW_STATE, this.updateRoomHumidity);
  }
Severity: Major
Found in front/src/components/boxs/room-humidity/RoomHumidity.jsx and 5 other locations - About 55 mins to fix
front/src/components/boxs/chart/Chart.jsx on lines 241..247
front/src/components/boxs/music/MusicBox.jsx on lines 89..95
front/src/components/boxs/room-temperature/RoomTemperature.jsx on lines 70..73
front/src/routes/integration/all/zwavejs-ui/discover-page/DiscoverTab.jsx on lines 46..52
front/src/routes/locked/index.js on lines 146..149

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

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

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

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

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

Refactorings

Further Reading

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

    if (isNullOrUndefined(get(this.props, 'action.edf_tempo_peak_hour_type'))) {
      this.props.updateActionProperty(
        this.props.columnIndex,
        this.props.index,
        'edf_tempo_peak_hour_type',
front/src/routes/scene/edit-scene/actions/CalendarIsEventRunning.jsx on lines 97..104
front/src/routes/scene/edit-scene/actions/EcowattCondition.jsx on lines 14..16
front/src/routes/scene/edit-scene/actions/EdfTempoCondition.jsx on lines 32..34
front/src/routes/scene/edit-scene/actions/EdfTempoCondition.jsx on lines 35..37

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

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

            <button onClick={props.askDeleteCurrentDashboard} className="btn btn-outline-danger btn-sm ml-2">
              <Text id="dashboard.editDashboardDeleteButton" /> <i class="fe fe-trash" />
            </button>
Severity: Major
Found in front/src/routes/dashboard/edit-dashboard/EditActions.jsx and 5 other locations - About 55 mins to fix
front/src/routes/dashboard/edit-dashboard/EditActions.jsx on lines 9..11
front/src/routes/dashboard/edit-dashboard/EditActions.jsx on lines 15..17
front/src/routes/dashboard/edit-dashboard/EditActions.jsx on lines 24..26
front/src/routes/dashboard/edit-dashboard/EditActions.jsx on lines 27..29
front/src/routes/settings/settings-house/HousePage.jsx on lines 23..25

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

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

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

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

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

Refactorings

Further Reading

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

    if (isNullOrUndefined(get(this.props, 'action.edf_tempo_day'))) {
      this.props.updateActionProperty(this.props.columnIndex, this.props.index, 'edf_tempo_day', 'today');
    }
front/src/routes/scene/edit-scene/actions/CalendarIsEventRunning.jsx on lines 97..104
front/src/routes/scene/edit-scene/actions/EcowattCondition.jsx on lines 14..16
front/src/routes/scene/edit-scene/actions/EdfTempoCondition.jsx on lines 35..37
front/src/routes/scene/edit-scene/actions/EdfTempoCondition.jsx on lines 38..45

Duplicated Code

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

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

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

Tuning

This issue has a mass of 54.

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

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

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

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

Refactorings

Further Reading

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

    if (isNullOrUndefined(get(this.props, 'action.calendar_event_name_comparator'))) {
      this.props.updateActionProperty(
        this.props.columnIndex,
        this.props.index,
        'calendar_event_name_comparator',
front/src/routes/scene/edit-scene/actions/EcowattCondition.jsx on lines 14..16
front/src/routes/scene/edit-scene/actions/EdfTempoCondition.jsx on lines 32..34
front/src/routes/scene/edit-scene/actions/EdfTempoCondition.jsx on lines 35..37
front/src/routes/scene/edit-scene/actions/EdfTempoCondition.jsx on lines 38..45

Duplicated Code

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

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

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

Tuning

This issue has a mass of 54.

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

            <button onClick={props.cancelDashboardEdit} className="btn btn-outline-secondary btn-sm ml-2">
              <Text id="dashboard.editDashboardCancelButton" /> <i class="fe fe-slash" />
            </button>
Severity: Major
Found in front/src/routes/dashboard/edit-dashboard/EditActions.jsx and 5 other locations - About 55 mins to fix
front/src/routes/dashboard/edit-dashboard/EditActions.jsx on lines 12..14
front/src/routes/dashboard/edit-dashboard/EditActions.jsx on lines 15..17
front/src/routes/dashboard/edit-dashboard/EditActions.jsx on lines 24..26
front/src/routes/dashboard/edit-dashboard/EditActions.jsx on lines 27..29
front/src/routes/settings/settings-house/HousePage.jsx on lines 23..25

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

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

  async componentWillMount() {
    this.getDiscoveredDevices();
    this.props.session.dispatcher.addListener(
      WEBSOCKET_MESSAGE_TYPES.ZWAVEJS_UI.SCAN_COMPLETED,
      this.getDiscoveredDevices
front/src/components/boxs/chart/Chart.jsx on lines 241..247
front/src/components/boxs/music/MusicBox.jsx on lines 89..95
front/src/components/boxs/room-humidity/RoomHumidity.jsx on lines 63..66
front/src/components/boxs/room-temperature/RoomTemperature.jsx on lines 70..73
front/src/routes/locked/index.js on lines 146..149

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

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