ICTU/quality-time

View on GitHub

Showing 692 of 692 total issues

Function set_source_entity_attribute has 6 arguments (exceeds 4 allowed). Consider refactoring.
Open

export function set_source_entity_attribute(metric_uuid, source_uuid, entity_key, attribute, value, reload) {
Severity: Minor
Found in components/frontend/src/api/source.js - About 45 mins to fix

    Function labelDetails has a Cognitive Complexity of 8 (exceeds 5 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 45 mins to fix

    Cognitive Complexity

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

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

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

    Further reading

    Function __parse_test_results has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
    Open

        def __parse_test_results(self, json) -> Generator:
            """Yield dicts with test result (applicable/incomplete/violations/passes) as key and rules as values."""
            if isinstance(json, list):
                if json and "tags" in json[0]:
                    yield {"violations": json}  # The items in the list are violated rules
    Severity: Minor
    Found in components/collector/src/source_collectors/axe_core/violations.py - About 45 mins to fix

    Cognitive Complexity

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

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

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

    Further reading

    Function EditableTextInput has a Cognitive Complexity of 8 (exceeds 5 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 45 mins to fix

    Cognitive Complexity

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

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

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

    Further reading

    Function issuePopupContent has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
    Open

    function issuePopupContent(issueStatus) {
        let popupContent = <TimeAgoWithDate date={issueStatus.created}>Created</TimeAgoWithDate>
        if (issueStatus.updated) {
            popupContent = (
                <>
    Severity: Minor
    Found in components/frontend/src/issue/IssueStatus.js - About 45 mins to fix

    Cognitive Complexity

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

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

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

    Further reading

    Function summarizeReportsOnDate has 6 arguments (exceeds 4 allowed). Consider refactoring.
    Open

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

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

      it("does not add inverted when in light mode", () => {
          expect(addInvertedClassNameWhenInDarkMode({ foo: "bar" }, false)).toEqual({
              className: "",
              foo: "bar",
          })
      components/frontend/src/semantic_ui_react_wrappers/dark_mode.test.js on lines 3..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 50.

      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

      function expectVisible(...matchers) {
          matchers.forEach((matcher) => expect(screen.queryAllByText(matcher).length).toBe(1))
      }
      Severity: Minor
      Found in components/frontend/src/metric/Target.test.js and 1 other location - About 45 mins to fix
      components/frontend/src/metric/Target.test.js on lines 97..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 50.

      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("adds inverted when in dark mode", () => {
          expect(addInvertedClassNameWhenInDarkMode({ foo: "bar" }, true)).toEqual({
              className: " inverted",
              foo: "bar",
          })
      components/frontend/src/semantic_ui_react_wrappers/dark_mode.test.js on lines 10..15

      Duplicated Code

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

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

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

      Tuning

      This issue has a mass of 50.

      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

      function expectNotVisible(...matchers) {
          matchers.forEach((matcher) => expect(screen.queryAllByText(matcher).length).toBe(0))
      }
      Severity: Minor
      Found in components/frontend/src/metric/Target.test.js and 1 other location - About 45 mins to fix
      components/frontend/src/metric/Target.test.js on lines 93..95

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

      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

          const reversedMeasurements = measurements.slice().sort((m1, m2) => (m1.start < m2.start ? 1 : -1))
      Severity: Major
      Found in components/frontend/src/report/Report.js and 2 other locations - About 40 mins to fix
      components/frontend/src/report/ReportsOverview.js on lines 65..65
      components/frontend/src/subject/SubjectTable.js on lines 35..35

      Duplicated Code

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

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

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

      Tuning

      This issue has a mass of 49.

      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

              {
                  metric_uuid: "metric_uuid",
                  start: "2024-01-02T00:00",
                  end: "2024-01-02T00:00",
                  count: { value: "12", status: "target_met" },
      Severity: Major
      Found in components/frontend/src/subject/SubjectTableRow.test.js and 2 other locations - About 40 mins to fix
      components/frontend/src/subject/SubjectTableRow.test.js on lines 21..27
      components/frontend/src/subject/SubjectTableRow.test.js on lines 35..41

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

      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

                      <Grid.Column>
                          <TechnicalDebtEndDate metric={metric} metric_uuid={metric_uuid} reload={reload} />
                      </Grid.Column>
      Severity: Major
      Found in components/frontend/src/metric/MetricDebtParameters.js and 6 other locations - About 40 mins to fix
      components/frontend/src/metric/MetricConfigurationParameters.js on lines 204..206
      components/frontend/src/metric/MetricConfigurationParameters.js on lines 212..214
      components/frontend/src/metric/MetricConfigurationParameters.js on lines 215..217
      components/frontend/src/metric/MetricConfigurationParameters.js on lines 219..221
      components/frontend/src/metric/MetricConfigurationParameters.js on lines 225..227
      components/frontend/src/metric/MetricDebtParameters.js on lines 99..101

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

      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

          Object.assign(navigator, {
              clipboard: { writeText: jest.fn().mockImplementation(() => Promise.resolve()) },
          })
      Severity: Minor
      Found in components/frontend/src/metric/MetricDetails.test.js and 1 other location - About 40 mins to fix
      components/frontend/src/widgets/Button.test.js on lines 326..328

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

      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

                      <Grid.Column>
                          <AcceptTechnicalDebt metric={metric} metric_uuid={metric_uuid} reload={reload} />
                      </Grid.Column>
      Severity: Major
      Found in components/frontend/src/metric/MetricDebtParameters.js and 6 other locations - About 40 mins to fix
      components/frontend/src/metric/MetricConfigurationParameters.js on lines 204..206
      components/frontend/src/metric/MetricConfigurationParameters.js on lines 212..214
      components/frontend/src/metric/MetricConfigurationParameters.js on lines 215..217
      components/frontend/src/metric/MetricConfigurationParameters.js on lines 219..221
      components/frontend/src/metric/MetricConfigurationParameters.js on lines 225..227
      components/frontend/src/metric/MetricDebtParameters.js on lines 113..115

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

      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

                      <Grid.Column>
                          <MetricName metric={metric} metric_uuid={metric_uuid} reload={reload} />
                      </Grid.Column>
      components/frontend/src/metric/MetricConfigurationParameters.js on lines 212..214
      components/frontend/src/metric/MetricConfigurationParameters.js on lines 215..217
      components/frontend/src/metric/MetricConfigurationParameters.js on lines 219..221
      components/frontend/src/metric/MetricConfigurationParameters.js on lines 225..227
      components/frontend/src/metric/MetricDebtParameters.js on lines 99..101
      components/frontend/src/metric/MetricDebtParameters.js on lines 113..115

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

      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

                      <Grid.Column>
                          <Direction metric={metric} metric_uuid={metric_uuid} reload={reload} />
                      </Grid.Column>
      components/frontend/src/metric/MetricConfigurationParameters.js on lines 204..206
      components/frontend/src/metric/MetricConfigurationParameters.js on lines 212..214
      components/frontend/src/metric/MetricConfigurationParameters.js on lines 219..221
      components/frontend/src/metric/MetricConfigurationParameters.js on lines 225..227
      components/frontend/src/metric/MetricDebtParameters.js on lines 99..101
      components/frontend/src/metric/MetricDebtParameters.js on lines 113..115

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

      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

          Object.assign(navigator, {
              clipboard: { writeText: jest.fn().mockImplementation(() => Promise.resolve()) },
          })
      Severity: Minor
      Found in components/frontend/src/widgets/Button.test.js and 1 other location - About 40 mins to fix
      components/frontend/src/metric/MetricDetails.test.js on lines 147..149

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

      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

                          <Grid.Column>
                              <Unit metric={metric} metric_uuid={metric_uuid} reload={reload} />
                          </Grid.Column>
      components/frontend/src/metric/MetricConfigurationParameters.js on lines 204..206
      components/frontend/src/metric/MetricConfigurationParameters.js on lines 212..214
      components/frontend/src/metric/MetricConfigurationParameters.js on lines 215..217
      components/frontend/src/metric/MetricConfigurationParameters.js on lines 225..227
      components/frontend/src/metric/MetricDebtParameters.js on lines 99..101
      components/frontend/src/metric/MetricDebtParameters.js on lines 113..115

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

      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

              {
                  metric_uuid: "metric_uuid",
                  start: "2024-01-01T00:00",
                  end: "2024-01-01T00:00",
                  count: { value: "10", status: "target_met" },
      Severity: Major
      Found in components/frontend/src/subject/SubjectTableRow.test.js and 2 other locations - About 40 mins to fix
      components/frontend/src/subject/SubjectTableRow.test.js on lines 21..27
      components/frontend/src/subject/SubjectTableRow.test.js on lines 28..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 49.

      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