ICTU/quality-time

View on GitHub

Showing 683 of 683 total issues

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

it("does not sort when told not to", () => {
    render(
        <SingleChoiceInput
            value="b"
            options={[
Severity: Major
Found in components/frontend/src/fields/SingleChoiceInput.test.js and 1 other location - About 4 hrs to fix
components/frontend/src/fields/SingleChoiceInput.test.js on lines 93..107

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

it("does sort when told to", () => {
    render(
        <SingleChoiceInput
            value="b"
            options={[
Severity: Major
Found in components/frontend/src/fields/SingleChoiceInput.test.js and 1 other location - About 4 hrs to fix
components/frontend/src/fields/SingleChoiceInput.test.js on lines 77..91

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

File utils.js has 349 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import { arrayOf, number, objectOf, oneOf, string } from "prop-types"

import { PERMISSIONS } from "./context/Permissions"
import { defaultDesiredResponseTimes } from "./defaults"
import {
Severity: Minor
Found in components/frontend/src/utils.js - About 4 hrs to fix

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

            {
                menuItem: (
                    <Menu.Item key="debt">
                        <Icon name="money" />
                        <FocusableTab>{"Technical debt"}</FocusableTab>
    Severity: Major
    Found in components/frontend/src/metric/MetricDetails.js and 1 other location - About 4 hrs to fix
    components/frontend/src/subject/SubjectTitle.js on lines 84..101

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

    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

            {
                menuItem: (
                    <Menu.Item key="configuration">
                        <Icon name="settings" />
                        <FocusableTab>{"Configuration"}</FocusableTab>
    Severity: Major
    Found in components/frontend/src/subject/SubjectTitle.js and 1 other location - About 4 hrs to fix
    components/frontend/src/metric/MetricDetails.js on lines 128..140

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

    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

    it("renders the source label and the popup if there is a parse error", async () => {
        renderSourceStatus(metric, { source_uuid: "source_uuid", parse_error: "error" })
        expect(screen.getAllByText(/Source name/).length).toBe(1)
        await userEvent.hover(screen.queryByText(/Source name/))
        await waitFor(() => {
    Severity: Major
    Found in components/frontend/src/measurement/SourceStatus.test.js and 1 other location - About 4 hrs to fix
    components/frontend/src/measurement/SourceStatus.test.js on lines 31..38

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

    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

    it("renders the source label and the popup if there is an connection error", async () => {
        renderSourceStatus(metric, { source_uuid: "source_uuid", connection_error: "error" })
        expect(screen.getAllByText(/Source name/).length).toBe(1)
        await userEvent.hover(screen.queryByText(/Source name/))
        await waitFor(() => {
    Severity: Major
    Found in components/frontend/src/measurement/SourceStatus.test.js and 1 other location - About 4 hrs to fix
    components/frontend/src/measurement/SourceStatus.test.js on lines 40..47

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

    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

    it("does not submit an unchanged value", async () => {
        let setValue = jest.fn()
        render(<IntegerInput value="42" set_value={setValue} />)
        await userEvent.type(screen.getByDisplayValue(/42/), "{Enter}")
        expect(screen.queryAllByDisplayValue(/42/).length).toBe(1)
    Severity: Major
    Found in components/frontend/src/fields/IntegerInput.test.js and 2 other locations - About 4 hrs to fix
    components/frontend/src/fields/IntegerInput.test.js on lines 55..61
    components/frontend/src/fields/IntegerInput.test.js on lines 78..84

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

    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

    it("does not invoke the callback if the value is unchanged", async () => {
        const mockCallback = jest.fn()
        render(<TextInput value="Hello" set_value={mockCallback} />)
        await userEvent.type(screen.getByText(/Hello/), "{Shift>}{Enter}")
        expect(screen.getByText(/Hello/)).not.toBe(null)
    Severity: Major
    Found in components/frontend/src/fields/TextInput.test.js and 3 other locations - About 4 hrs to fix
    components/frontend/src/fields/Input.test.js on lines 44..50
    components/frontend/src/fields/TextInput.test.js on lines 19..25
    components/frontend/src/fields/TextInput.test.js on lines 35..41

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

    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

    it("resets the value on escape", async () => {
        const mockCallback = jest.fn()
        render(<TextInput value="Hello" set_value={mockCallback} />)
        await userEvent.type(screen.getByText(/Hello/), "Revert{Escape}")
        expect(screen.getByText(/Hello/)).not.toBe(null)
    Severity: Major
    Found in components/frontend/src/fields/TextInput.test.js and 3 other locations - About 4 hrs to fix
    components/frontend/src/fields/Input.test.js on lines 44..50
    components/frontend/src/fields/TextInput.test.js on lines 19..25
    components/frontend/src/fields/TextInput.test.js on lines 27..33

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

    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

    it("renders the initial value on escape and does not submit", async () => {
        const mockCallback = jest.fn()
        render(<Input value="Hello" set_value={mockCallback} />)
        await userEvent.type(screen.getByDisplayValue(/Hello/), "Bye{Escape}")
        expect(screen.getByDisplayValue(/Hello/)).not.toBe(null)
    Severity: Major
    Found in components/frontend/src/fields/Input.test.js and 3 other locations - About 4 hrs to fix
    components/frontend/src/fields/TextInput.test.js on lines 19..25
    components/frontend/src/fields/TextInput.test.js on lines 27..33
    components/frontend/src/fields/TextInput.test.js on lines 35..41

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

    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

    it("undoes the change on escape", async () => {
        let setValue = jest.fn()
        render(<IntegerInput value="42" set_value={setValue} />)
        await userEvent.type(screen.getByDisplayValue(/42/), "24{escape}")
        expect(screen.queryAllByDisplayValue(/42/).length).toBe(1)
    Severity: Major
    Found in components/frontend/src/fields/IntegerInput.test.js and 2 other locations - About 4 hrs to fix
    components/frontend/src/fields/IntegerInput.test.js on lines 39..45
    components/frontend/src/fields/IntegerInput.test.js on lines 55..61

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

    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

    it("has a default minimum of zero", async () => {
        let setValue = jest.fn()
        render(<IntegerInput value="-1" set_value={setValue} />)
        await userEvent.type(screen.getByDisplayValue(/-1/), "{Enter}")
        expect(screen.queryAllByDisplayValue(/-1/).length).toBe(1)
    Severity: Major
    Found in components/frontend/src/fields/IntegerInput.test.js and 2 other locations - About 4 hrs to fix
    components/frontend/src/fields/IntegerInput.test.js on lines 39..45
    components/frontend/src/fields/IntegerInput.test.js on lines 78..84

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

    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

    it("does not invoke the callback on enter", async () => {
        const mockCallback = jest.fn()
        render(<TextInput value="Hello" set_value={mockCallback} />)
        await userEvent.type(screen.getByText(/Hello/), "Bye{Enter}")
        expect(screen.getByText(/Bye/)).not.toBe(null)
    Severity: Major
    Found in components/frontend/src/fields/TextInput.test.js and 3 other locations - About 4 hrs to fix
    components/frontend/src/fields/Input.test.js on lines 44..50
    components/frontend/src/fields/TextInput.test.js on lines 27..33
    components/frontend/src/fields/TextInput.test.js on lines 35..41

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

    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

    File SubjectTableRow.js has 341 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    import { array, bool, func, number, object, string } from "prop-types"
    import { useContext } from "react"
    
    import { DarkMode } from "../context/DarkMode"
    import { DataModel } from "../context/DataModel"
    Severity: Minor
    Found in components/frontend/src/subject/SubjectTableRow.js - About 4 hrs to fix

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

      it("hides the tag cards", async () => {
          history.push("?hidden_cards=tags")
          renderDashboard({ reportToRender: report })
          expect(screen.getAllByText(/Subject title/).length).toBe(1)
          expect(screen.queryAllByText(/tag/).length).toBe(0)
      Severity: Major
      Found in components/frontend/src/report/ReportDashboard.test.js and 1 other location - About 4 hrs to fix
      components/frontend/src/report/ReportDashboard.test.js on lines 86..92

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

      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

      it("hides the subject cards", async () => {
          history.push("?hidden_cards=subjects")
          renderDashboard({ reportToRender: report })
          expect(screen.queryAllByText(/Subject title/).length).toBe(0)
          expect(screen.getAllByText(/tag/).length).toBe(1)
      Severity: Major
      Found in components/frontend/src/report/ReportDashboard.test.js and 1 other location - About 4 hrs to fix
      components/frontend/src/report/ReportDashboard.test.js on lines 94..100

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

      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

      File Button.test.js has 339 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      import { act, fireEvent, render, screen, waitFor } from "@testing-library/react"
      import userEvent from "@testing-library/user-event"
      
      import {
          AddButton,
      Severity: Minor
      Found in components/frontend/src/widgets/Button.test.js - About 4 hrs to fix

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

        it("displays the sprint in the label if configured, but without sprint end date", async () => {
            history.push("?show_issue_sprint=true")
            const { queryByText } = renderIssueStatus({ sprint: true, sprintEndDate: null })
            expect(queryByText(/Sprint 42/)).not.toBe(null)
            expect(queryByText(/active/)).not.toBe(null)
        Severity: Major
        Found in components/frontend/src/issue/IssueStatus.test.js and 1 other location - About 4 hrs to fix
        components/frontend/src/issue/IssueStatus.test.js on lines 202..208

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

        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

        it("renders the target", () => {
            render(
                <DataModel.Provider value={{ metrics: { violations: { direction: "<", unit: "violations" } } }}>
                    <MeasurementTarget metric={{ type: "violations" }} />
                </DataModel.Provider>,
        components/frontend/src/measurement/MeasurementTarget.test.js on lines 25..32

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

        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