ICTU/quality-time

View on GitHub
components/frontend/src/report/ReportTitle.js

Summary

Maintainability
F
1 wk
Test Coverage

File ReportTitle.js has 426 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import { func, string } from "prop-types"
import { Grid, Icon, Menu } from "semantic-ui-react"

import { delete_report, set_report_attribute } from "../api/report"
import { activeTabIndex, tabChangeHandler } from "../app_ui_settings"
Severity: Minor
Found in components/frontend/src/report/ReportTitle.js - About 6 hrs to fix

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

                            <Grid.Column>
                                <IntegerInput
                                    id="desired-response-time-red"
                                    label={
                                        <LabelWithHelp
    Severity: Major
    Found in components/frontend/src/report/ReportTitle.js and 2 other locations - About 5 hrs to fix
    components/frontend/src/report/ReportTitle.js on lines 74..97
    components/frontend/src/report/ReportTitle.js on lines 125..151

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

    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

                            <Grid.Column>
                                <IntegerInput
                                    id="desired-response-time-white"
                                    label={
                                        <LabelWithHelp
    Severity: Major
    Found in components/frontend/src/report/ReportTitle.js and 2 other locations - About 5 hrs to fix
    components/frontend/src/report/ReportTitle.js on lines 98..124
    components/frontend/src/report/ReportTitle.js on lines 125..151

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

    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

                            <Grid.Column>
                                <IntegerInput
                                    id="desired-response-time-yellow"
                                    label={
                                        <LabelWithHelp
    Severity: Major
    Found in components/frontend/src/report/ReportTitle.js and 2 other locations - About 5 hrs to fix
    components/frontend/src/report/ReportTitle.js on lines 74..97
    components/frontend/src/report/ReportTitle.js on lines 98..124

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

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

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

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

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

    Refactorings

    Further Reading

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

                            <Grid.Column>
                                <IntegerInput
                                    id="desired-response-time-false-positive"
                                    label={
                                        <LabelWithHelp
    Severity: Major
    Found in components/frontend/src/report/ReportTitle.js and 3 other locations - About 5 hrs to fix
    components/frontend/src/report/ReportTitle.js on lines 189..212
    components/frontend/src/report/ReportTitle.js on lines 213..236
    components/frontend/src/report/ReportTitle.js on lines 264..287

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

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

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

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

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

    Refactorings

    Further Reading

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

                            <Grid.Column>
                                <IntegerInput
                                    id="desired-response-time-wont-fix"
                                    label={
                                        <LabelWithHelp
    Severity: Major
    Found in components/frontend/src/report/ReportTitle.js and 3 other locations - About 5 hrs to fix
    components/frontend/src/report/ReportTitle.js on lines 189..212
    components/frontend/src/report/ReportTitle.js on lines 213..236
    components/frontend/src/report/ReportTitle.js on lines 237..263

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

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

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

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

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

    Refactorings

    Further Reading

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

                            <Grid.Column>
                                <IntegerInput
                                    id="desired-response-time-fixed"
                                    label={
                                        <LabelWithHelp
    Severity: Major
    Found in components/frontend/src/report/ReportTitle.js and 3 other locations - About 5 hrs to fix
    components/frontend/src/report/ReportTitle.js on lines 189..212
    components/frontend/src/report/ReportTitle.js on lines 237..263
    components/frontend/src/report/ReportTitle.js on lines 264..287

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

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

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

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

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

    Refactorings

    Further Reading

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

                            <Grid.Column>
                                <IntegerInput
                                    id="desired-response-time-confirmed"
                                    label={
                                        <LabelWithHelp
    Severity: Major
    Found in components/frontend/src/report/ReportTitle.js and 3 other locations - About 5 hrs to fix
    components/frontend/src/report/ReportTitle.js on lines 213..236
    components/frontend/src/report/ReportTitle.js on lines 237..263
    components/frontend/src/report/ReportTitle.js on lines 264..287

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

    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

            {
                menuItem: (
                    <Menu.Item key="changelog">
                        <Icon name="history" />
                        <FocusableTab>{"Changelog"}</FocusableTab>
    Severity: Major
    Found in components/frontend/src/report/ReportTitle.js and 2 other locations - About 3 hrs to fix
    components/frontend/src/source/Source.js on lines 200..212
    components/frontend/src/subject/SubjectTitle.js on lines 102..114

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

    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

            {
                menuItem: (
                    <Menu.Item key="configuration">
                        <Icon name="settings" />
                        <FocusableTab>{"Configuration"}</FocusableTab>
    Severity: Major
    Found in components/frontend/src/report/ReportTitle.js and 4 other locations - About 3 hrs to fix
    components/frontend/src/metric/MetricDetails.js on lines 191..203
    components/frontend/src/report/ReportTitle.js on lines 340..352
    components/frontend/src/report/ReportTitle.js on lines 370..382
    components/frontend/src/report/ReportsOverviewTitle.js on lines 109..121

    Duplicated Code

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

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

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

    Tuning

    This issue has a mass of 108.

    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

            {
                menuItem: (
                    <Menu.Item key="issue_tracker">
                        <Icon name="tasks" />
                        <FocusableTab>{"Issue tracker"}</FocusableTab>
    Severity: Major
    Found in components/frontend/src/report/ReportTitle.js and 4 other locations - About 3 hrs to fix
    components/frontend/src/metric/MetricDetails.js on lines 191..203
    components/frontend/src/report/ReportTitle.js on lines 327..339
    components/frontend/src/report/ReportTitle.js on lines 340..352
    components/frontend/src/report/ReportsOverviewTitle.js on lines 109..121

    Duplicated Code

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

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

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

    Tuning

    This issue has a mass of 108.

    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

            {
                menuItem: (
                    <Menu.Item key="reaction_times">
                        <Icon name="time" />
                        <FocusableTab>{"Desired reaction times"}</FocusableTab>
    Severity: Major
    Found in components/frontend/src/report/ReportTitle.js and 4 other locations - About 3 hrs to fix
    components/frontend/src/metric/MetricDetails.js on lines 191..203
    components/frontend/src/report/ReportTitle.js on lines 327..339
    components/frontend/src/report/ReportTitle.js on lines 370..382
    components/frontend/src/report/ReportsOverviewTitle.js on lines 109..121

    Duplicated Code

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

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

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

    Tuning

    This issue has a mass of 108.

    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

            {
                menuItem: (
                    <Menu.Item key="share">
                        <Icon name="share square" />
                        <FocusableTab>{"Share"}</FocusableTab>
    Severity: Major
    Found in components/frontend/src/report/ReportTitle.js and 2 other locations - About 3 hrs to fix
    components/frontend/src/metric/MetricDetails.js on lines 175..187
    components/frontend/src/subject/SubjectTitle.js on lines 115..127

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

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

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

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

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

    Refactorings

    Further Reading

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

                    <Grid.Column>
                        <StringInput
                            id="report-subtitle"
                            label="Report subtitle"
                            requiredPermissions={[EDIT_REPORT_PERMISSION]}
    Severity: Major
    Found in components/frontend/src/report/ReportTitle.js and 1 other location - About 2 hrs to fix
    components/frontend/src/report/ReportTitle.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 80.

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

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

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

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

    Refactorings

    Further Reading

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

                    <Grid.Column>
                        <StringInput
                            id="report-title"
                            label="Report title"
                            requiredPermissions={[EDIT_REPORT_PERMISSION]}
    Severity: Major
    Found in components/frontend/src/report/ReportTitle.js and 1 other location - About 2 hrs to fix
    components/frontend/src/report/ReportTitle.js on lines 37..45

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

    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