ICTU/quality-time

View on GitHub

Showing 683 of 683 total issues

Similar blocks of code found in 5 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 4 other locations - About 35 mins to fix
components/frontend/src/issue/IssuesRows.js on lines 85..93
components/frontend/src/report/ReportDashboard.js on lines 113..121
components/frontend/src/source/Sources.js on lines 130..138
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 5 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 4 other locations - About 35 mins to fix
components/frontend/src/issue/IssuesRows.js on lines 85..93
components/frontend/src/report/ReportDashboard.js on lines 113..121
components/frontend/src/source/Sources.js on lines 130..138
components/frontend/src/subject/SubjectTableRow.js on lines 91..99

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 5 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 4 other locations - About 35 mins to fix
components/frontend/src/issue/IssuesRows.js on lines 85..93
components/frontend/src/report/ReportDashboard.js on lines 113..121
components/frontend/src/subject/SubjectTableRow.js on lines 91..99
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 5 locations. Consider refactoring.
Open

ReportDashboard.propTypes = {
    dates: datesPropType,
    measurements: array,
    onClick: func,
    onClickTag: func,
Severity: Major
Found in components/frontend/src/report/ReportDashboard.js and 4 other locations - About 35 mins to fix
components/frontend/src/issue/IssuesRows.js on lines 85..93
components/frontend/src/source/Sources.js on lines 130..138
components/frontend/src/subject/SubjectTableRow.js on lines 91..99
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 5 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 4 other locations - About 35 mins to fix
components/frontend/src/report/ReportDashboard.js on lines 113..121
components/frontend/src/source/Sources.js on lines 130..138
components/frontend/src/subject/SubjectTableRow.js on lines 91..99
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/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

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 250..254

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

Function __calculate_status has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    def __calculate_status(self, value: str | None) -> Status | None:
        """Determine the status of the measurement."""
        target, near_target, debt_target = (
            self.get("target"),
            self.get("near_target"),
Severity: Minor
Found in components/shared_code/src/shared/model/measurement.py - About 35 mins to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Function metrics has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

def metrics(report, metric_types: Sequence[str] | None = None):
    """Yield the metrics in the report, optionally filtered by metric type."""
    for subject in subjects(report):
        for metric in subject["metrics"].values():
            if not metric_types or metric["type"] in metric_types:
Severity: Minor
Found in components/api_server/src/initialization/migrations.py - About 35 mins to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Function MetricDetails has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

export function MetricDetails({
    changed_fields,
    isFirstMetric,
    isLastMetric,
    metric_uuid,
Severity: Minor
Found in components/frontend/src/metric/MetricDetails.js - About 35 mins to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Function post_reports_overview_attribute has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

def post_reports_overview_attribute(reports_attribute: str, database: Database):
    """Set a reports overview attribute."""
    new_value = dict(bottle.request.json)[reports_attribute]
    if reports_attribute == "comment" and new_value:
        new_value = sanitize_html(new_value)
Severity: Minor
Found in components/api_server/src/routes/reports_overview.py - About 35 mins to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Function match_string_or_regular_expression has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

def match_string_or_regular_expression(string: str, strings_and_or_regular_expressions: Collection[str]) -> bool:
    """Return whether the string is equal to one of the strings or matches one of the regular expressions."""
    for string_or_regular_expression in strings_and_or_regular_expressions:
        if is_regexp(string_or_regular_expression):
            if re.match(string_or_regular_expression, string):
Severity: Minor
Found in components/collector/src/collector_utilities/functions.py - About 35 mins to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Function metric_section has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

def metric_section(metric_key: str, metric: Metric, level: int) -> str:
    """Return the metric as Markdown section."""
    markdown = markdown_header(metric.name, level=level, index=True)
    markdown += markdown_paragraph(metric.description)
    name = decapitalize(metric.name)
Severity: Minor
Found in docs/src/create_reference_md.py - About 35 mins to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Function MeasurementTarget has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

export function MeasurementTarget({ metric }) {
    const dataModel = useContext(DataModel)
    if (metric?.evaluate_targets === false) {
        return null
    }
Severity: Minor
Found in components/frontend/src/measurement/MeasurementTarget.js - About 35 mins to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Function SourceParameters has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

export function SourceParameters({ changed_param_keys, metric, reload, report, source, source_uuid }) {
    const dataModel = useContext(DataModel)
    const metricUnit = formatMetricScaleAndUnit(metric, dataModel)
    const allParameters = dataModel.sources[source.type].parameters
    const parameterLayout = dataModel.sources[source.type].parameter_layout ?? DEFAULT_LAYOUT
Severity: Minor
Found in components/frontend/src/source/SourceParameters.js - About 35 mins to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Function _include_entity has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    def _include_entity(self, entity: Entity) -> bool:
        """Return whether the card should be included."""

        def card_is_inactive() -> bool:
            """Return whether the card is inactive."""
Severity: Minor
Found in components/collector/src/source_collectors/trello/issues.py - About 35 mins to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

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

it("renders the time axis", () => {
    renderTrendgraph()
    expect(screen.getAllByText(/Time/).length).toBe(1)
})
Severity: Major
Found in components/frontend/src/metric/TrendGraph.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/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/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("renders nothing if there is no overrun", () => {
    renderOverrun()
    expect(screen.queryAllByDisplayValue(/days/).length).toBe(0)
})
Severity: Major
Found in components/frontend/src/measurement/Overrun.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/metric/TrendGraph.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/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

Severity
Category
Status
Source
Language