ICTU/quality-time

View on GitHub

Showing 694 of 694 total issues

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

                {settings.hiddenColumns.excludes("tags") && (
                    <SortableTableHeaderCell column="tags" label="Tags" help={tagsHelp} {...sortProps} />
                )}
Severity: Major
Found in components/frontend/src/subject/SubjectTableHeader.js and 5 other locations - About 30 mins to fix
components/frontend/src/subject/SubjectTableHeader.js on lines 322..324
components/frontend/src/subject/SubjectTableHeader.js on lines 325..327
components/frontend/src/subject/SubjectTableHeader.js on lines 328..330
components/frontend/src/subject/SubjectTableHeader.js on lines 334..336
components/frontend/src/subject/SubjectTableHeader.js on lines 337..339

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

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

Avoid too many return statements within this function.
Open

        return (
            <Message
                header="Measurement details not available"
                content="There are currently no measurement details available."
            />
Severity: Major
Found in components/frontend/src/source/SourceEntities.js - About 30 mins to fix

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

    export function move_subject(subject_uuid, report_uuid, reload) {
        return fetch_server_api("post", `subject/${subject_uuid}/move/${report_uuid}`, {}).then(reload)
    }
    Severity: Major
    Found in components/frontend/src/api/subject.js and 6 other locations - About 30 mins to fix
    components/frontend/src/api/metric.js on lines 8..10
    components/frontend/src/api/metric.js on lines 12..14
    components/frontend/src/api/notification.js on lines 10..14
    components/frontend/src/api/source.js on lines 7..9
    components/frontend/src/api/source.js on lines 11..13
    components/frontend/src/api/subject.js on lines 7..9

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

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

                    {settings.hiddenColumns.excludes("source") && (
                        <SortableTableHeaderCell column="source" label="Sources" help={sourcesHelp} {...sortProps} />
                    )}
    Severity: Major
    Found in components/frontend/src/subject/SubjectTableHeader.js and 5 other locations - About 30 mins to fix
    components/frontend/src/subject/SubjectTableHeader.js on lines 322..324
    components/frontend/src/subject/SubjectTableHeader.js on lines 328..330
    components/frontend/src/subject/SubjectTableHeader.js on lines 334..336
    components/frontend/src/subject/SubjectTableHeader.js on lines 337..339
    components/frontend/src/subject/SubjectTableHeader.js on lines 340..342

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

    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

    Avoid too many return statements within this function.
    Open

            return true
    Severity: Major
    Found in components/frontend/src/fields/IntegerInput.js - About 30 mins to fix

      Avoid too many return statements within this function.
      Open

              return <MultipleChoiceInput {...parameter_props} options={dropdownOptions(parameter_values)} allowAdditions />
      Severity: Major
      Found in components/frontend/src/source/SourceParameter.js - About 30 mins to fix

        Avoid too many return statements within this function.
        Open

                return <StringInput {...parameter_props} error={warning} />
        Severity: Major
        Found in components/frontend/src/source/SourceParameter.js - About 30 mins to fix

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

          export function move_source(source_uuid, metric_uuid, reload) {
              return fetch_server_api("post", `source/${source_uuid}/move/${metric_uuid}`, {}).then(reload)
          }
          Severity: Major
          Found in components/frontend/src/api/source.js and 6 other locations - About 30 mins to fix
          components/frontend/src/api/metric.js on lines 8..10
          components/frontend/src/api/metric.js on lines 12..14
          components/frontend/src/api/notification.js on lines 10..14
          components/frontend/src/api/source.js on lines 7..9
          components/frontend/src/api/subject.js on lines 7..9
          components/frontend/src/api/subject.js on lines 11..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 45.

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

          export function copy_subject(subject_uuid, report_uuid, reload) {
              return fetch_server_api("post", `subject/${subject_uuid}/copy/${report_uuid}`, {}).then(reload)
          }
          Severity: Major
          Found in components/frontend/src/api/subject.js and 6 other locations - About 30 mins to fix
          components/frontend/src/api/metric.js on lines 8..10
          components/frontend/src/api/metric.js on lines 12..14
          components/frontend/src/api/notification.js on lines 10..14
          components/frontend/src/api/source.js on lines 7..9
          components/frontend/src/api/source.js on lines 11..13
          components/frontend/src/api/subject.js on lines 11..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 45.

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

                          {settings.hiddenColumns.excludes("unit") && (
                              <SortableTableHeaderCell column="unit" label="Unit" help={unitHelp} {...sortProps} />
                          )}
          Severity: Major
          Found in components/frontend/src/subject/SubjectTableHeader.js and 5 other locations - About 30 mins to fix
          components/frontend/src/subject/SubjectTableHeader.js on lines 325..327
          components/frontend/src/subject/SubjectTableHeader.js on lines 328..330
          components/frontend/src/subject/SubjectTableHeader.js on lines 334..336
          components/frontend/src/subject/SubjectTableHeader.js on lines 337..339
          components/frontend/src/subject/SubjectTableHeader.js on lines 340..342

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

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

                          {settings.hiddenColumns.excludes("issues") && (
                              <SortableTableHeaderCell column="issues" label="Issues" help={issuesHelp} {...sortProps} />
                          )}
          Severity: Major
          Found in components/frontend/src/subject/SubjectTableHeader.js and 5 other locations - About 30 mins to fix
          components/frontend/src/subject/SubjectTableHeader.js on lines 322..324
          components/frontend/src/subject/SubjectTableHeader.js on lines 325..327
          components/frontend/src/subject/SubjectTableHeader.js on lines 328..330
          components/frontend/src/subject/SubjectTableHeader.js on lines 334..336
          components/frontend/src/subject/SubjectTableHeader.js on lines 340..342

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

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

                          {settings.hiddenColumns.excludes("comment") && (
                              <SortableTableHeaderCell column="comment" label="Comment" help={commentHelp} {...sortProps} />
                          )}
          Severity: Major
          Found in components/frontend/src/subject/SubjectTableHeader.js and 5 other locations - About 30 mins to fix
          components/frontend/src/subject/SubjectTableHeader.js on lines 322..324
          components/frontend/src/subject/SubjectTableHeader.js on lines 325..327
          components/frontend/src/subject/SubjectTableHeader.js on lines 328..330
          components/frontend/src/subject/SubjectTableHeader.js on lines 337..339
          components/frontend/src/subject/SubjectTableHeader.js on lines 340..342

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

          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

          Avoid too many return statements within this function.
          Open

              return (
                  <Table className="entities stickyHeader" sortable size="small">
                      <Table.Header>{headers}</Table.Header>
                      <Table.Body>{rows}</Table.Body>
                  </Table>
          Severity: Major
          Found in components/frontend/src/source/SourceEntities.js - About 30 mins to fix

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

                fetch_server_api.fetch_server_api = jest
                    .fn()
                    .mockResolvedValue({ suggestions: [{ key: "FOO-42", text: "Suggestion" }] })
            Severity: Minor
            Found in components/frontend/src/issue/IssuesRows.test.js and 2 other locations - About 30 mins to fix
            components/frontend/src/issue/IssuesRows.test.js on lines 106..108
            components/frontend/src/issue/IssuesRows.test.js on lines 130..132

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

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

            export function delete_notification_destination(report_uuid, destination_uuid, reload) {
                return fetch_server_api("delete", `report/${report_uuid}/notification_destination/${destination_uuid}`, {}).then(
                    reload,
                )
            }
            Severity: Major
            Found in components/frontend/src/api/notification.js and 6 other locations - About 30 mins to fix
            components/frontend/src/api/metric.js on lines 8..10
            components/frontend/src/api/metric.js on lines 12..14
            components/frontend/src/api/source.js on lines 7..9
            components/frontend/src/api/source.js on lines 11..13
            components/frontend/src/api/subject.js on lines 7..9
            components/frontend/src/api/subject.js on lines 11..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 45.

            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

            Avoid too many return statements within this function.
            Open

                return null
            Severity: Major
            Found in components/frontend/src/source/SourceParameter.js - About 30 mins to fix

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

              export function move_metric(metric_uuid, subject_uuid, reload) {
                  return fetch_server_api("post", `metric/${metric_uuid}/move/${subject_uuid}`, {}).then(reload)
              }
              Severity: Major
              Found in components/frontend/src/api/metric.js and 6 other locations - About 30 mins to fix
              components/frontend/src/api/metric.js on lines 8..10
              components/frontend/src/api/notification.js on lines 10..14
              components/frontend/src/api/source.js on lines 7..9
              components/frontend/src/api/source.js on lines 11..13
              components/frontend/src/api/subject.js on lines 7..9
              components/frontend/src/api/subject.js on lines 11..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 45.

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

              export function copy_source(source_uuid, metric_uuid, reload) {
                  return fetch_server_api("post", `source/${source_uuid}/copy/${metric_uuid}`, {}).then(reload)
              }
              Severity: Major
              Found in components/frontend/src/api/source.js and 6 other locations - About 30 mins to fix
              components/frontend/src/api/metric.js on lines 8..10
              components/frontend/src/api/metric.js on lines 12..14
              components/frontend/src/api/notification.js on lines 10..14
              components/frontend/src/api/source.js on lines 11..13
              components/frontend/src/api/subject.js on lines 7..9
              components/frontend/src/api/subject.js on lines 11..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 45.

              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

                      <Permissions.Provider value={[]}>
                          <ReadOnlyOrEditable
                              requiredPermissions={["mockPermission"]}
                              readOnlyComponent={<MockComponent1 />}
                              editableComponent={<MockComponent2 />}
              Severity: Minor
              Found in components/frontend/src/context/Permissions.test.js and 1 other location - About 30 mins to fix
              components/frontend/src/context/Permissions.test.js on lines 42..48

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

              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

                      <Permissions.Provider value={["mockPermission"]}>
                          <ReadOnlyOrEditable
                              requiredPermissions={["mockPermission"]}
                              readOnlyComponent={<MockComponent1 />}
                              editableComponent={<MockComponent2 />}
              Severity: Minor
              Found in components/frontend/src/context/Permissions.test.js and 1 other location - About 30 mins to fix
              components/frontend/src/context/Permissions.test.js on lines 14..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 45.

              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