ICTU/quality-time

View on GitHub

Showing 683 of 683 total issues

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

function Parameters({
    changed_fields,
    config_error,
    connection_error,
    metric,
Severity: Major
Found in components/frontend/src/source/Source.js and 3 other locations - About 40 mins to fix
components/frontend/src/dashboard/StatusBarChart.js on lines 11..70
components/frontend/src/dashboard/StatusPieChart.js on lines 14..45
components/frontend/src/source/SourceEntityDetails.js on lines 53..126

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

    if (Object.keys(uuids).includes("metric_uuid")) {
        return fetch_server_api("get", `changelog/metric/${uuids.metric_uuid}/${nr_changes}`)
    }
Severity: Major
Found in components/frontend/src/api/changelog.js and 3 other locations - About 40 mins to fix
components/frontend/src/api/changelog.js on lines 4..6
components/frontend/src/api/changelog.js on lines 10..12
components/frontend/src/api/changelog.js on lines 13..15

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

it("renders a default value if the source parameter has no value", () => {
    renderSourceParameters({})
    expect(screen.queryAllByDisplayValue(/Default value/).length).toBe(1)
})
Severity: Minor
Found in components/frontend/src/source/SourceParameters.test.js and 2 other locations - About 40 mins to fix
components/frontend/src/source/SourceParameters.test.js on lines 61..64
components/frontend/src/source/SourceParameters.test.js on lines 97..100

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

export function StatusBarChart({ animate, colors, label, tooltip, summary, maxY, style, width, height }) {
    const nrMetrics = sum(summary[Object.keys(summary)[0]])
    const nrDates = Object.keys(summary).length
    // Calculate how many metrics this chart displays compared to the chart with the most metrics.
    // The ratio is used below to set the bar width so that bars in charts that represent fewer
Severity: Major
Found in components/frontend/src/dashboard/StatusBarChart.js and 3 other locations - About 40 mins to fix
components/frontend/src/dashboard/StatusPieChart.js on lines 14..45
components/frontend/src/source/Source.js on lines 64..116
components/frontend/src/source/SourceEntityDetails.js on lines 53..126

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

it("renders a string parameter", () => {
    renderSourceParameters({})
    expect(screen.queryAllByText(/Parameter/).length).toBe(1)
})
Severity: Minor
Found in components/frontend/src/source/SourceParameters.test.js and 2 other locations - About 40 mins to fix
components/frontend/src/source/SourceParameters.test.js on lines 71..74
components/frontend/src/source/SourceParameters.test.js on lines 97..100

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

it("renders ungrouped parameters in the group without explicitly listed parameters", () => {
    renderSourceParameters({})
    expect(screen.queryAllByText(/Other parameter/).length).toBe(2)
})
Severity: Minor
Found in components/frontend/src/source/SourceParameters.test.js and 2 other locations - About 40 mins to fix
components/frontend/src/source/SourceParameters.test.js on lines 61..64
components/frontend/src/source/SourceParameters.test.js on lines 71..74

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

                <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 102..104

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 (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 33..35

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 30..32

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

Function metricStatusOnDate has 5 arguments (exceeds 4 allowed). Consider refactoring.
Open

export function metricStatusOnDate(metric_uuid, metric, measurements, date, dataModel) {
Severity: Minor
Found in components/frontend/src/report/report_utils.js - About 35 mins to fix

    Function access_parameters has 5 arguments (exceeds 4 allowed). Consider refactoring.
    Open

    def access_parameters(
    Severity: Minor
    Found in components/shared_code/src/shared_data_model/parameters.py - About 35 mins to fix

      Function prepare_documents_for_insertion has 5 arguments (exceeds 4 allowed). Consider refactoring.
      Open

      def prepare_documents_for_insertion(
      Severity: Minor
      Found in components/api_server/src/database/reports.py - About 35 mins to fix

        Function onDragStart has 5 arguments (exceeds 4 allowed). Consider refactoring.
        Open

            function onDragStart(_currentLayout, _oldItem, _newItem, _placeholder, event) {
        Severity: Minor
        Found in components/frontend/src/dashboard/CardDashboard.js - About 35 mins to fix

          Function onDragStop has 5 arguments (exceeds 4 allowed). Consider refactoring.
          Open

              function onDragStop(newLayout, _oldItem, _newItem, _placeholder, event) {
          Severity: Minor
          Found in components/frontend/src/dashboard/CardDashboard.js - About 35 mins to fix

            Function set_entity_attribute has 5 arguments (exceeds 4 allowed). Consider refactoring.
            Open

            def set_entity_attribute(
            Severity: Minor
            Found in components/api_server/src/routes/measurement.py - About 35 mins to fix

              Function summarizeTagOnDate has 5 arguments (exceeds 4 allowed). Consider refactoring.
              Open

              function summarizeTagOnDate(report, measurements, tag, date, dataModel) {
              Severity: Minor
              Found in components/frontend/src/report/ReportDashboard.js - About 35 mins to fix

                Function summarizeReportOnDate has 5 arguments (exceeds 4 allowed). Consider refactoring.
                Open

                function summarizeReportOnDate(report, measurements, date, hiddenTags, dataModel) {
                Severity: Minor
                Found in components/frontend/src/report/ReportsOverviewDashboard.js - About 35 mins to fix

                  Function set_source_parameter has 5 arguments (exceeds 4 allowed). Consider refactoring.
                  Open

                  export function set_source_parameter(source_uuid, key, value, edit_scope, reload) {
                  Severity: Minor
                  Found in components/frontend/src/api/source.js - About 35 mins to fix

                    Function getMetricResponseOverrun has 5 arguments (exceeds 4 allowed). Consider refactoring.
                    Open

                    export function getMetricResponseOverrun(metric_uuid, metric, report, measurements, dataModel) {
                    Severity: Minor
                    Found in components/frontend/src/utils.js - About 35 mins to fix
                      Severity
                      Category
                      Status
                      Source
                      Language