FarmBot/Farmbot-Web-App

View on GitHub
frontend/sequences/locals_list/variable_form.tsx

Summary

Maintainability
F
6 days
Test Coverage

Function VariableForm has 141 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  (props: VariableFormProps) => {
    const { sequenceUuid, resources, bodyVariables, variable, variableType,
      allowedVariableNodes, hideGroups, removeVariable, onChange } = props;
    const { celeryNode, dropdown, vector, isDefault } = maybeUseStepData({
      resources, bodyVariables, variable, uuid: sequenceUuid
Severity: Major
Found in frontend/sequences/locals_list/variable_form.tsx - About 5 hrs to fix

    File variable_form.tsx has 389 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    import React from "react";
    import { Row, FBSelect, Color, BlurableInput, Help } from "../../ui";
    import {
      variableFormList, NO_VALUE_SELECTED_DDI, sortVariables, heading, sequences2Ddi,
      LOCATION_PLACEHOLDER_DDI,
    Severity: Minor
    Found in frontend/sequences/locals_list/variable_form.tsx - About 5 hrs to fix

      Function VariableForm has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
      Open

        (props: VariableFormProps) => {
          const { sequenceUuid, resources, bodyVariables, variable, variableType,
            allowedVariableNodes, hideGroups, removeVariable, onChange } = props;
          const { celeryNode, dropdown, vector, isDefault } = maybeUseStepData({
            resources, bodyVariables, variable, uuid: sequenceUuid
      Severity: Minor
      Found in frontend/sequences/locals_list/variable_form.tsx - About 2 hrs to fix

      Cognitive Complexity

      Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

      A method's cognitive complexity is based on a few simple rules:

      • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
      • Code is considered more complex for each "break in the linear flow of the code"
      • Code is considered more complex when "flow breaking structures are nested"

      Further reading

      Function NumericInput has 46 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      export const NumericInput = (props: NumericInputProps) => {
        const { variableNode } = props;
        const isPlaceholder = variableNode.kind == "parameter_application"
          && variableNode.args.data_value.kind == "number_placeholder";
        const argsValue = variableNode.kind == "parameter_declaration"
      Severity: Minor
      Found in frontend/sequences/locals_list/variable_form.tsx - About 1 hr to fix

        Function TextInput has 46 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        export const TextInput = (props: TextInputProps) => {
          const { variableNode } = props;
          const isPlaceholder = variableNode.kind == "parameter_application"
            && variableNode.args.data_value.kind == "text_placeholder";
          const argsValue = variableNode.kind == "parameter_declaration"
        Severity: Minor
        Found in frontend/sequences/locals_list/variable_form.tsx - About 1 hr to fix

          Function generateVariableListItems has 31 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          export const generateVariableListItems = (props: GenerateVariableListProps) => {
            const { allowedVariableNodes, resources, sequenceUuid } = props;
            const headingId = props.headingId || "Variable";
            const variables = sortVariables(Object.values(
              resources.sequenceMetas[sequenceUuid] || [])).map(v => v.celeryNode);
          Severity: Minor
          Found in frontend/sequences/locals_list/variable_form.tsx - About 1 hr to fix

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

                    {!isDefaultValueForm && variableType == VariableType.Number &&
                      celeryNode.kind != "parameter_declaration" &&
                      !usingDefaultValue && celeryNode.args.data_value.kind != "identifier" &&
                      <Row className="grid-2-col">
                        <div></div>
            Severity: Major
            Found in frontend/sequences/locals_list/variable_form.tsx and 1 other location - About 4 hrs to fix
            frontend/sequences/locals_list/variable_form.tsx on lines 186..193

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

            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

                    {!isDefaultValueForm && variableType == VariableType.Text &&
                      celeryNode.kind != "parameter_declaration" &&
                      !usingDefaultValue && celeryNode.args.data_value.kind != "identifier" &&
                      <Row className="grid-2-col">
                        <div></div>
            Severity: Major
            Found in frontend/sequences/locals_list/variable_form.tsx and 1 other location - About 4 hrs to fix
            frontend/sequences/locals_list/variable_form.tsx on lines 178..185

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

            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

                    } else {
                      if (editableVariable.args.data_value.kind == "text") {
                        editableVariable.args.data_value =
                          { kind: "text_placeholder", args: {} };
                      } else {
            Severity: Major
            Found in frontend/sequences/locals_list/variable_form.tsx and 1 other location - About 2 hrs to fix
            frontend/sequences/locals_list/variable_form.tsx on lines 290..298

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

            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

                    if (editableVariable.kind == "parameter_declaration") {
                      if (editableVariable.args.default_value.kind == "numeric") {
                        editableVariable.args.default_value =
                          { kind: "number_placeholder", args: {} };
                      } else {
            Severity: Major
            Found in frontend/sequences/locals_list/variable_form.tsx and 1 other location - About 2 hrs to fix
            frontend/sequences/locals_list/variable_form.tsx on lines 242..250

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

            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

                    } else {
                      if (editableVariable.args.data_value.kind == "numeric") {
                        editableVariable.args.data_value =
                          { kind: "number_placeholder", args: {} };
                      } else {
            Severity: Major
            Found in frontend/sequences/locals_list/variable_form.tsx and 1 other location - About 2 hrs to fix
            frontend/sequences/locals_list/variable_form.tsx on lines 234..242

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

            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

                    if (editableVariable.kind == "parameter_declaration") {
                      if (editableVariable.args.default_value.kind == "text") {
                        editableVariable.args.default_value =
                          { kind: "text_placeholder", args: {} };
                      } else {
            Severity: Major
            Found in frontend/sequences/locals_list/variable_form.tsx and 1 other location - About 2 hrs to fix
            frontend/sequences/locals_list/variable_form.tsx on lines 298..306

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

            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

                    if (editableVariable.kind == "parameter_declaration") {
                      (editableVariable.args.default_value as Numeric).args.number = value;
                    } else {
                      (editableVariable.args.data_value as Numeric).args.number = value;
                    }
            Severity: Major
            Found in frontend/sequences/locals_list/variable_form.tsx and 1 other location - About 2 hrs to fix
            frontend/sequences/locals_list/variable_form.tsx on lines 313..317

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

            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

                    if (editableVariable.kind == "parameter_declaration") {
                      (editableVariable.args.default_value as Text).args.string = value;
                    } else {
                      (editableVariable.args.data_value as Text).args.string = value;
                    }
            Severity: Major
            Found in frontend/sequences/locals_list/variable_form.tsx and 1 other location - About 2 hrs to fix
            frontend/sequences/locals_list/variable_form.tsx on lines 257..261

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

            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

              const argsValue = variableNode.kind == "parameter_declaration"
                ? (variableNode.args.default_value as Numeric).args.number
                : (variableNode.args.data_value as Numeric).args.number;
            Severity: Major
            Found in frontend/sequences/locals_list/variable_form.tsx and 1 other location - About 1 hr to fix
            frontend/sequences/locals_list/variable_form.tsx on lines 279..281

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

            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

              const argsValue = variableNode.kind == "parameter_declaration"
                ? (variableNode.args.default_value as Text).args.string
                : (variableNode.args.data_value as Text).args.string;
            Severity: Major
            Found in frontend/sequences/locals_list/variable_form.tsx and 1 other location - About 1 hr to fix
            frontend/sequences/locals_list/variable_form.tsx on lines 223..225

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

            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

                      {variableType == VariableType.Text && isDefaultValueForm &&
                        <TextInput label={label} variableNode={variable.celeryNode}
                          onChange={onChange} isDefaultValueForm={isDefaultValueForm} />}
            Severity: Major
            Found in frontend/sequences/locals_list/variable_form.tsx and 1 other location - About 1 hr to fix
            frontend/sequences/locals_list/variable_form.tsx on lines 165..167

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

            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

                      {variableType == VariableType.Number && isDefaultValueForm &&
                        <NumericInput label={label} variableNode={variable.celeryNode}
                          onChange={onChange} isDefaultValueForm={isDefaultValueForm} />}
            Severity: Major
            Found in frontend/sequences/locals_list/variable_form.tsx and 1 other location - About 1 hr to fix
            frontend/sequences/locals_list/variable_form.tsx on lines 168..170

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

            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 { sequenceUuid, resources, bodyVariables, variable, variableType,
                  allowedVariableNodes, hideGroups, removeVariable, onChange } = props;
            Severity: Major
            Found in frontend/sequences/locals_list/variable_form.tsx and 2 other locations - About 55 mins to fix
            frontend/farm_designer/map/layers/farmbot/farmbot_layer.tsx on lines 7..10
            frontend/sequences/step_tiles/tile_computed_move/input.tsx on lines 6..8

            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

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

                      resourceType == "Sensor" && [SENSOR_HEADING()]
                        .concat(sensors2Ddi(selectAllSensors(resources)))
                        .map(item => list.push(item));
            Severity: Minor
            Found in frontend/sequences/locals_list/variable_form.tsx and 1 other location - About 50 mins to fix
            frontend/sequences/locals_list/variable_form.tsx on lines 116..118

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

            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

                      resourceType == "Peripheral" && [PERIPHERAL_HEADING()]
                        .concat(peripherals2Ddi(selectAllPeripherals(resources)))
                        .map(item => list.push(item));
            Severity: Minor
            Found in frontend/sequences/locals_list/variable_form.tsx and 1 other location - About 50 mins to fix
            frontend/sequences/locals_list/variable_form.tsx on lines 119..121

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

            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

              setLabelValue = (e: React.FormEvent<HTMLInputElement>) =>
                this.setState({ labelValue: e.currentTarget.value });
            Severity: Minor
            Found in frontend/sequences/locals_list/variable_form.tsx and 1 other location - About 35 mins to fix
            frontend/point_groups/criteria/add.tsx on lines 65..66

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

            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