ICTU/quality-time

View on GitHub

Showing 684 of 684 total issues

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

                {nrDates === 1 && settings.hiddenColumns.excludes("target") && (
                    <SortableTableHeaderCell
                        column="target"
                        label="Target"
                        textAlign="right"
Severity: Major
Found in components/frontend/src/subject/SubjectTableHeader.js and 1 other location - About 1 hr to fix
components/frontend/src/subject/SubjectTableHeader.js on lines 310..318

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

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

        <SettingsMenuItem
            active={disabled ? false : hiddenColumns.excludes(column)}
            disabled={disabled}
            disabledHelp={help}
            onClick={hiddenColumns.toggle}
components/frontend/src/header_footer/settings_menu/DateOrderMenu.js on lines 31..39
components/frontend/src/header_footer/settings_menu/TimeBetweenDatesMenu.js on lines 28..36

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

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 an empty subject if metrics with tags are hidden", async () => {
    history.push("?hidden_tags=tag,other tag")
    renderSubject(reportWithEmptySubject)
    expect(screen.queryAllByText("Subject 1 title").length).toBe(0)
})
Severity: Major
Found in components/frontend/src/subject/Subject.test.js and 1 other location - About 1 hr to fix
components/frontend/src/subject/Subject.test.js on lines 69..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 58.

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("renders the status end date", () => {
    renderSourceEntity({ status: "fixed", status_end_date: "3000-01-01" })
    expect(screen.getAllByText(/3000-01-01/).length).toBe(1)
})
Severity: Major
Found in components/frontend/src/source/SourceEntity.test.js and 2 other locations - About 1 hr to fix
components/frontend/src/source/SourceEntity.test.js on lines 47..50
components/frontend/src/source/SourceParameter.test.js on lines 143..146

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

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

        <SettingsMenuItem
            active={disabled ? false : dateInterval.equals(nr)}
            disabled={disabled}
            disabledHelp={help}
            onClick={dateInterval.set}
components/frontend/src/header_footer/settings_menu/DateOrderMenu.js on lines 31..39
components/frontend/src/header_footer/settings_menu/VisibleColumnsMenu.js on lines 65..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 58.

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("returns null when the metric scale is version number", () => {
    render(<TrendSparkline scale="version_number" />)
    expect(screen.queryAllByLabelText(/sparkline graph/).length).toBe(0)
})
Severity: Major
Found in components/frontend/src/measurement/TrendSparkline.test.js and 2 other locations - About 1 hr to fix
components/frontend/src/widgets/Button.test.js on lines 214..217
components/frontend/src/widgets/Button.test.js on lines 219..222

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

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

        <SettingsMenuItem
            active={disabled ? false : sortOrder.equals(order)}
            disabled={disabled}
            disabledHelp={help}
            onClick={sortOrder.set}
components/frontend/src/header_footer/settings_menu/TimeBetweenDatesMenu.js on lines 28..36
components/frontend/src/header_footer/settings_menu/VisibleColumnsMenu.js on lines 65..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 58.

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("renders the status rationale", () => {
    renderSourceEntity({ status: "fixed", rationale: "Why?" })
    expect(screen.getAllByText(/Why\?/).length).toBe(1)
})
Severity: Major
Found in components/frontend/src/source/SourceEntity.test.js and 2 other locations - About 1 hr to fix
components/frontend/src/source/SourceEntity.test.js on lines 42..45
components/frontend/src/source/SourceParameter.test.js on lines 143..146

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

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("renders nothing on unknown parameter type", () => {
    renderSourceParameter({ parameter_name: "Unknown", parameter_type: "unknown" })
    expect(screen.queryAllByText(/Unknown/).length).toBe(0)
})
Severity: Major
Found in components/frontend/src/source/SourceParameter.test.js and 2 other locations - About 1 hr to fix
components/frontend/src/source/SourceEntity.test.js on lines 42..45
components/frontend/src/source/SourceEntity.test.js on lines 47..50

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

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 an empty subject if metrics that require action are hidden", async () => {
    history.push("?metrics_to_hide=no_action_required")
    renderSubject(reportWithEmptySubject)
    expect(screen.queryAllByText("Subject 1 title").length).toBe(0)
})
Severity: Major
Found in components/frontend/src/subject/Subject.test.js and 1 other location - About 1 hr to fix
components/frontend/src/subject/Subject.test.js on lines 75..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 58.

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

test("AddButton has the correct label", () => {
    render(<AddButton itemType="bar" />)
    expect(screen.getAllByText(/bar/).length).toBe(1)
})
Severity: Major
Found in components/frontend/src/widgets/Button.test.js and 2 other locations - About 1 hr to fix
components/frontend/src/measurement/TrendSparkline.test.js on lines 6..9
components/frontend/src/widgets/Button.test.js on lines 219..222

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

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

Function sortedEntities has 28 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function sortedEntities(columnType, sortColumn, sortDirection, source) {
    let entities = Array.from(source.entities)
    if (sortColumn !== null) {
        let parse
        if (sortColumn === "entity_status") {
Severity: Minor
Found in components/frontend/src/source/SourceEntities.js - About 1 hr to fix

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

    it("hides the source column", () => {
        history.push("?hidden_columns=source")
        renderSubjectTable()
        expect(screen.queryAllByText(/Source/).length).toBe(0)
    })
    Severity: Major
    Found in components/frontend/src/subject/SubjectTable.test.js and 6 other locations - About 1 hr to fix
    components/frontend/src/report/ReportsOverviewDashboard.test.js on lines 116..120
    components/frontend/src/subject/Subject.test.js on lines 46..50
    components/frontend/src/subject/SubjectTable.test.js on lines 144..148
    components/frontend/src/subject/SubjectTable.test.js on lines 160..164
    components/frontend/src/subject/SubjectTable.test.js on lines 171..175
    components/frontend/src/subject/SubjectTable.test.js on lines 182..186

    Duplicated Code

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

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

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

    Tuning

    This issue has a mass of 57.

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

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

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

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

    Refactorings

    Further Reading

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

    it("hides the issue column", () => {
        history.push("?hidden_columns=issues")
        renderSubjectTable()
        expect(screen.queryAllByText(/Issues/).length).toBe(0)
    })
    Severity: Major
    Found in components/frontend/src/subject/SubjectTable.test.js and 6 other locations - About 1 hr to fix
    components/frontend/src/report/ReportsOverviewDashboard.test.js on lines 116..120
    components/frontend/src/subject/Subject.test.js on lines 46..50
    components/frontend/src/subject/SubjectTable.test.js on lines 133..137
    components/frontend/src/subject/SubjectTable.test.js on lines 144..148
    components/frontend/src/subject/SubjectTable.test.js on lines 160..164
    components/frontend/src/subject/SubjectTable.test.js on lines 171..175

    Duplicated Code

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

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

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

    Tuning

    This issue has a mass of 57.

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

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

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

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

    Refactorings

    Further Reading

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

    MultipleChoiceInput.propTypes = {
        allowAdditions: bool,
        editableLabel: labelPropType,
        label: labelPropType,
        onSearchChange: func,
    Severity: Major
    Found in components/frontend/src/fields/MultipleChoiceInput.js and 6 other locations - About 1 hr to fix
    components/frontend/src/dashboard/StatusBarChart.js on lines 72..82
    components/frontend/src/dashboard/StatusPieChart.js on lines 47..57
    components/frontend/src/fields/StringInput.js on lines 46..56
    components/frontend/src/source/SourceEntities.js on lines 122..132
    components/frontend/src/source/SourceEntities.js on lines 212..222
    components/frontend/src/source/SourceEntityDetails.js on lines 142..152

    Duplicated Code

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

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

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

    Tuning

    This issue has a mass of 57.

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

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

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

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

    Refactorings

    Further Reading

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

    it("hides the overrun column when showing multiple dates", () => {
        history.push("?hidden_columns=overrun")
        renderSubjectTable()
        expect(screen.queryAllByText(/[Oo]verrun/).length).toBe(0)
    })
    Severity: Major
    Found in components/frontend/src/subject/SubjectTable.test.js and 6 other locations - About 1 hr to fix
    components/frontend/src/report/ReportsOverviewDashboard.test.js on lines 116..120
    components/frontend/src/subject/Subject.test.js on lines 46..50
    components/frontend/src/subject/SubjectTable.test.js on lines 133..137
    components/frontend/src/subject/SubjectTable.test.js on lines 144..148
    components/frontend/src/subject/SubjectTable.test.js on lines 171..175
    components/frontend/src/subject/SubjectTable.test.js on lines 182..186

    Duplicated Code

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

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

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

    Tuning

    This issue has a mass of 57.

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

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

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

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

    Refactorings

    Further Reading

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

    StatusPieChart.propTypes = {
        animate: object,
        colors: stringsPropType,
        height: number,
        label: object,
    Severity: Major
    Found in components/frontend/src/dashboard/StatusPieChart.js and 6 other locations - About 1 hr to fix
    components/frontend/src/dashboard/StatusBarChart.js on lines 72..82
    components/frontend/src/fields/MultipleChoiceInput.js on lines 74..84
    components/frontend/src/fields/StringInput.js on lines 46..56
    components/frontend/src/source/SourceEntities.js on lines 122..132
    components/frontend/src/source/SourceEntities.js on lines 212..222
    components/frontend/src/source/SourceEntityDetails.js on lines 142..152

    Duplicated Code

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

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

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

    Tuning

    This issue has a mass of 57.

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

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

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

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

    Refactorings

    Further Reading

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

    it("hides metrics not requiring action", async () => {
        history.push("?metrics_to_hide=no_action_required")
        renderSubject()
        expect(screen.queryAllByText(/M\d/).length).toBe(1)
    })
    Severity: Major
    Found in components/frontend/src/subject/Subject.test.js and 6 other locations - About 1 hr to fix
    components/frontend/src/report/ReportsOverviewDashboard.test.js on lines 116..120
    components/frontend/src/subject/SubjectTable.test.js on lines 133..137
    components/frontend/src/subject/SubjectTable.test.js on lines 144..148
    components/frontend/src/subject/SubjectTable.test.js on lines 160..164
    components/frontend/src/subject/SubjectTable.test.js on lines 171..175
    components/frontend/src/subject/SubjectTable.test.js on lines 182..186

    Duplicated Code

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

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

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

    Tuning

    This issue has a mass of 57.

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

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

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

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

    Refactorings

    Further Reading

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

    it("hides the comment column", () => {
        history.push("?hidden_columns=comment")
        renderSubjectTable()
        expect(screen.queryAllByText(/Comment/).length).toBe(0)
    })
    Severity: Major
    Found in components/frontend/src/subject/SubjectTable.test.js and 6 other locations - About 1 hr to fix
    components/frontend/src/report/ReportsOverviewDashboard.test.js on lines 116..120
    components/frontend/src/subject/Subject.test.js on lines 46..50
    components/frontend/src/subject/SubjectTable.test.js on lines 133..137
    components/frontend/src/subject/SubjectTable.test.js on lines 144..148
    components/frontend/src/subject/SubjectTable.test.js on lines 160..164
    components/frontend/src/subject/SubjectTable.test.js on lines 182..186

    Duplicated Code

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

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

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

    Tuning

    This issue has a mass of 57.

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

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

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

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

    Refactorings

    Further Reading

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

    StatusBarChart.propTypes = {
        animate: object,
        colors: stringsPropType,
        label: labelPropType,
        tooltip: object,
    Severity: Major
    Found in components/frontend/src/dashboard/StatusBarChart.js and 6 other locations - About 1 hr to fix
    components/frontend/src/dashboard/StatusPieChart.js on lines 47..57
    components/frontend/src/fields/MultipleChoiceInput.js on lines 74..84
    components/frontend/src/fields/StringInput.js on lines 46..56
    components/frontend/src/source/SourceEntities.js on lines 122..132
    components/frontend/src/source/SourceEntities.js on lines 212..222
    components/frontend/src/source/SourceEntityDetails.js on lines 142..152

    Duplicated Code

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

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

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

    Tuning

    This issue has a mass of 57.

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

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

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

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

    Refactorings

    Further Reading

    Severity
    Category
    Status
    Source
    Language