ICTU/quality-time

View on GitHub

Showing 681 of 681 total issues

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

it("sets the target not met status reaction time", async () => {
    renderReportTitle()
    fireEvent.click(screen.getByTitle(/expand/))
    await act(async () => {
        fireEvent.click(screen.getByText(/reaction times/))
Severity: Major
Found in components/frontend/src/report/ReportTitle.test.js and 7 other locations - About 4 hrs to fix
components/frontend/src/report/ReportTitle.test.js on lines 81..97
components/frontend/src/report/ReportTitle.test.js on lines 117..133
components/frontend/src/report/ReportTitle.test.js on lines 135..151
components/frontend/src/report/ReportTitle.test.js on lines 153..169
components/frontend/src/report/ReportTitle.test.js on lines 171..187
components/frontend/src/report/ReportTitle.test.js on lines 189..205
components/frontend/src/report/ReportTitle.test.js on lines 207..223

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

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

it("sets the confirmed measurement entity status reaction time", async () => {
    renderReportTitle()
    fireEvent.click(screen.getByTitle(/expand/))
    await act(async () => {
        fireEvent.click(screen.getByText(/reaction times/))
Severity: Major
Found in components/frontend/src/report/ReportTitle.test.js and 7 other locations - About 4 hrs to fix
components/frontend/src/report/ReportTitle.test.js on lines 81..97
components/frontend/src/report/ReportTitle.test.js on lines 99..115
components/frontend/src/report/ReportTitle.test.js on lines 117..133
components/frontend/src/report/ReportTitle.test.js on lines 135..151
components/frontend/src/report/ReportTitle.test.js on lines 171..187
components/frontend/src/report/ReportTitle.test.js on lines 189..205
components/frontend/src/report/ReportTitle.test.js on lines 207..223

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

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

it("sets the unknown status reaction time", async () => {
    renderReportTitle()
    fireEvent.click(screen.getByTitle(/expand/))
    await act(async () => {
        fireEvent.click(screen.getByText(/reaction times/))
Severity: Major
Found in components/frontend/src/report/ReportTitle.test.js and 7 other locations - About 4 hrs to fix
components/frontend/src/report/ReportTitle.test.js on lines 99..115
components/frontend/src/report/ReportTitle.test.js on lines 117..133
components/frontend/src/report/ReportTitle.test.js on lines 135..151
components/frontend/src/report/ReportTitle.test.js on lines 153..169
components/frontend/src/report/ReportTitle.test.js on lines 171..187
components/frontend/src/report/ReportTitle.test.js on lines 189..205
components/frontend/src/report/ReportTitle.test.js on lines 207..223

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

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

it("sets the fixed measurement entity status reaction time", async () => {
    renderReportTitle()
    fireEvent.click(screen.getByTitle(/expand/))
    await act(async () => {
        fireEvent.click(screen.getByText(/reaction times/))
Severity: Major
Found in components/frontend/src/report/ReportTitle.test.js and 7 other locations - About 4 hrs to fix
components/frontend/src/report/ReportTitle.test.js on lines 81..97
components/frontend/src/report/ReportTitle.test.js on lines 99..115
components/frontend/src/report/ReportTitle.test.js on lines 117..133
components/frontend/src/report/ReportTitle.test.js on lines 135..151
components/frontend/src/report/ReportTitle.test.js on lines 153..169
components/frontend/src/report/ReportTitle.test.js on lines 171..187
components/frontend/src/report/ReportTitle.test.js on lines 207..223

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

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

it("sets the won't fixed measurement entity status reaction time", async () => {
    renderReportTitle()
    fireEvent.click(screen.getByTitle(/expand/))
    await act(async () => {
        fireEvent.click(screen.getByText(/reaction times/))
Severity: Major
Found in components/frontend/src/report/ReportTitle.test.js and 7 other locations - About 4 hrs to fix
components/frontend/src/report/ReportTitle.test.js on lines 81..97
components/frontend/src/report/ReportTitle.test.js on lines 99..115
components/frontend/src/report/ReportTitle.test.js on lines 117..133
components/frontend/src/report/ReportTitle.test.js on lines 135..151
components/frontend/src/report/ReportTitle.test.js on lines 153..169
components/frontend/src/report/ReportTitle.test.js on lines 171..187
components/frontend/src/report/ReportTitle.test.js on lines 189..205

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

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

it("sets the tech debt target status reaction time", async () => {
    renderReportTitle()
    fireEvent.click(screen.getByTitle(/expand/))
    await act(async () => {
        fireEvent.click(screen.getByText(/reaction times/))
Severity: Major
Found in components/frontend/src/report/ReportTitle.test.js and 7 other locations - About 4 hrs to fix
components/frontend/src/report/ReportTitle.test.js on lines 81..97
components/frontend/src/report/ReportTitle.test.js on lines 99..115
components/frontend/src/report/ReportTitle.test.js on lines 117..133
components/frontend/src/report/ReportTitle.test.js on lines 153..169
components/frontend/src/report/ReportTitle.test.js on lines 171..187
components/frontend/src/report/ReportTitle.test.js on lines 189..205
components/frontend/src/report/ReportTitle.test.js on lines 207..223

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

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

            <Grid.Row columns={1}>
                <Grid.Column>
                    <MultipleChoiceInput
                        allowAdditions
                        id="report_overview_edit_entity_permission"
Severity: Major
Found in components/frontend/src/report/ReportsOverviewTitle.js and 1 other location - About 4 hrs to fix
components/frontend/src/report/ReportsOverviewTitle.js on lines 66..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 132.

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

            <Grid.Row columns={1}>
                <Grid.Column>
                    <MultipleChoiceInput
                        allowAdditions
                        id="report_overview_edit_report_permission"
Severity: Major
Found in components/frontend/src/report/ReportsOverviewTitle.js and 1 other location - About 4 hrs to fix
components/frontend/src/report/ReportsOverviewTitle.js on lines 80..93

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

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("sets the edit report permission", async () => {
    fetch_server_api.fetch_server_api = jest.fn().mockResolvedValue({ ok: true })
    renderReportsOverviewTitle()
    fireEvent.click(screen.getByText(/Permissions/))
    await userEvent.type(screen.getAllByText(/All authenticated users/)[0], "jadoe{Enter}")
Severity: Major
Found in components/frontend/src/report/ReportsOverviewTitle.test.js and 1 other location - About 4 hrs to fix
components/frontend/src/report/ReportsOverviewTitle.test.js on lines 63..73

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

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("sets the edit entities permission", async () => {
    fetch_server_api.fetch_server_api = jest.fn().mockResolvedValue({ ok: true })
    renderReportsOverviewTitle()
    fireEvent.click(screen.getByText(/Permissions/))
    await userEvent.type(screen.getAllByText(/All authenticated users/)[1], "jodoe{Enter}")
Severity: Major
Found in components/frontend/src/report/ReportsOverviewTitle.test.js and 1 other location - About 4 hrs to fix
components/frontend/src/report/ReportsOverviewTitle.test.js on lines 51..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 131.

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

        .map(([source_name, source_type]) => {
            return {
                key: source_name,
                text: source_type.name,
                value: source_name,
Severity: Major
Found in components/frontend/src/report/IssueTracker.js and 1 other location - About 4 hrs to fix
components/frontend/src/source/SourceType.js on lines 10..25

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

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

function sourceTypeOption(key, sourceType) {
    return {
        key: key,
        text: sourceType.name,
        value: key,
Severity: Major
Found in components/frontend/src/source/SourceType.js and 1 other location - About 4 hrs to fix
components/frontend/src/report/IssueTracker.js on lines 70..85

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

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 one report change", async () => {
    changelog_api.get_changelog.mockImplementation(() => Promise.resolve({ changelog: [{ timestamp: "2020-01-01" }] }))
    await act(async () => {
        result = render(<ChangeLog report_uuid="uuid" />)
    })
Severity: Major
Found in components/frontend/src/changelog/ChangeLog.test.js and 3 other locations - About 4 hrs to fix
components/frontend/src/changelog/ChangeLog.test.js on lines 27..34
components/frontend/src/changelog/ChangeLog.test.js on lines 36..43
components/frontend/src/changelog/ChangeLog.test.js on lines 45..52

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

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 one subject change", async () => {
    changelog_api.get_changelog.mockImplementation(() => Promise.resolve({ changelog: [{ timestamp: "2020-01-01" }] }))
    await act(async () => {
        result = render(<ChangeLog subject_uuid="uuid" />)
    })
Severity: Major
Found in components/frontend/src/changelog/ChangeLog.test.js and 3 other locations - About 4 hrs to fix
components/frontend/src/changelog/ChangeLog.test.js on lines 18..25
components/frontend/src/changelog/ChangeLog.test.js on lines 36..43
components/frontend/src/changelog/ChangeLog.test.js on lines 45..52

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

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 one metric change", async () => {
    changelog_api.get_changelog.mockImplementation(() => Promise.resolve({ changelog: [{ timestamp: "2020-01-01" }] }))
    await act(async () => {
        result = render(<ChangeLog metric_uuid="uuid" />)
    })
Severity: Major
Found in components/frontend/src/changelog/ChangeLog.test.js and 3 other locations - About 4 hrs to fix
components/frontend/src/changelog/ChangeLog.test.js on lines 18..25
components/frontend/src/changelog/ChangeLog.test.js on lines 27..34
components/frontend/src/changelog/ChangeLog.test.js on lines 45..52

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

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 one source change", async () => {
    changelog_api.get_changelog.mockImplementation(() => Promise.resolve({ changelog: [{ timestamp: "2020-01-01" }] }))
    await act(async () => {
        result = render(<ChangeLog source_uuid="uuid" />)
    })
Severity: Major
Found in components/frontend/src/changelog/ChangeLog.test.js and 3 other locations - About 4 hrs to fix
components/frontend/src/changelog/ChangeLog.test.js on lines 18..25
components/frontend/src/changelog/ChangeLog.test.js on lines 27..34
components/frontend/src/changelog/ChangeLog.test.js on lines 36..43

Duplicated Code

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

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

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

Tuning

This issue has a mass of 127.

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.test.js has 358 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import { EDIT_ENTITY_PERMISSION, EDIT_REPORT_PERMISSION } from "./context/Permissions"
import {
    capitalize,
    get_metric_target,
    get_source_name,
Severity: Minor
Found in components/frontend/src/utils.test.js - About 4 hrs to fix

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

    it("sets the metric name", async () => {
        fetch_server_api.fetch_server_api = jest.fn().mockResolvedValue({ ok: true })
        await act(async () => {
            renderMetricParameters()
        })
    components/frontend/src/metric/MetricConfigurationParameters.test.js on lines 117..129

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

    it("sets the metric unit for metrics with the count scale", async () => {
        fetch_server_api.fetch_server_api = jest.fn().mockResolvedValue({ ok: true })
        await act(async () => {
            renderMetricParameters()
        })
    components/frontend/src/metric/MetricConfigurationParameters.test.js on lines 69..81

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

    it("sets the metric version target", async () => {
        fetch_server_api.fetch_server_api = jest.fn().mockResolvedValue({ ok: true })
        renderMetricTarget({ type: "source_version", target: "10" })
        await userEvent.type(screen.getByDisplayValue("10"), "4.2{Enter}", {
            initialSelectionStart: 0,
    Severity: Major
    Found in components/frontend/src/metric/Target.test.js and 1 other location - About 4 hrs to fix
    components/frontend/src/metric/Target.test.js on lines 56..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 124.

    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