ICTU/quality-time

View on GitHub

Showing 681 of 681 total issues

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

it("renders the target", () => {
    render(
        <DataModel.Provider value={{ metrics: { violations: { direction: "<", unit: "violations" } } }}>
            <MeasurementTarget metric={{ type: "violations" }} />
        </DataModel.Provider>,
components/frontend/src/measurement/MeasurementTarget.test.js on lines 25..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 117.

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("follows OS mode when switching to dark mode", async () => {
    matchMediaMatches = false
    const { container } = await renderAppUI()
    expect(container.firstChild.style.background).toEqual("white")
    act(() => {
Severity: Major
Found in components/frontend/src/AppUI.test.js and 1 other location - About 4 hrs to fix
components/frontend/src/AppUI.test.js on lines 90..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 117.

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("displays the sprint in the label if configured, but without sprint end date", async () => {
    history.push("?show_issue_sprint=true")
    const { queryByText } = renderIssueStatus({ sprint: true, sprintEndDate: null })
    expect(queryByText(/Sprint 42/)).not.toBe(null)
    expect(queryByText(/active/)).not.toBe(null)
Severity: Major
Found in components/frontend/src/issue/IssueStatus.test.js and 1 other location - About 4 hrs to fix
components/frontend/src/issue/IssueStatus.test.js on lines 202..208

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

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

File Button.js has 337 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import { array, bool, func, string } from "prop-types"
import { useRef, useState } from "react"
import { Icon, Input } from "semantic-ui-react"

import { Button, Checkbox, Dropdown, Label, Popup } from "../semantic_ui_react_wrappers"
Severity: Minor
Found in components/frontend/src/widgets/Button.js - About 4 hrs to fix

    File SubjectTableHeader.js has 336 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    import { bool, func } from "prop-types"
    import { useContext } from "react"
    import { List, Table } from "semantic-ui-react"
    
    import { DarkMode } from "../context/DarkMode"
    Severity: Minor
    Found in components/frontend/src/subject/SubjectTableHeader.js - About 4 hrs to fix

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

      it("displays the planned release in the label if configured", async () => {
          history.push("?show_issue_release=true")
          const { queryByText } = renderIssueStatus({ release: true })
          expect(queryByText(/1.0/)).not.toBe(null)
          expect(queryByText(/planned/)).not.toBe(null)
      Severity: Major
      Found in components/frontend/src/issue/IssueStatus.test.js and 1 other location - About 4 hrs to fix
      components/frontend/src/issue/IssueStatus.test.js on lines 244..250

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

      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("displays the sprint in the label if configured", async () => {
          history.push("?show_issue_sprint=true")
          const { queryByText } = renderIssueStatus({ sprint: true })
          expect(queryByText(/Sprint 42/)).not.toBe(null)
          expect(queryByText(/active/)).not.toBe(null)
      Severity: Major
      Found in components/frontend/src/issue/IssueStatus.test.js and 1 other location - About 4 hrs to fix
      components/frontend/src/issue/IssueStatus.test.js on lines 186..192

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

      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

      File utils.js has 334 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      import { arrayOf, number, objectOf, oneOf, string } from "prop-types"
      
      import { PERMISSIONS } from "./context/Permissions"
      import { defaultDesiredResponseTimes } from "./defaults"
      import {
      Severity: Minor
      Found in components/frontend/src/utils.js - About 4 hrs to fix

        File Button.test.js has 328 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        import { act, fireEvent, render, screen, waitFor } from "@testing-library/react"
        import userEvent from "@testing-library/user-event"
        
        import {
            AddButton,
        Severity: Minor
        Found in components/frontend/src/widgets/Button.test.js - About 3 hrs to fix

          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/source/Source.js and 2 other locations - About 3 hrs to fix
          components/frontend/src/report/ReportTitle.js on lines 383..395
          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 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 3 locations. Consider refactoring.
          Open

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

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

          it("hides the report cards", async () => {
              history.push("?hidden_cards=reports")
              renderReportsOverviewDashboard()
              expect(screen.queryAllByText(/Report/).length).toBe(0)
              expect(screen.getAllByText(/tag/).length).toBe(1)
          components/frontend/src/report/ReportsOverviewDashboard.test.js on lines 85..91

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

          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 the tag cards", async () => {
              history.push("?hidden_cards=tags")
              renderReportsOverviewDashboard()
              expect(screen.getAllByText(/Report/).length).toBe(1)
              expect(screen.queryAllByText(/tag/).length).toBe(0)
          components/frontend/src/report/ReportsOverviewDashboard.test.js on lines 77..83

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

          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("invokes the callback on add", async () => {
              const mockCallback = jest.fn()
              renderStringInput(mockCallback)
              await userEvent.type(screen.getByDisplayValue(/Option 1/), "Option 3{Enter}", {
                  initialSelectionStart: 0,
          Severity: Major
          Found in components/frontend/src/fields/StringInput.test.js and 1 other location - About 3 hrs to fix
          components/frontend/src/fields/StringInput.test.js on lines 25..34

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

          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("invokes the callback on change", async () => {
              const mockCallback = jest.fn()
              renderStringInput(mockCallback)
              await userEvent.type(screen.getByDisplayValue(/Option 1/), "Option 2{Enter}", {
                  initialSelectionStart: 0,
          Severity: Major
          Found in components/frontend/src/fields/StringInput.test.js and 1 other location - About 3 hrs to fix
          components/frontend/src/fields/StringInput.test.js on lines 36..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 110.

          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

          File Target.test.js has 319 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          import { render, screen, waitFor } from "@testing-library/react"
          import userEvent from "@testing-library/user-event"
          
          import * as fetch_server_api from "../api/fetch_server_api"
          import { DataModel } from "../context/DataModel"
          Severity: Minor
          Found in components/frontend/src/metric/Target.test.js - About 3 hrs to fix

            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="configuration">
                                <Icon name="settings" />
                                <FocusableTab>{"Configuration"}</FocusableTab>
            Severity: Major
            Found in components/frontend/src/report/ReportsOverviewTitle.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/ReportTitle.js on lines 370..382

            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

            Severity
            Category
            Status
            Source
            Language