GladysProject/Gladys

View on GitHub
front/src/routes/scene/edit-scene/actions/DelayActionParams.jsx

Summary

Maintainability
D
1 day
Test Coverage

Function render has 36 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  render(props, {}) {
    return (
      <div>
        <p>
          <Text id="editScene.actionsCard.delay.label" />
Severity: Minor
Found in front/src/routes/scene/edit-scene/actions/DelayActionParams.jsx - About 1 hr to fix

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

                <select class="custom-select" value={props.action.unit} onChange={this.handleChangeUnit}>
                  <option value="milliseconds">
                    <Text id="editScene.actionsCard.delay.milliseconds" />
                  </option>
                  <option value="seconds">
    front/src/components/boxs/camera/EditCamera.jsx on lines 42..55
    front/src/routes/scene/edit-scene/actions/EdfTempoCondition.jsx on lines 94..111

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

    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

              <div class="col-md-6">
                <Localizer>
                  <input
                    type="text"
                    class="form-control"
    front/src/routes/scene/edit-scene/actions/HttpRequest.jsx on lines 61..71
    front/src/routes/scene/edit-scene/actions/HttpRequest.jsx on lines 72..82

    Duplicated Code

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

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

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

    Tuning

    This issue has a mass of 92.

    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

      handleChangeDuration = e => {
        let newValue = Number.isInteger(parseInt(e.target.value, 10)) ? parseInt(e.target.value, 10) : 0;
        this.props.updateActionProperty(this.props.columnIndex, this.props.index, 'value', newValue);
      };
    front/src/routes/scene/edit-scene/actions/BlinkLightParams.jsx on lines 38..41
    front/src/routes/scene/edit-scene/actions/CheckUserPresence.jsx on lines 64..67

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

    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

        if (!this.props.action.unit) {
          this.props.updateActionProperty(this.props.columnIndex, this.props.index, 'unit', 'seconds');
        }
    front/src/routes/scene/edit-scene/actions/BlinkLightParams.jsx on lines 67..69
    front/src/routes/scene/edit-scene/actions/HttpRequest.jsx on lines 188..190

    Duplicated Code

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

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

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

    Tuning

    This issue has a mass of 55.

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

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

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

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

    Refactorings

    Further Reading

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

      handleChangeUnit = e => {
        this.props.updateActionProperty(this.props.columnIndex, this.props.index, 'unit', e.target.value);
      };
    front/src/routes/integration/all/ewelink/EweLinkDeviceBox.jsx on lines 11..13
    front/src/routes/integration/all/ewelink/EweLinkDeviceBox.jsx on lines 15..17
    front/src/routes/scene/edit-scene/actions/BlinkLightParams.jsx on lines 42..44
    front/src/routes/scene/edit-scene/actions/CalendarIsEventRunning.jsx on lines 56..58
    front/src/routes/scene/edit-scene/actions/EcowattCondition.jsx on lines 9..11
    front/src/routes/scene/edit-scene/actions/EdfTempoCondition.jsx on lines 9..11
    front/src/routes/scene/edit-scene/actions/EdfTempoCondition.jsx on lines 13..20
    front/src/routes/scene/edit-scene/actions/EdfTempoCondition.jsx on lines 22..29
    front/src/routes/scene/edit-scene/actions/HttpRequest.jsx on lines 100..102
    front/src/routes/scene/edit-scene/actions/SendMqttMessage.jsx on lines 13..15

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

    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

    There are no issues that match your filters.

    Category
    Status