GladysProject/Gladys

View on GitHub

Showing 1,949 of 2,708 total issues

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

      device_feature_id: {
        allowNull: false,
        type: Sequelize.UUID,
        references: {
          model: 't_device_feature',
server/migrations/20190206102938-create-location.js on lines 9..18
server/migrations/20190211033038-create-life-event.js on lines 9..18
server/migrations/20190211034727-create-room.js on lines 9..18
server/migrations/20190211035101-create-device.js on lines 9..18
server/migrations/20190211035238-create-device-feature.js on lines 9..18
server/migrations/20190211041243-create-device-feature-state.js on lines 9..18
server/migrations/20190211042223-create-calendar.js on lines 9..18
server/migrations/20190211042223-create-calendar.js on lines 19..28
server/migrations/20190211042644-create-calendar-event.js on lines 9..18
server/migrations/20190211043231-create-pod.js on lines 9..18
server/migrations/20190211043515-create-service.js on lines 9..18
server/migrations/20190211043957-create-variable.js on lines 9..18
server/migrations/20190211043957-create-variable.js on lines 19..28
server/migrations/20190211050844-trigger_scene.js on lines 9..18
server/migrations/20190211050844-trigger_scene.js on lines 19..28
server/migrations/20190211051215-create-message.js on lines 9..18
server/migrations/20190211051215-create-message.js on lines 19..28
server/migrations/20190212043623-create-session.js on lines 9..18
server/migrations/20190318084429-create-device-param.js on lines 9..18
server/models/device_param.js on lines 10..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 46.

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

      house_id: {
        allowNull: false,
        type: Sequelize.UUID,
        references: {
          model: 't_house',
Severity: Major
Found in server/migrations/20190211034727-create-room.js and 20 other locations - About 35 mins to fix
server/migrations/20190206102938-create-location.js on lines 9..18
server/migrations/20190211033038-create-life-event.js on lines 9..18
server/migrations/20190211035101-create-device.js on lines 9..18
server/migrations/20190211035238-create-device-feature.js on lines 9..18
server/migrations/20190211041243-create-device-feature-state.js on lines 9..18
server/migrations/20190211042223-create-calendar.js on lines 9..18
server/migrations/20190211042223-create-calendar.js on lines 19..28
server/migrations/20190211042644-create-calendar-event.js on lines 9..18
server/migrations/20190211043231-create-pod.js on lines 9..18
server/migrations/20190211043515-create-service.js on lines 9..18
server/migrations/20190211043957-create-variable.js on lines 9..18
server/migrations/20190211043957-create-variable.js on lines 19..28
server/migrations/20190211050844-trigger_scene.js on lines 9..18
server/migrations/20190211050844-trigger_scene.js on lines 19..28
server/migrations/20190211051215-create-message.js on lines 9..18
server/migrations/20190211051215-create-message.js on lines 19..28
server/migrations/20190212043623-create-session.js on lines 9..18
server/migrations/20190318084429-create-device-param.js on lines 9..18
server/migrations/20210723014058-add-device-feature-state-aggregate.js on lines 13..22
server/models/device_param.js on lines 10..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 46.

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

      room_id: {
        allowNull: true,
        type: Sequelize.UUID,
        references: {
          model: 't_room',
Severity: Major
Found in server/migrations/20190211043231-create-pod.js and 20 other locations - About 35 mins to fix
server/migrations/20190206102938-create-location.js on lines 9..18
server/migrations/20190211033038-create-life-event.js on lines 9..18
server/migrations/20190211034727-create-room.js on lines 9..18
server/migrations/20190211035101-create-device.js on lines 9..18
server/migrations/20190211035238-create-device-feature.js on lines 9..18
server/migrations/20190211041243-create-device-feature-state.js on lines 9..18
server/migrations/20190211042223-create-calendar.js on lines 9..18
server/migrations/20190211042223-create-calendar.js on lines 19..28
server/migrations/20190211042644-create-calendar-event.js on lines 9..18
server/migrations/20190211043515-create-service.js on lines 9..18
server/migrations/20190211043957-create-variable.js on lines 9..18
server/migrations/20190211043957-create-variable.js on lines 19..28
server/migrations/20190211050844-trigger_scene.js on lines 9..18
server/migrations/20190211050844-trigger_scene.js on lines 19..28
server/migrations/20190211051215-create-message.js on lines 9..18
server/migrations/20190211051215-create-message.js on lines 19..28
server/migrations/20190212043623-create-session.js on lines 9..18
server/migrations/20190318084429-create-device-param.js on lines 9..18
server/migrations/20210723014058-add-device-feature-state-aggregate.js on lines 13..22
server/models/device_param.js on lines 10..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 46.

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

      service_id: {
        allowNull: true,
        type: Sequelize.UUID,
        references: {
          model: 't_service',
Severity: Major
Found in server/migrations/20190211042223-create-calendar.js and 20 other locations - About 35 mins to fix
server/migrations/20190206102938-create-location.js on lines 9..18
server/migrations/20190211033038-create-life-event.js on lines 9..18
server/migrations/20190211034727-create-room.js on lines 9..18
server/migrations/20190211035101-create-device.js on lines 9..18
server/migrations/20190211035238-create-device-feature.js on lines 9..18
server/migrations/20190211041243-create-device-feature-state.js on lines 9..18
server/migrations/20190211042223-create-calendar.js on lines 9..18
server/migrations/20190211042644-create-calendar-event.js on lines 9..18
server/migrations/20190211043231-create-pod.js on lines 9..18
server/migrations/20190211043515-create-service.js on lines 9..18
server/migrations/20190211043957-create-variable.js on lines 9..18
server/migrations/20190211043957-create-variable.js on lines 19..28
server/migrations/20190211050844-trigger_scene.js on lines 9..18
server/migrations/20190211050844-trigger_scene.js on lines 19..28
server/migrations/20190211051215-create-message.js on lines 9..18
server/migrations/20190211051215-create-message.js on lines 19..28
server/migrations/20190212043623-create-session.js on lines 9..18
server/migrations/20190318084429-create-device-param.js on lines 9..18
server/migrations/20210723014058-add-device-feature-state-aggregate.js on lines 13..22
server/models/device_param.js on lines 10..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 46.

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

      trigger_id: {
        allowNull: true,
        type: Sequelize.UUID,
        references: {
          model: 't_trigger',
Severity: Major
Found in server/migrations/20190211050844-trigger_scene.js and 20 other locations - About 35 mins to fix
server/migrations/20190206102938-create-location.js on lines 9..18
server/migrations/20190211033038-create-life-event.js on lines 9..18
server/migrations/20190211034727-create-room.js on lines 9..18
server/migrations/20190211035101-create-device.js on lines 9..18
server/migrations/20190211035238-create-device-feature.js on lines 9..18
server/migrations/20190211041243-create-device-feature-state.js on lines 9..18
server/migrations/20190211042223-create-calendar.js on lines 9..18
server/migrations/20190211042223-create-calendar.js on lines 19..28
server/migrations/20190211042644-create-calendar-event.js on lines 9..18
server/migrations/20190211043231-create-pod.js on lines 9..18
server/migrations/20190211043515-create-service.js on lines 9..18
server/migrations/20190211043957-create-variable.js on lines 9..18
server/migrations/20190211043957-create-variable.js on lines 19..28
server/migrations/20190211050844-trigger_scene.js on lines 19..28
server/migrations/20190211051215-create-message.js on lines 9..18
server/migrations/20190211051215-create-message.js on lines 19..28
server/migrations/20190212043623-create-session.js on lines 9..18
server/migrations/20190318084429-create-device-param.js on lines 9..18
server/migrations/20210723014058-add-device-feature-state-aggregate.js on lines 13..22
server/models/device_param.js on lines 10..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 46.

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

        if (state.cropper) {
          const profilePicture = await getCropperBase64Image(state.cropper);
          if (profilePicture) {
            data.picture = profilePicture;
          }
Severity: Minor
Found in front/src/actions/profile.js and 2 other locations - About 35 mins to fix
front/src/actions/profile.js on lines 166..171
front/src/actions/profile.js on lines 207..212

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

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

        if (state.cropper) {
          const profilePicture = await getCropperBase64Image(state.cropper);
          if (profilePicture) {
            data.picture = profilePicture;
          }
Severity: Minor
Found in front/src/actions/profile.js and 2 other locations - About 35 mins to fix
front/src/actions/profile.js on lines 207..212
front/src/actions/profile.js on lines 249..254

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

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

        if (state.cropper) {
          const profilePicture = await getCropperBase64Image(state.cropper);
          if (profilePicture) {
            data.picture = profilePicture;
          }
Severity: Minor
Found in front/src/actions/profile.js and 2 other locations - About 35 mins to fix
front/src/actions/profile.js on lines 166..171
front/src/actions/profile.js on lines 249..254

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

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

  updateLastAddress = e => {
    e.preventDefault();
    this.setState({ lastAddress: e.target.value });
  };
front/src/routes/integration/all/tasmota/TasmotaDeviceBox.jsx on lines 73..77
front/src/routes/integration/all/tasmota/TasmotaDeviceBox.jsx on lines 79..83
front/src/routes/integration/all/tasmota/discover-http/SearchForm.jsx on lines 35..38
front/src/routes/integration/all/tasmota/discover-http/SearchForm.jsx on lines 40..43

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

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

  updateUsername = e => {
    e.preventDefault();

    this.setState({ username: e.target.value });
  };
Severity: Major
Found in front/src/routes/integration/all/tasmota/TasmotaDeviceBox.jsx and 4 other locations - About 35 mins to fix
front/src/routes/integration/all/tasmota/TasmotaDeviceBox.jsx on lines 79..83
front/src/routes/integration/all/tasmota/discover-http/SearchForm.jsx on lines 35..38
front/src/routes/integration/all/tasmota/discover-http/SearchForm.jsx on lines 40..43
front/src/routes/integration/all/tasmota/discover-http/SearchForm.jsx on lines 45..48

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

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

  [EVENTS.USER_PRESENCE.BACK_HOME]: (event, trigger) => event.house === trigger.house && event.user === trigger.user,
Severity: Major
Found in server/lib/scene/scene.triggers.js and 3 other locations - About 35 mins to fix
server/lib/scene/scene.triggers.js on lines 23..23
server/lib/scene/scene.triggers.js on lines 26..26
server/lib/scene/scene.triggers.js on lines 27..27

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

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

      case STATUS.PROCESSING_TOKEN:
        this.configured = true;
        this.status = STATUS.PROCESSING_TOKEN;
        this.connected = false;
        break;
Severity: Major
Found in server/services/netatmo/lib/netatmo.saveStatus.js and 4 other locations - About 35 mins to fix
server/services/netatmo/lib/netatmo.saveStatus.js on lines 61..65
server/services/netatmo/lib/netatmo.saveStatus.js on lines 71..75
server/services/netatmo/lib/netatmo.saveStatus.js on lines 87..91
server/services/netatmo/lib/netatmo.saveStatus.js on lines 92..96

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

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

    cy.intercept(
      {
        method: 'POST',
        url: `${serverUrl}/api/v1/service/zigbee2mqtt/setup`
      },
front/cypress/e2e/routes/integration/zigbee2mqtt/setup/Zigbee2MqttSetupRemoteGladys.cy.js on lines 56..64

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

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

        {!isNotNullOrUndefined(props.humidity) && (
          <p class="m-0">
            <Text id="dashboard.boxes.humidityInRoom.noHumidityRecorded" />
          </p>
        )}
Severity: Major
Found in front/src/components/boxs/room-humidity/RoomHumidity.jsx and 3 other locations - About 35 mins to fix
front/src/components/boxs/room-humidity/RoomHumidity.jsx on lines 32..36
front/src/components/boxs/room-temperature/RoomTemperature.jsx on lines 37..41
front/src/components/boxs/room-temperature/RoomTemperature.jsx on lines 50..54

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

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

      case STATUS.CONNECTED:
        this.configured = true;
        this.status = STATUS.CONNECTED;
        this.connected = true;
        break;
Severity: Major
Found in server/services/netatmo/lib/netatmo.saveStatus.js and 4 other locations - About 35 mins to fix
server/services/netatmo/lib/netatmo.saveStatus.js on lines 61..65
server/services/netatmo/lib/netatmo.saveStatus.js on lines 66..70
server/services/netatmo/lib/netatmo.saveStatus.js on lines 87..91
server/services/netatmo/lib/netatmo.saveStatus.js on lines 92..96

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

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

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

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

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

Refactorings

Further Reading

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

      const house = await this.props.httpClient.get(`/api/v1/house/${this.props.box.house}`);
Severity: Minor
Found in front/src/components/boxs/alarm/Alarm.jsx and 2 other locations - About 35 mins to fix
front/src/components/boxs/camera/Camera.jsx on lines 27..27
front/src/components/boxs/device-in-room/DevicesInRoomsBox.jsx on lines 9..9

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

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

  updateFirstAddress = e => {
    e.preventDefault();
    this.setState({ firstAddress: e.target.value });
  };
front/src/routes/integration/all/tasmota/TasmotaDeviceBox.jsx on lines 73..77
front/src/routes/integration/all/tasmota/TasmotaDeviceBox.jsx on lines 79..83
front/src/routes/integration/all/tasmota/discover-http/SearchForm.jsx on lines 35..38
front/src/routes/integration/all/tasmota/discover-http/SearchForm.jsx on lines 45..48

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

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

  updatePassword = e => {
    e.preventDefault();

    this.setState({ password: e.target.value });
  };
Severity: Major
Found in front/src/routes/integration/all/tasmota/TasmotaDeviceBox.jsx and 4 other locations - About 35 mins to fix
front/src/routes/integration/all/tasmota/TasmotaDeviceBox.jsx on lines 73..77
front/src/routes/integration/all/tasmota/discover-http/SearchForm.jsx on lines 35..38
front/src/routes/integration/all/tasmota/discover-http/SearchForm.jsx on lines 40..43
front/src/routes/integration/all/tasmota/discover-http/SearchForm.jsx on lines 45..48

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

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

      case STATUS.CONNECTING:
        this.configured = true;
        this.status = STATUS.CONNECTING;
        this.connected = false;
        break;
Severity: Major
Found in server/services/netatmo/lib/netatmo.saveStatus.js and 4 other locations - About 35 mins to fix
server/services/netatmo/lib/netatmo.saveStatus.js on lines 66..70
server/services/netatmo/lib/netatmo.saveStatus.js on lines 71..75
server/services/netatmo/lib/netatmo.saveStatus.js on lines 87..91
server/services/netatmo/lib/netatmo.saveStatus.js on lines 92..96

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

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

      case STATUS.DISCOVERING_DEVICES:
        this.configured = true;
        this.status = STATUS.DISCOVERING_DEVICES;
        this.connected = true;
        break;
Severity: Major
Found in server/services/netatmo/lib/netatmo.saveStatus.js and 4 other locations - About 35 mins to fix
server/services/netatmo/lib/netatmo.saveStatus.js on lines 61..65
server/services/netatmo/lib/netatmo.saveStatus.js on lines 66..70
server/services/netatmo/lib/netatmo.saveStatus.js on lines 71..75
server/services/netatmo/lib/netatmo.saveStatus.js on lines 92..96

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

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