ICTU/quality-time

View on GitHub

Showing 557 of 683 total issues

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

        if (c.className.indexOf('up ') == 0) {
          c.className = c.className.slice(3);
        }
Severity: Minor
Found in components/testdata/reports/jacoco/jacoco-report/sort.js and 1 other location - About 35 mins to fix
components/testdata/reports/jacoco/jacoco-report/sort.js on lines 134..136

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

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

export function set_metric_debt(metric_uuid, value, reload) {
    fetch_server_api("post", `metric/${metric_uuid}/debt`, { accept_debt: value }).then(reload)
}
Severity: Minor
Found in components/frontend/src/api/metric.js and 1 other location - About 35 mins to fix
components/frontend/src/api/metric.js on lines 4..6

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

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("shows the header", () => {
    renderMetricTypeHeader()
    expect(screen.getAllByText("Metric type").length).toBe(1)
})
Severity: Minor
Found in components/frontend/src/metric/MetricTypeHeader.test.js and 1 other location - About 35 mins to fix
components/frontend/src/source/SourceTypeHeader.test.js on lines 19..22

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

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 (c.className.indexOf('down ') == 0) {
          c.className = c.className.slice(5);
        }
Severity: Minor
Found in components/testdata/reports/jacoco/jacoco-report/sort.js and 1 other location - About 35 mins to fix
components/testdata/reports/jacoco/jacoco-report/sort.js on lines 137..139

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

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

    render(
        <>
            <IntegerInput value="42" set_value={setValue} />
            <IntegerInput value="222" />
        </>,
Severity: Minor
Found in components/frontend/src/fields/IntegerInput.test.js and 1 other location - About 35 mins to fix
components/frontend/src/fields/Input.test.js on lines 19..24

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

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

    render(
        <>
            <Input value="Hello" set_value={mockCallback} />
            <Input value="Bye" />
        </>,
Severity: Minor
Found in components/frontend/src/fields/Input.test.js and 1 other location - About 35 mins to fix
components/frontend/src/fields/IntegerInput.test.js on lines 24..29

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

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("shows the header", () => {
    renderSourceTypeHeader()
    expect(screen.getAllByText("Source type").length).toBe(1)
})
Severity: Minor
Found in components/frontend/src/source/SourceTypeHeader.test.js and 1 other location - About 35 mins to fix
components/frontend/src/metric/MetricTypeHeader.test.js on lines 17..20

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

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

export function add_metric(subject_uuid, metricType, reload) {
    fetch_server_api("post", `metric/new/${subject_uuid}`, { type: metricType }).then(reload)
}
Severity: Minor
Found in components/frontend/src/api/metric.js and 1 other location - About 35 mins to fix
components/frontend/src/api/metric.js on lines 26..28

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

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

export function copy_metric(metric_uuid, subject_uuid, reload) {
    return fetch_server_api("post", `metric/${metric_uuid}/copy/${subject_uuid}`, {}).then(reload)
}
Severity: Major
Found in components/frontend/src/api/metric.js and 6 other locations - About 30 mins to fix
components/frontend/src/api/metric.js on lines 12..14
components/frontend/src/api/notification.js on lines 10..14
components/frontend/src/api/source.js on lines 7..9
components/frontend/src/api/source.js on lines 11..13
components/frontend/src/api/subject.js on lines 7..9
components/frontend/src/api/subject.js on lines 11..13

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

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

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

    fetch_server_api.fetch_server_api = jest
        .fn()
        .mockResolvedValue({ suggestions: [{ key: "FOO-42", text: "Suggestion" }] })
Severity: Minor
Found in components/frontend/src/issue/IssuesRows.test.js and 2 other locations - About 30 mins to fix
components/frontend/src/issue/IssuesRows.test.js on lines 119..121
components/frontend/src/issue/IssuesRows.test.js on lines 130..132

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

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

export function copy_source(source_uuid, metric_uuid, reload) {
    return fetch_server_api("post", `source/${source_uuid}/copy/${metric_uuid}`, {}).then(reload)
}
Severity: Major
Found in components/frontend/src/api/source.js and 6 other locations - About 30 mins to fix
components/frontend/src/api/metric.js on lines 8..10
components/frontend/src/api/metric.js on lines 12..14
components/frontend/src/api/notification.js on lines 10..14
components/frontend/src/api/source.js on lines 11..13
components/frontend/src/api/subject.js on lines 7..9
components/frontend/src/api/subject.js on lines 11..13

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

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

export function move_metric(metric_uuid, subject_uuid, reload) {
    return fetch_server_api("post", `metric/${metric_uuid}/move/${subject_uuid}`, {}).then(reload)
}
Severity: Major
Found in components/frontend/src/api/metric.js and 6 other locations - About 30 mins to fix
components/frontend/src/api/metric.js on lines 8..10
components/frontend/src/api/notification.js on lines 10..14
components/frontend/src/api/source.js on lines 7..9
components/frontend/src/api/source.js on lines 11..13
components/frontend/src/api/subject.js on lines 7..9
components/frontend/src/api/subject.js on lines 11..13

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

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

export function move_subject(subject_uuid, report_uuid, reload) {
    return fetch_server_api("post", `subject/${subject_uuid}/move/${report_uuid}`, {}).then(reload)
}
Severity: Major
Found in components/frontend/src/api/subject.js and 6 other locations - About 30 mins to fix
components/frontend/src/api/metric.js on lines 8..10
components/frontend/src/api/metric.js on lines 12..14
components/frontend/src/api/notification.js on lines 10..14
components/frontend/src/api/source.js on lines 7..9
components/frontend/src/api/source.js on lines 11..13
components/frontend/src/api/subject.js on lines 7..9

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

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

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

    fetch_server_api.fetch_server_api = jest
        .fn()
        .mockResolvedValue({ suggestions: [{ key: "FOO-42", text: "Suggestion" }] })
Severity: Minor
Found in components/frontend/src/issue/IssuesRows.test.js and 2 other locations - About 30 mins to fix
components/frontend/src/issue/IssuesRows.test.js on lines 106..108
components/frontend/src/issue/IssuesRows.test.js on lines 130..132

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

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

export function delete_notification_destination(report_uuid, destination_uuid, reload) {
    return fetch_server_api("delete", `report/${report_uuid}/notification_destination/${destination_uuid}`, {}).then(
        reload,
    )
}
Severity: Major
Found in components/frontend/src/api/notification.js and 6 other locations - About 30 mins to fix
components/frontend/src/api/metric.js on lines 8..10
components/frontend/src/api/metric.js on lines 12..14
components/frontend/src/api/source.js on lines 7..9
components/frontend/src/api/source.js on lines 11..13
components/frontend/src/api/subject.js on lines 7..9
components/frontend/src/api/subject.js on lines 11..13

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

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

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

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

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

Refactorings

Further Reading

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

                {settings.hiddenColumns.excludes("source") && (
                    <SortableTableHeaderCell column="source" label="Sources" help={sourcesHelp} {...sortProps} />
                )}
Severity: Major
Found in components/frontend/src/subject/SubjectTableHeader.js and 5 other locations - About 30 mins to fix
components/frontend/src/subject/SubjectTableHeader.js on lines 322..324
components/frontend/src/subject/SubjectTableHeader.js on lines 328..330
components/frontend/src/subject/SubjectTableHeader.js on lines 334..336
components/frontend/src/subject/SubjectTableHeader.js on lines 337..339
components/frontend/src/subject/SubjectTableHeader.js on lines 340..342

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

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

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

    fetch_server_api.fetch_server_api = jest
        .fn()
        .mockResolvedValue({ suggestions: [{ key: "FOO-42", text: "Suggestion" }] })
Severity: Minor
Found in components/frontend/src/issue/IssuesRows.test.js and 2 other locations - About 30 mins to fix
components/frontend/src/issue/IssuesRows.test.js on lines 106..108
components/frontend/src/issue/IssuesRows.test.js 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 45.

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

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

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

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

Refactorings

Further Reading

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

                {settings.hiddenColumns.excludes("comment") && (
                    <SortableTableHeaderCell column="comment" label="Comment" help={commentHelp} {...sortProps} />
                )}
Severity: Major
Found in components/frontend/src/subject/SubjectTableHeader.js and 5 other locations - About 30 mins to fix
components/frontend/src/subject/SubjectTableHeader.js on lines 322..324
components/frontend/src/subject/SubjectTableHeader.js on lines 325..327
components/frontend/src/subject/SubjectTableHeader.js on lines 328..330
components/frontend/src/subject/SubjectTableHeader.js on lines 337..339
components/frontend/src/subject/SubjectTableHeader.js on lines 340..342

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

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

export function move_source(source_uuid, metric_uuid, reload) {
    return fetch_server_api("post", `source/${source_uuid}/move/${metric_uuid}`, {}).then(reload)
}
Severity: Major
Found in components/frontend/src/api/source.js and 6 other locations - About 30 mins to fix
components/frontend/src/api/metric.js on lines 8..10
components/frontend/src/api/metric.js on lines 12..14
components/frontend/src/api/notification.js on lines 10..14
components/frontend/src/api/source.js on lines 7..9
components/frontend/src/api/subject.js on lines 7..9
components/frontend/src/api/subject.js on lines 11..13

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

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

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

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

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

Refactorings

Further Reading

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

                {settings.hiddenColumns.excludes("time_left") && (
                    <SortableTableHeaderCell column="time_left" label="Time left" help={timeLeftHelp} {...sortProps} />
                )}
Severity: Major
Found in components/frontend/src/subject/SubjectTableHeader.js and 5 other locations - About 30 mins to fix
components/frontend/src/subject/SubjectTableHeader.js on lines 322..324
components/frontend/src/subject/SubjectTableHeader.js on lines 325..327
components/frontend/src/subject/SubjectTableHeader.js on lines 334..336
components/frontend/src/subject/SubjectTableHeader.js on lines 337..339
components/frontend/src/subject/SubjectTableHeader.js on lines 340..342

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

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