ICTU/quality-time

View on GitHub
components/frontend/src/header_footer/SettingsPanel.test.js

Summary

Maintainability
D
2 days
Test Coverage

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

it("shows all metrics by keypress", async () => {
    history.push("?metrics_to_hide=no_action_required")
    renderSettingsPanel()
    await userEvent.type(screen.getByText(/All metrics/), " ")
    expect(history.location.search).toBe("")
Severity: Major
Found in components/frontend/src/header_footer/SettingsPanel.test.js and 2 other locations - About 2 hrs to fix
components/frontend/src/header_footer/SettingsPanel.test.js on lines 165..170
components/frontend/src/header_footer/SettingsPanel.test.js on lines 179..184

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

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("sorts the dates ascending by keypress", async () => {
    history.push("?nr_dates=2")
    renderSettingsPanel()
    await userEvent.type(screen.getByText(/Ascending/), " ")
    expect(history.location.search).toBe("?nr_dates=2&date_order=ascending")
Severity: Major
Found in components/frontend/src/header_footer/SettingsPanel.test.js and 2 other locations - About 2 hrs to fix
components/frontend/src/header_footer/SettingsPanel.test.js on lines 62..67
components/frontend/src/header_footer/SettingsPanel.test.js on lines 165..170

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

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("sets the date interval by keypress", async () => {
    history.push("?nr_dates=2&date_interval=7")
    renderSettingsPanel()
    await userEvent.type(screen.getByText(/1 day/), " ")
    expect(history.location.search).toBe("?nr_dates=2&date_interval=1")
Severity: Major
Found in components/frontend/src/header_footer/SettingsPanel.test.js and 2 other locations - About 2 hrs to fix
components/frontend/src/header_footer/SettingsPanel.test.js on lines 62..67
components/frontend/src/header_footer/SettingsPanel.test.js on lines 179..184

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

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

it("sorts the dates descending", () => {
    history.push("?nr_dates=2&date_order=ascending")
    renderSettingsPanel()
    fireEvent.click(screen.getByText(/Descending/))
    expect(history.location.search).toBe("?nr_dates=2")
components/frontend/src/header_footer/SettingsPanel.test.js on lines 55..60
components/frontend/src/header_footer/SettingsPanel.test.js on lines 138..143
components/frontend/src/header_footer/SettingsPanel.test.js on lines 158..163
components/frontend/src/report/ReportsOverviewDashboard.test.js on lines 108..113

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

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

it("sets the date interval to one day", () => {
    history.push("?nr_dates=2")
    renderSettingsPanel()
    fireEvent.click(screen.getByText(/1 day/))
    expect(history.location.search).toBe("?nr_dates=2&date_interval=1")
components/frontend/src/header_footer/SettingsPanel.test.js on lines 55..60
components/frontend/src/header_footer/SettingsPanel.test.js on lines 138..143
components/frontend/src/header_footer/SettingsPanel.test.js on lines 172..177
components/frontend/src/report/ReportsOverviewDashboard.test.js on lines 108..113

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

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

it("shows all metrics", async () => {
    history.push("?metrics_to_hide=no_action_required")
    renderSettingsPanel()
    fireEvent.click(screen.getByText(/All metrics/))
    expect(history.location.search).toBe("")
components/frontend/src/header_footer/SettingsPanel.test.js on lines 138..143
components/frontend/src/header_footer/SettingsPanel.test.js on lines 158..163
components/frontend/src/header_footer/SettingsPanel.test.js on lines 172..177
components/frontend/src/report/ReportsOverviewDashboard.test.js on lines 108..113

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

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

it("sets the number of dates", async () => {
    history.push("?nr_dates=2")
    renderSettingsPanel()
    fireEvent.click(screen.getByText(/7 dates/))
    expect(history.location.search).toBe("?nr_dates=7")
components/frontend/src/header_footer/SettingsPanel.test.js on lines 55..60
components/frontend/src/header_footer/SettingsPanel.test.js on lines 158..163
components/frontend/src/header_footer/SettingsPanel.test.js on lines 172..177
components/frontend/src/report/ReportsOverviewDashboard.test.js on lines 108..113

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

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 a column by keypress", async () => {
    renderSettingsPanel()
    await userEvent.type(screen.getAllByText(/Comment/)[0], " ")
    expect(history.location.search).toBe("?hidden_columns=comment")
})
Severity: Major
Found in components/frontend/src/header_footer/SettingsPanel.test.js and 1 other location - About 1 hr to fix
components/frontend/src/header_footer/SettingsPanel.test.js on lines 194..198

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

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 issue summaries by keypress", async () => {
    renderSettingsPanel()
    await userEvent.type(screen.getAllByText(/Summary/)[0], " ")
    expect(history.location.search).toBe("?show_issue_summary=true")
})
Severity: Major
Found in components/frontend/src/header_footer/SettingsPanel.test.js and 1 other location - About 1 hr to fix
components/frontend/src/header_footer/SettingsPanel.test.js on lines 94..98

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

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("hides the metrics not requiring action", async () => {
    renderSettingsPanel()
    fireEvent.click(screen.getByText(/Metrics requiring action/))
    expect(history.location.search).toBe("?metrics_to_hide=no_action_required")
})
components/frontend/src/header_footer/SettingsPanel.test.js on lines 88..92
components/frontend/src/report/ReportsOverviewDashboard.test.js on lines 102..106

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

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("hides a column", async () => {
    renderSettingsPanel()
    fireEvent.click(screen.getByText(/Trend/))
    expect(history.location.search).toBe("?hidden_columns=trend")
})
components/frontend/src/header_footer/SettingsPanel.test.js on lines 49..53
components/frontend/src/report/ReportsOverviewDashboard.test.js on lines 102..106

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

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

There are no issues that match your filters.

Category
Status