ICTU/quality-time

View on GitHub

Showing 684 of 684 total issues

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

it("does not show an error for non-required non-empty fields", () => {
    render(<StringInput options={["Option 1", "Option 2"]} value="Hello" />)
    expect(screen.getByRole("combobox")).toBeValid()
})
Severity: Major
Found in components/frontend/src/fields/StringInput.test.js and 1 other location - About 1 hr to fix
components/frontend/src/fields/StringInput.test.js on lines 77..80

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

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

it("sets the issue tracker password", async () => {
    renderIssueTracker()
    await userEvent.type(screen.getByText(/Password/), "secret{Enter}")
    expect(report_api.set_report_issue_tracker_attribute).toHaveBeenLastCalledWith(
        "report_uuid",
Severity: Major
Found in components/frontend/src/report/IssueTracker.test.js and 3 other locations - About 1 hr to fix
components/frontend/src/report/IssueTracker.test.js on lines 57..66
components/frontend/src/report/IssueTracker.test.js on lines 68..77
components/frontend/src/report/IssueTracker.test.js on lines 90..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 63.

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

export function SubjectTable({
    changed_fields,
    dates,
    handleSort,
    measurements,
Severity: Major
Found in components/frontend/src/subject/SubjectTable.js and 2 other locations - About 1 hr to fix
components/frontend/src/header_footer/Menubar.js on lines 117..256
components/frontend/src/subject/SubjectTableBody.js on lines 15..56

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

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 an error for non-required empty fields", () => {
    render(<StringInput options={["Option 1", "Option 2"]} value="" />)
    expect(screen.getByRole("combobox")).toBeValid()
})
Severity: Major
Found in components/frontend/src/fields/StringInput.test.js and 1 other location - About 1 hr to fix
components/frontend/src/fields/StringInput.test.js on lines 82..85

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

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 creation date in the label if configured", async () => {
    history.push("?show_issue_creation_date=true")
    const { queryByText } = renderIssueStatus()
    expect(queryByText(/4 days ago/)).not.toBe(null)
})
Severity: Major
Found in components/frontend/src/issue/IssueStatus.test.js and 1 other location - About 1 hr to fix
components/frontend/src/issue/IssueStatus.test.js on lines 113..117

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

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

export function SubjectTableBody({
    changed_fields,
    dates,
    handleSort,
    measurements,
Severity: Major
Found in components/frontend/src/subject/SubjectTableBody.js and 2 other locations - About 1 hr to fix
components/frontend/src/header_footer/Menubar.js on lines 117..256
components/frontend/src/subject/SubjectTable.js on lines 19..65

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

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 source_options has 34 lines of code (exceeds 25 allowed). Consider refactoring.
Open

export function source_options(reports, dataModel, currentMetricType, currentMetricUuid) {
    const metricSources = dataModel.metrics[currentMetricType].sources
    let options = []
    reports.forEach((report) => {
        Object.values(report.subjects).forEach((subject) => {
Severity: Minor
Found in components/frontend/src/widgets/menu_options.js - About 1 hr to fix

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

    console.error = (...args) => {
        if (/Support for defaultProps will be removed from function components/.test(args[0])) return
        if (/findDOMNode is deprecated and will be removed in the next major release./.test(args[0])) return
        error(...args)
    }
    Severity: Major
    Found in components/frontend/src/setupTests.js and 1 other location - About 1 hr to fix
    components/frontend/src/index.js on lines 9..13

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

    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 metric type even when not supported by the subject type", async () => {
        await act(async () => {
            renderSourceType("violations", "unsupported")
        })
        expect(screen.queryAllByText(/Unsupported/).length).toBe(2)
    Severity: Major
    Found in components/frontend/src/source/SourceType.test.js and 1 other location - About 1 hr to fix
    components/frontend/src/source/SourceType.test.js on lines 65..70

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

    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

                {notification_destinations.length === 0 ? (
                    <Message>
                        <Message.Header>No notification destinations</Message.Header>
                        <p>No notification destinations have been configured yet.</p>
                    </Message>
    components/frontend/src/source/Sources.js on lines 117..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 62.

    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 supported source versions", async () => {
        await act(async () => {
            renderSourceType("violations", "sonarqube")
        })
        expect(screen.queryAllByText(/Supported SonarQube versions: >=8.2/).length).toBe(1)
    Severity: Major
    Found in components/frontend/src/source/SourceType.test.js and 1 other location - About 1 hr to fix
    components/frontend/src/source/SourceType.test.js on lines 58..63

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

    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

    console.error = (...args) => {
        if (/Support for defaultProps will be removed from function components/.test(args[0])) return
        if (/findDOMNode is deprecated and will be removed in the next major release./.test(args[0])) return
        error(...args)
    }
    Severity: Major
    Found in components/frontend/src/index.js and 1 other location - About 1 hr to fix
    components/frontend/src/setupTests.js on lines 4..8

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

    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

                {sourceSegments.length === 0 ? (
                    <Message>
                        <Message.Header>No sources</Message.Header>
                        <p>No sources have been configured yet.</p>
                    </Message>
    Severity: Major
    Found in components/frontend/src/source/Sources.js and 1 other location - About 1 hr to fix
    components/frontend/src/notification/NotificationDestinations.js on lines 105..112

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

    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

        "duplicated_lines": Metric(
            name="Duplicated lines",
            description="The number of lines that are duplicated.",
            rationale="Duplicate code makes software larger and thus potentially harder to maintain. "
            "Also, if the duplicated code contains bugs, they need to be fixed in multiple locations.",
    Severity: Major
    Found in components/shared_code/src/shared_data_model/metrics.py and 1 other location - About 1 hr to fix
    components/shared_code/src/shared_data_model/metrics.py on lines 204..214

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

    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

        "many_parameters": Metric(
            name="Many parameters",
            description="The number of units (functions, methods, procedures) that have too many parameters.",
            rationale="Units with many parameters are deemed harder to maintain.",
            rationale_urls=[
    Severity: Major
    Found in components/shared_code/src/shared_data_model/metrics.py and 1 other location - About 1 hr to fix
    components/shared_code/src/shared_data_model/metrics.py on lines 96..107

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

    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 EditableTextInput has 33 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    function EditableTextInput(props) {
        let { label, required, set_value, ...otherProps } = props
        const initialValue = props.value || ""
        const [text, setText] = useState(initialValue)
    
    
    Severity: Minor
    Found in components/frontend/src/fields/TextInput.js - About 1 hr to fix

      Function StringInputWithSuggestions has 33 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      function StringInputWithSuggestions(props) {
          let { editableLabel, label, error, options, placeholder, required, set_value, warning, ...otherProps } = props
          placeholder = placeholder || "none"
          const initialValue = props.value || ""
          const [stringOptions, setStringOptions] = useState([
      Severity: Minor
      Found in components/frontend/src/fields/StringInput.js - About 1 hr to fix

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

        it("hides a column", async () => {
            renderSettingsPanel()
            fireEvent.click(screen.getByText(/Trend/))
            expect(history.location.search).toBe("?hidden_columns=trend")
        })
        Severity: Major
        Found in components/frontend/src/header_footer/SettingsPanel.test.js and 1 other location - About 1 hr to fix
        components/frontend/src/header_footer/SettingsPanel.test.js on lines 49..53

        Duplicated Code

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

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

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

        Tuning

        This issue has a mass of 61.

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

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

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

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

        Refactorings

        Further Reading

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

        it("hides the metrics not requiring action", async () => {
            renderSettingsPanel()
            fireEvent.click(screen.getByText(/Metrics requiring action/))
            expect(history.location.search).toBe("?metrics_to_hide=no_action_required")
        })
        Severity: Major
        Found in components/frontend/src/header_footer/SettingsPanel.test.js and 1 other location - About 1 hr to fix
        components/frontend/src/header_footer/SettingsPanel.test.js on lines 88..92

        Duplicated Code

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

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

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

        Tuning

        This issue has a mass of 61.

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

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

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

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

        Refactorings

        Further Reading

        Function labelDetails has 32 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        function labelDetails(issueStatus, settings) {
            let details = [<Label.Detail key="name">{issueStatus.name || "?"}</Label.Detail>]
            if (issueStatus.summary && settings.showIssueSummary.value) {
                details.push(<Label.Detail key="summary">{issueStatus.summary}</Label.Detail>)
            }
        Severity: Minor
        Found in components/frontend/src/issue/IssueStatus.js - About 1 hr to fix
          Severity
          Category
          Status
          Source
          Language