GladysProject/Gladys

View on GitHub

Showing 1,918 of 2,655 total issues

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

  async function destroyEvent(req, res) {
    await gladys.calendar.destroyEvent(req.params.calendar_event_selector);
    res.json({
      success: true,
    });
Severity: Major
Found in server/api/controllers/calendar.controller.js and 7 other locations - About 1 hr to fix
server/api/controllers/area.controller.js on lines 65..70
server/api/controllers/calendar.controller.js on lines 78..83
server/api/controllers/device.controller.js on lines 54..59
server/api/controllers/house.controller.js on lines 92..97
server/api/controllers/house.controller.js on lines 135..138
server/api/controllers/room.controller.js on lines 55..60
server/api/controllers/scene.controller.js on lines 64..69

Duplicated Code

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

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

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

Tuning

This issue has a mass of 56.

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

class Error422 extends HttpError {
  constructor(properties) {
    super();
    this.status = 422;
    this.code = 'UNPROCESSABLE_ENTITY';
Severity: Major
Found in server/utils/httpErrors.js and 7 other locations - About 1 hr to fix
server/utils/httpErrors.js on lines 9..16
server/utils/httpErrors.js on lines 18..25
server/utils/httpErrors.js on lines 27..34
server/utils/httpErrors.js on lines 36..43
server/utils/httpErrors.js on lines 45..52
server/utils/httpErrors.js on lines 63..70
server/utils/httpErrors.js on lines 72..79

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

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

            {props.users && props.users.length === 0 && (
              <div class="alert alert-secondary">
                <Text id="usersSettings.noUsersFound" />
              </div>
            )}
Severity: Major
Found in front/src/routes/settings/settings-users/UserPage.jsx and 5 other locations - About 1 hr to fix
front/src/routes/integration/all/xiaomi/DevicePanel.jsx on lines 48..52
front/src/routes/integration/all/zwave/node-page/NodeTab.jsx on lines 38..42
front/src/routes/scene/edit-scene/ActionGroup.jsx on lines 80..84
front/src/routes/scene/edit-scene/TriggerGroup.jsx on lines 31..35
front/src/routes/scene/edit-scene/TriggerGroup.jsx on lines 36..40

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

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

class Error401 extends HttpError {
  constructor(message) {
    super();
    this.status = 401;
    this.code = 'UNAUTHORIZED';
Severity: Major
Found in server/utils/httpErrors.js and 7 other locations - About 1 hr to fix
server/utils/httpErrors.js on lines 9..16
server/utils/httpErrors.js on lines 27..34
server/utils/httpErrors.js on lines 36..43
server/utils/httpErrors.js on lines 45..52
server/utils/httpErrors.js on lines 54..61
server/utils/httpErrors.js on lines 63..70
server/utils/httpErrors.js on lines 72..79

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

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

class Error403 extends HttpError {
  constructor(message) {
    super();
    this.status = 403;
    this.code = 'FORBIDDEN';
Severity: Major
Found in server/utils/httpErrors.js and 7 other locations - About 1 hr to fix
server/utils/httpErrors.js on lines 9..16
server/utils/httpErrors.js on lines 18..25
server/utils/httpErrors.js on lines 36..43
server/utils/httpErrors.js on lines 45..52
server/utils/httpErrors.js on lines 54..61
server/utils/httpErrors.js on lines 63..70
server/utils/httpErrors.js on lines 72..79

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

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

  async function destroy(req, res) {
    await gladys.scene.destroy(req.params.scene_selector);
    res.json({
      success: true,
    });
Severity: Major
Found in server/api/controllers/scene.controller.js and 7 other locations - About 1 hr to fix
server/api/controllers/area.controller.js on lines 65..70
server/api/controllers/calendar.controller.js on lines 78..83
server/api/controllers/calendar.controller.js on lines 136..141
server/api/controllers/device.controller.js on lines 54..59
server/api/controllers/house.controller.js on lines 92..97
server/api/controllers/house.controller.js on lines 135..138
server/api/controllers/room.controller.js on lines 55..60

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

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

class Error429 extends HttpError {
  constructor(properties) {
    super();
    this.status = 429;
    this.code = 'TOO_MANY_REQUESTS';
Severity: Major
Found in server/utils/httpErrors.js and 7 other locations - About 1 hr to fix
server/utils/httpErrors.js on lines 9..16
server/utils/httpErrors.js on lines 18..25
server/utils/httpErrors.js on lines 27..34
server/utils/httpErrors.js on lines 36..43
server/utils/httpErrors.js on lines 45..52
server/utils/httpErrors.js on lines 54..61
server/utils/httpErrors.js on lines 72..79

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

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

class Error400 extends HttpError {
  constructor(message) {
    super();
    this.status = 400;
    this.code = 'BAD_REQUEST';
Severity: Major
Found in server/utils/httpErrors.js and 7 other locations - About 1 hr to fix
server/utils/httpErrors.js on lines 18..25
server/utils/httpErrors.js on lines 27..34
server/utils/httpErrors.js on lines 36..43
server/utils/httpErrors.js on lines 45..52
server/utils/httpErrors.js on lines 54..61
server/utils/httpErrors.js on lines 63..70
server/utils/httpErrors.js on lines 72..79

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

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

  async function destroy(req, res) {
    await gladys.room.destroy(req.params.room_selector);
    res.json({
      success: true,
    });
Severity: Major
Found in server/api/controllers/room.controller.js and 7 other locations - About 1 hr to fix
server/api/controllers/area.controller.js on lines 65..70
server/api/controllers/calendar.controller.js on lines 78..83
server/api/controllers/calendar.controller.js on lines 136..141
server/api/controllers/device.controller.js on lines 54..59
server/api/controllers/house.controller.js on lines 92..97
server/api/controllers/house.controller.js on lines 135..138
server/api/controllers/scene.controller.js on lines 64..69

Duplicated Code

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

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

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

Tuning

This issue has a mass of 56.

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

  async function destroy(req, res) {
    await gladys.house.destroy(req.params.house_selector);
    res.json({
      success: true,
    });
Severity: Major
Found in server/api/controllers/house.controller.js and 7 other locations - About 1 hr to fix
server/api/controllers/area.controller.js on lines 65..70
server/api/controllers/calendar.controller.js on lines 78..83
server/api/controllers/calendar.controller.js on lines 136..141
server/api/controllers/device.controller.js on lines 54..59
server/api/controllers/house.controller.js on lines 135..138
server/api/controllers/room.controller.js on lines 55..60
server/api/controllers/scene.controller.js on lines 64..69

Duplicated Code

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

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

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

Tuning

This issue has a mass of 56.

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

            {props.xiaomiDevices && props.xiaomiDevices.length === 0 && (
              <p class="text-center">
                <Text id="integration.xiaomi.device.noDevices" />
              </p>
            )}
Severity: Major
Found in front/src/routes/integration/all/xiaomi/DevicePanel.jsx and 5 other locations - About 1 hr to fix
front/src/routes/integration/all/zwave/node-page/NodeTab.jsx on lines 38..42
front/src/routes/scene/edit-scene/ActionGroup.jsx on lines 80..84
front/src/routes/scene/edit-scene/TriggerGroup.jsx on lines 31..35
front/src/routes/scene/edit-scene/TriggerGroup.jsx on lines 36..40
front/src/routes/settings/settings-users/UserPage.jsx on lines 32..36

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

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

class Error500 extends HttpError {
  constructor(error) {
    super();
    this.status = 500;
    this.code = 'SERVER_ERROR';
Severity: Major
Found in server/utils/httpErrors.js and 7 other locations - About 1 hr to fix
server/utils/httpErrors.js on lines 9..16
server/utils/httpErrors.js on lines 18..25
server/utils/httpErrors.js on lines 27..34
server/utils/httpErrors.js on lines 36..43
server/utils/httpErrors.js on lines 45..52
server/utils/httpErrors.js on lines 54..61
server/utils/httpErrors.js on lines 63..70

Duplicated Code

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

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

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

Tuning

This issue has a mass of 56.

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

          {props.zwaveDevices && props.zwaveDevices.length === 0 && (
            <div class="alert alert-info">
              <Text id="integration.zwave.device.noDevices" />
            </div>
          )}
front/src/routes/integration/all/xiaomi/DevicePanel.jsx on lines 48..52
front/src/routes/scene/edit-scene/ActionGroup.jsx on lines 80..84
front/src/routes/scene/edit-scene/TriggerGroup.jsx on lines 31..35
front/src/routes/scene/edit-scene/TriggerGroup.jsx on lines 36..40
front/src/routes/settings/settings-users/UserPage.jsx on lines 32..36

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

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

            {props.triggers && props.triggers.length > 0 && (
              <div class="alert alert-info">
                <Text id="editScene.triggersDescription" />
              </div>
            )}
Severity: Major
Found in front/src/routes/scene/edit-scene/TriggerGroup.jsx and 5 other locations - About 1 hr to fix
front/src/routes/integration/all/xiaomi/DevicePanel.jsx on lines 48..52
front/src/routes/integration/all/zwave/node-page/NodeTab.jsx on lines 38..42
front/src/routes/scene/edit-scene/ActionGroup.jsx on lines 80..84
front/src/routes/scene/edit-scene/TriggerGroup.jsx on lines 36..40
front/src/routes/settings/settings-users/UserPage.jsx on lines 32..36

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

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

              {props.actions && props.actions.length > 0 && (
                <div class="alert alert-info">
                  <Text id="editScene.actionsDescription" />
                </div>
              )}
Severity: Major
Found in front/src/routes/scene/edit-scene/ActionGroup.jsx and 5 other locations - About 1 hr to fix
front/src/routes/integration/all/xiaomi/DevicePanel.jsx on lines 48..52
front/src/routes/integration/all/zwave/node-page/NodeTab.jsx on lines 38..42
front/src/routes/scene/edit-scene/TriggerGroup.jsx on lines 31..35
front/src/routes/scene/edit-scene/TriggerGroup.jsx on lines 36..40
front/src/routes/settings/settings-users/UserPage.jsx on lines 32..36

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

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

    {
      id: '99fac564-0844-44f6-866b-2b8dcf0d76eb',
      path: 'https://url-backup',
      size: 1127680,
      created_at: dayjs().subtract(2, 'day'),
Severity: Major
Found in front/src/config/demo.js and 2 other locations - About 1 hr to fix
front/src/config/demo.js on lines 1979..1986
front/src/config/demo.js on lines 1995..2002

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

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

    {
      id: '210460b2-c9a8-4891-9cca-464c3e19bfbb',
      path: 'https://url-backup',
      size: 1013680,
      created_at: dayjs().subtract(3, 'day'),
Severity: Major
Found in front/src/config/demo.js and 2 other locations - About 1 hr to fix
front/src/config/demo.js on lines 1979..1986
front/src/config/demo.js on lines 1987..1994

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

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

    {
      id: '99fac564-0844-44f6-866b-2b8dcf0d76eb',
      path: 'https://url-backup',
      size: 2024000100,
      created_at: dayjs().subtract(1, 'day'),
Severity: Major
Found in front/src/config/demo.js and 2 other locations - About 1 hr to fix
front/src/config/demo.js on lines 1987..1994
front/src/config/demo.js on lines 1995..2002

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

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

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

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

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

Refactorings

Further Reading

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

  scan = async () => {
    try {
      await this.props.httpClient.post('/api/v1/service/zwavejs-ui/discover');
    } catch (e) {
      console.error(e);
front/src/routes/integration/all/bluetooth/settings-page/BluetoothSettingsTab.jsx on lines 44..50

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

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

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

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

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

Refactorings

Further Reading

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

  scanPresence = async () => {
    try {
      await this.props.httpClient.post('/api/v1/service/bluetooth/presence');
    } catch (e) {
      console.error(e);
front/src/routes/integration/all/zwavejs-ui/discover-page/DiscoverTab.jsx on lines 12..18

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

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