ICTU/quality-time

View on GitHub

Showing 555 of 694 total issues

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

        if (x1.getTime() <= previousX2.getTime()) {
            x1.setSeconds(x1.getSeconds() + (previousX2.getSeconds() - x1.getSeconds()) + 1)
        }
Severity: Minor
Found in components/frontend/src/metric/TrendGraph.js and 1 other location - About 40 mins to fix
components/frontend/src/metric/TrendGraph.js on lines 60..62

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

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

            <Card.Content>
                <Card.Header textAlign="center">{header}</Card.Header>
            </Card.Content>
Severity: Minor
Found in components/frontend/src/dashboard/MetricSummaryCard.js and 1 other location - About 40 mins to fix
components/frontend/src/widgets/TableRowWithDetails.js on lines 25..27

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

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 (x2.getTime() <= x1.getTime()) {
            x2.setSeconds(x2.getSeconds() + (x1.getSeconds() - x2.getSeconds()) + 1)
        }
Severity: Minor
Found in components/frontend/src/metric/TrendGraph.js and 1 other location - About 40 mins to fix
components/frontend/src/metric/TrendGraph.js on lines 57..59

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

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

                <Table.Row>
                    <Table.Cell colSpan="99">{details}</Table.Cell>
                </Table.Row>
Severity: Minor
Found in components/frontend/src/widgets/TableRowWithDetails.js and 1 other location - About 40 mins to fix
components/frontend/src/dashboard/MetricSummaryCard.js on lines 103..105

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

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

Sources.propTypes = {
    changed_fields: stringsPropType,
    reports: reportsPropType,
    report: reportPropType,
    metric: metricPropType,
Severity: Major
Found in components/frontend/src/source/Sources.js and 7 other locations - About 35 mins to fix
components/frontend/src/issue/IssuesRows.js on lines 89..97
components/frontend/src/metric/MetricDetails.js on lines 75..83
components/frontend/src/report/ReportDashboard.js on lines 121..129
components/frontend/src/source/SourceEntities.js on lines 89..97
components/frontend/src/source/SourceEntities.js on lines 344..352
components/frontend/src/subject/SubjectTableRow.js on lines 94..102
components/frontend/src/widgets/Button.js on lines 70..78

Duplicated Code

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

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

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

Tuning

This issue has a mass of 47.

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

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

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

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

Refactorings

Further Reading

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

deltaDescription.propTypes = {
    dataModel: object,
    metric: metricPropType,
    scale: string,
    delta: string,
Severity: Major
Found in components/frontend/src/subject/SubjectTableRow.js and 7 other locations - About 35 mins to fix
components/frontend/src/issue/IssuesRows.js on lines 89..97
components/frontend/src/metric/MetricDetails.js on lines 75..83
components/frontend/src/report/ReportDashboard.js on lines 121..129
components/frontend/src/source/SourceEntities.js on lines 89..97
components/frontend/src/source/SourceEntities.js on lines 344..352
components/frontend/src/source/Sources.js on lines 129..137
components/frontend/src/widgets/Button.js on lines 70..78

Duplicated Code

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

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

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

Tuning

This issue has a mass of 47.

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

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

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

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

Refactorings

Further Reading

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

ReportDashboard.propTypes = {
    dates: datesPropType,
    measurements: measurementsPropType,
    onClick: func,
    onClickTag: func,
Severity: Major
Found in components/frontend/src/report/ReportDashboard.js and 7 other locations - About 35 mins to fix
components/frontend/src/issue/IssuesRows.js on lines 89..97
components/frontend/src/metric/MetricDetails.js on lines 75..83
components/frontend/src/source/SourceEntities.js on lines 89..97
components/frontend/src/source/SourceEntities.js on lines 344..352
components/frontend/src/source/Sources.js on lines 129..137
components/frontend/src/subject/SubjectTableRow.js on lines 94..102
components/frontend/src/widgets/Button.js on lines 70..78

Duplicated Code

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

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

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

Tuning

This issue has a mass of 47.

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

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

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

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

Refactorings

Further Reading

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

FilterCheckboxes.propTypes = {
    itemType: string,
    allowHidingUnsupportedItems: bool,
    showUnsupportedItems: bool,
    setShowUnsupportedItems: func,
Severity: Major
Found in components/frontend/src/widgets/Button.js and 7 other locations - About 35 mins to fix
components/frontend/src/issue/IssuesRows.js on lines 89..97
components/frontend/src/metric/MetricDetails.js on lines 75..83
components/frontend/src/report/ReportDashboard.js on lines 121..129
components/frontend/src/source/SourceEntities.js on lines 89..97
components/frontend/src/source/SourceEntities.js on lines 344..352
components/frontend/src/source/Sources.js on lines 129..137
components/frontend/src/subject/SubjectTableRow.js on lines 94..102

Duplicated Code

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

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

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

Tuning

This issue has a mass of 47.

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

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

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

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

Refactorings

Further Reading

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

sort.propTypes = {
    column: string,
    columnType: entityAttributeTypePropType,
    setColumnType: func,
    setSortColumn: func,
Severity: Major
Found in components/frontend/src/source/SourceEntities.js and 7 other locations - About 35 mins to fix
components/frontend/src/issue/IssuesRows.js on lines 89..97
components/frontend/src/metric/MetricDetails.js on lines 75..83
components/frontend/src/report/ReportDashboard.js on lines 121..129
components/frontend/src/source/SourceEntities.js on lines 344..352
components/frontend/src/source/Sources.js on lines 129..137
components/frontend/src/subject/SubjectTableRow.js on lines 94..102
components/frontend/src/widgets/Button.js on lines 70..78

Duplicated Code

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

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

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

Tuning

This issue has a mass of 47.

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

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

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

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

Refactorings

Further Reading

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

SourceEntities.propTypes = {
    loading: loadingPropType,
    measurements: measurementsPropType,
    metric: metricPropType,
    metric_uuid: string,
Severity: Major
Found in components/frontend/src/source/SourceEntities.js and 7 other locations - About 35 mins to fix
components/frontend/src/issue/IssuesRows.js on lines 89..97
components/frontend/src/metric/MetricDetails.js on lines 75..83
components/frontend/src/report/ReportDashboard.js on lines 121..129
components/frontend/src/source/SourceEntities.js on lines 89..97
components/frontend/src/source/Sources.js on lines 129..137
components/frontend/src/subject/SubjectTableRow.js on lines 94..102
components/frontend/src/widgets/Button.js on lines 70..78

Duplicated Code

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

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

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

Tuning

This issue has a mass of 47.

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

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

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

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

Refactorings

Further Reading

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

Buttons.propTypes = {
    isFirstMetric: bool,
    isLastMetric: bool,
    metric: metricPropType,
    metric_uuid: string,
Severity: Major
Found in components/frontend/src/metric/MetricDetails.js and 7 other locations - About 35 mins to fix
components/frontend/src/issue/IssuesRows.js on lines 89..97
components/frontend/src/report/ReportDashboard.js on lines 121..129
components/frontend/src/source/SourceEntities.js on lines 89..97
components/frontend/src/source/SourceEntities.js on lines 344..352
components/frontend/src/source/Sources.js on lines 129..137
components/frontend/src/subject/SubjectTableRow.js on lines 94..102
components/frontend/src/widgets/Button.js on lines 70..78

Duplicated Code

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

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

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

Tuning

This issue has a mass of 47.

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

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

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

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

Refactorings

Further Reading

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

IssueIdentifiers.propTypes = {
    entityKey: string,
    issueTrackerInstruction: node,
    metric: metricPropType,
    metric_uuid: string,
Severity: Major
Found in components/frontend/src/issue/IssuesRows.js and 7 other locations - About 35 mins to fix
components/frontend/src/metric/MetricDetails.js on lines 75..83
components/frontend/src/report/ReportDashboard.js on lines 121..129
components/frontend/src/source/SourceEntities.js on lines 89..97
components/frontend/src/source/SourceEntities.js on lines 344..352
components/frontend/src/source/Sources.js on lines 129..137
components/frontend/src/subject/SubjectTableRow.js on lines 94..102
components/frontend/src/widgets/Button.js on lines 70..78

Duplicated Code

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

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

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

Tuning

This issue has a mass of 47.

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

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

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

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

Refactorings

Further Reading

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

                stopFilteringAndSorting={() => {
                    handleSort(null)
                    settings.hiddenTags.reset()
                    settings.metricsToHide.reset()
                }}
Severity: Minor
Found in components/frontend/src/subject/SubjectTable.js and 1 other location - About 35 mins to fix
components/frontend/src/subject/SubjectTableRow.js on lines 273..277

Duplicated Code

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

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

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

Tuning

This issue has a mass of 47.

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

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

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

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

Refactorings

Further Reading

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

                    stopFilteringAndSorting={() => {
                        handleSort(null)
                        settings.hiddenTags.reset()
                        settings.metricsToHide.reset()
                    }}
Severity: Minor
Found in components/frontend/src/subject/SubjectTableRow.js and 1 other location - About 35 mins to fix
components/frontend/src/subject/SubjectTable.js on lines 57..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 47.

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

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

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

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

Refactorings

Further Reading

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

it("shows the details when expanded", () => {
    renderTableRowWithDetails(true)
    expect(screen.queryAllByText(/Details/).length).toBe(1)
})
Severity: Minor
Found in components/frontend/src/widgets/TableRowWithDetails.test.js and 1 other location - About 35 mins to fix
components/frontend/src/widgets/TableRowWithDetails.test.js on lines 22..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 47.

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

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

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

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

Refactorings

Further Reading

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

it("does not show the details when collapsed", () => {
    renderTableRowWithDetails(false)
    expect(screen.queryAllByText(/Details/).length).toBe(0)
})
Severity: Minor
Found in components/frontend/src/widgets/TableRowWithDetails.test.js and 1 other location - About 35 mins to fix
components/frontend/src/widgets/TableRowWithDetails.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 47.

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

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

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

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

Refactorings

Further Reading

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

it("shows an error message if there is no report", async () => {
    renderReport()
    expect(screen.getAllByText(/Sorry, this report doesn't exist/).length).toBe(1)
})
Severity: Major
Found in components/frontend/src/report/Report.test.js and 14 other locations - About 35 mins to fix
components/frontend/src/issue/IssuesRows.test.js on lines 39..42
components/frontend/src/measurement/MeasurementValue.test.js on lines 43..46
components/frontend/src/measurement/Overrun.test.js on lines 24..27
components/frontend/src/report/ReportsOverviewDashboard.test.js on lines 57..60
components/frontend/src/source/SourceTypeHeader.test.js on lines 41..44
components/frontend/src/source/Sources.test.js on lines 81..84
components/frontend/src/source/Sources.test.js on lines 97..100
components/frontend/src/subject/SubjectTable.test.js on lines 128..131
components/frontend/src/subject/SubjectTable.test.js on lines 139..142
components/frontend/src/subject/SubjectTable.test.js on lines 150..153
components/frontend/src/subject/SubjectTable.test.js on lines 166..169
components/frontend/src/subject/SubjectTable.test.js on lines 177..180
components/frontend/src/widgets/TableHeaderCell.test.js on lines 26..29
components/frontend/src/widgets/TableHeaderCell.test.js on lines 51..54

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

it("shows the time left column", () => {
    renderSubjectTable()
    expect(screen.queryAllByText(/Time left/).length).toBe(1)
})
Severity: Major
Found in components/frontend/src/subject/SubjectTable.test.js and 14 other locations - About 35 mins to fix
components/frontend/src/issue/IssuesRows.test.js on lines 39..42
components/frontend/src/measurement/MeasurementValue.test.js on lines 43..46
components/frontend/src/measurement/Overrun.test.js on lines 24..27
components/frontend/src/report/Report.test.js on lines 80..83
components/frontend/src/report/ReportsOverviewDashboard.test.js on lines 57..60
components/frontend/src/source/SourceTypeHeader.test.js on lines 41..44
components/frontend/src/source/Sources.test.js on lines 81..84
components/frontend/src/source/Sources.test.js on lines 97..100
components/frontend/src/subject/SubjectTable.test.js on lines 128..131
components/frontend/src/subject/SubjectTable.test.js on lines 150..153
components/frontend/src/subject/SubjectTable.test.js on lines 166..169
components/frontend/src/subject/SubjectTable.test.js on lines 177..180
components/frontend/src/widgets/TableHeaderCell.test.js on lines 26..29
components/frontend/src/widgets/TableHeaderCell.test.js on lines 51..54

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

export function add_subject(report_uuid, subjectType, reload) {
    return fetch_server_api("post", `subject/new/${report_uuid}`, { type: subjectType }).then(reload)
}
Severity: Major
Found in components/frontend/src/api/subject.js and 4 other locations - About 35 mins to fix
components/frontend/src/api/metric.js on lines 4..6
components/frontend/src/api/metric.js on lines 26..28
components/frontend/src/api/report.js on lines 35..39
components/frontend/src/api/source.js on lines 3..5

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

it("shows the issue column", () => {
    renderSubjectTable()
    expect(screen.queryAllByText(/Issues/).length).toBe(1)
})
Severity: Major
Found in components/frontend/src/subject/SubjectTable.test.js and 14 other locations - About 35 mins to fix
components/frontend/src/issue/IssuesRows.test.js on lines 39..42
components/frontend/src/measurement/MeasurementValue.test.js on lines 43..46
components/frontend/src/measurement/Overrun.test.js on lines 24..27
components/frontend/src/report/Report.test.js on lines 80..83
components/frontend/src/report/ReportsOverviewDashboard.test.js on lines 57..60
components/frontend/src/source/SourceTypeHeader.test.js on lines 41..44
components/frontend/src/source/Sources.test.js on lines 81..84
components/frontend/src/source/Sources.test.js on lines 97..100
components/frontend/src/subject/SubjectTable.test.js on lines 128..131
components/frontend/src/subject/SubjectTable.test.js on lines 139..142
components/frontend/src/subject/SubjectTable.test.js on lines 150..153
components/frontend/src/subject/SubjectTable.test.js on lines 166..169
components/frontend/src/widgets/TableHeaderCell.test.js on lines 26..29
components/frontend/src/widgets/TableHeaderCell.test.js on lines 51..54

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

Severity
Category
Status
Source
Language