onebeyond/react-form-builder

View on GitHub

Showing 199 of 233 total issues

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

  if (priorityOptions.length > 0) {
    const priorityOptionsReversed = [...priorityOptions].reverse()
    priorityOptionsReversed.forEach((isoCode) => {
      const foundIndex =
        finalListOfSubdivisions.findIndex((subdivision) => subdivision.value.toLowerCase() === isoCode.toLowerCase())
src/Questions/CountryV2/index.js on lines 44..54

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

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

    <div sx={styles.container}>
      <h1>
        {form.title}
      </h1>
      <Modal
Severity: Major
Found in example/src/forms/CountrySubdivisions/index.jsx and 2 other locations - About 5 hrs to fix
example/src/forms/Countries/index.jsx on lines 52..71
example/src/forms/Countries/index.jsx on lines 72..91

Duplicated Code

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

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

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

Tuning

This issue has a mass of 138.

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

      <div sx={styles.formContainer}>
        <h1>
          {oldForm.title}
        </h1>
        <Modal
Severity: Major
Found in example/src/forms/Countries/index.jsx and 2 other locations - About 5 hrs to fix
example/src/forms/Countries/index.jsx on lines 72..91
example/src/forms/CountrySubdivisions/index.jsx on lines 41..60

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

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

      <div sx={styles.formContainer}>
        <h1>
          {newForm.title}
        </h1>
        <Modal
Severity: Major
Found in example/src/forms/Countries/index.jsx and 2 other locations - About 5 hrs to fix
example/src/forms/Countries/index.jsx on lines 52..71
example/src/forms/CountrySubdivisions/index.jsx on lines 41..60

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

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

test('handles custom markdown link callback', () => {
  const onLinkOpen = jest.fn()
  const { getByRole } = render(
    <QuestionInput
      question={{
Severity: Major
Found in src/Questions/Input/__tests__/input.test.js and 2 other locations - About 5 hrs to fix
src/Questions/Checkbox/__tests__/checkbox.test.js on lines 97..114
src/Questions/Select/__tests__/select.test.js on lines 75..91

Duplicated Code

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

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

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

Tuning

This issue has a mass of 136.

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

test('handles custom markdown link callback', () => {
  const onLinkOpen = jest.fn()
  const { getByRole } = render(
    <QuestionSelect
      question={{
Severity: Major
Found in src/Questions/Select/__tests__/select.test.js and 2 other locations - About 5 hrs to fix
src/Questions/Checkbox/__tests__/checkbox.test.js on lines 97..114
src/Questions/Input/__tests__/input.test.js on lines 56..72

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

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

test('handles custom markdown link callback', () => {
  const onLinkOpen = jest.fn()
  const { getByRole } = render(
    <QuestionCheckbox
      question={{
Severity: Major
Found in src/Questions/Checkbox/__tests__/checkbox.test.js and 2 other locations - About 5 hrs to fix
src/Questions/Input/__tests__/input.test.js on lines 56..72
src/Questions/Select/__tests__/select.test.js on lines 75..91

Duplicated Code

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

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

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

Tuning

This issue has a mass of 136.

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

  {
    cn: 'Guinea-Bissau',
    cs: 'GW',
    regions: [
      {
Severity: Major
Found in src/Questions/County/data/countryAndCounties.js and 1 other location - About 4 hrs to fix
src/Questions/County/data/countryAndCounties.js on lines 176..217

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

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

  {
    cn: 'Austria',
    cs: 'AT',
    regions: [
      {
Severity: Major
Found in src/Questions/County/data/countryAndCounties.js and 1 other location - About 4 hrs to fix
src/Questions/County/data/countryAndCounties.js on lines 1144..1185

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

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

test(`buildCountrySubdivisonOptions returns all the regions of a country in a {label, value} format
  with the region name as value`, () => {
  const config = {
    valueType: 'name'
  }
src/Questions/CountrySubdivision/__tests__/buildCountrySubdivisonOptions.test.js on lines 9..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 117.

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

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

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

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

Refactorings

Further Reading

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

test(`buildCountrySubdivisonOptions returns all the regions of a country in a {label, value} format
  with the region iso code as value`, () => {
  const config = {
    valueType: 'iso_code'
  }
src/Questions/CountrySubdivision/__tests__/buildCountrySubdivisonOptions.test.js on lines 22..33

Duplicated Code

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

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

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

Tuning

This issue has a mass of 117.

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

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

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

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

Refactorings

Further Reading

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

  {
    cn: 'Australia',
    cs: 'AU',
    regions: [
      {
Severity: Major
Found in src/Questions/County/data/countryAndCounties.js and 1 other location - About 3 hrs to fix
src/Questions/County/data/countryAndCounties.js on lines 218..255

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

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

  {
    cn: 'Bangladesh',
    cs: 'BD',
    regions: [
      {
Severity: Major
Found in src/Questions/County/data/countryAndCounties.js and 1 other location - About 3 hrs to fix
src/Questions/County/data/countryAndCounties.js on lines 138..175

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

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

test('show an error message', () => {
  const { getByText } = render(
    <QuestionCountry
      question={question}
      useForm={{
Severity: Major
Found in src/Questions/Country/__tests__/country.test.js and 7 other locations - About 3 hrs to fix
src/Questions/Age/_tests_/age.test.js on lines 97..114
src/Questions/Autocomplete/__tests__/autocomplete.test.js on lines 112..129
src/Questions/Checkbox/__tests__/checkbox.test.js on lines 67..85
src/Questions/Genre/_tests_/gender.test.js on lines 196..213
src/Questions/MultipleCheckboxes/__tests__/multipleCheckboxes.test.js on lines 76..94
src/Questions/MultipleCheckboxes/__tests__/multipleCheckboxes.test.js on lines 95..113
src/Questions/MultipleCheckboxes/__tests__/multipleCheckboxes.test.js on lines 114..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 107.

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

test('calendar is in spanish', () => {
  const { container } = render(
    <QuestionDate question={question} language='es' useForm={formMethods} />
  )
  const calendar = getById(container, 'select-month')
Severity: Major
Found in src/Questions/Date/__tests__/date.test.js and 3 other locations - About 3 hrs to fix
src/Questions/Date/__tests__/date.test.js on lines 223..232
src/Questions/Date/__tests__/date.test.js on lines 234..243
src/Questions/Date/__tests__/date.test.js on lines 245..254

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

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

test('shows a max option error message', () => {
  const { getByText } = render(
    <QuestionMultipleCheckboxes
      question={question}
      useForm={{
src/Questions/Age/_tests_/age.test.js on lines 97..114
src/Questions/Autocomplete/__tests__/autocomplete.test.js on lines 112..129
src/Questions/Checkbox/__tests__/checkbox.test.js on lines 67..85
src/Questions/Country/__tests__/country.test.js on lines 275..292
src/Questions/Genre/_tests_/gender.test.js on lines 196..213
src/Questions/MultipleCheckboxes/__tests__/multipleCheckboxes.test.js on lines 76..94
src/Questions/MultipleCheckboxes/__tests__/multipleCheckboxes.test.js on lines 114..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 107.

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

test('show an error message', () => {
  const { getByText } = render(
    <QuestionGender
      question={question}
      useForm={{
Severity: Major
Found in src/Questions/Genre/_tests_/gender.test.js and 7 other locations - About 3 hrs to fix
src/Questions/Age/_tests_/age.test.js on lines 97..114
src/Questions/Autocomplete/__tests__/autocomplete.test.js on lines 112..129
src/Questions/Checkbox/__tests__/checkbox.test.js on lines 67..85
src/Questions/Country/__tests__/country.test.js on lines 275..292
src/Questions/MultipleCheckboxes/__tests__/multipleCheckboxes.test.js on lines 76..94
src/Questions/MultipleCheckboxes/__tests__/multipleCheckboxes.test.js on lines 95..113
src/Questions/MultipleCheckboxes/__tests__/multipleCheckboxes.test.js on lines 114..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 107.

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

test('show an error message', () => {
  const { getByText } = render(
    <QuestionAge
      question={question}
      useForm={{
Severity: Major
Found in src/Questions/Age/_tests_/age.test.js and 7 other locations - About 3 hrs to fix
src/Questions/Autocomplete/__tests__/autocomplete.test.js on lines 112..129
src/Questions/Checkbox/__tests__/checkbox.test.js on lines 67..85
src/Questions/Country/__tests__/country.test.js on lines 275..292
src/Questions/Genre/_tests_/gender.test.js on lines 196..213
src/Questions/MultipleCheckboxes/__tests__/multipleCheckboxes.test.js on lines 76..94
src/Questions/MultipleCheckboxes/__tests__/multipleCheckboxes.test.js on lines 95..113
src/Questions/MultipleCheckboxes/__tests__/multipleCheckboxes.test.js on lines 114..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 107.

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

test('check if error exists', () => {
  const { getByText } = render(
    <QuestionAutocomplete
      question={question}
      useForm={{
Severity: Major
Found in src/Questions/Autocomplete/__tests__/autocomplete.test.js and 7 other locations - About 3 hrs to fix
src/Questions/Age/_tests_/age.test.js on lines 97..114
src/Questions/Checkbox/__tests__/checkbox.test.js on lines 67..85
src/Questions/Country/__tests__/country.test.js on lines 275..292
src/Questions/Genre/_tests_/gender.test.js on lines 196..213
src/Questions/MultipleCheckboxes/__tests__/multipleCheckboxes.test.js on lines 76..94
src/Questions/MultipleCheckboxes/__tests__/multipleCheckboxes.test.js on lines 95..113
src/Questions/MultipleCheckboxes/__tests__/multipleCheckboxes.test.js on lines 114..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 107.

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

test('calendar sending no-valid language', () => {
  const { container } = render(
    <QuestionDate question={question} language='qwerty' useForm={formMethods} />
  )
  const calendar = getById(container, 'select-month')
Severity: Major
Found in src/Questions/Date/__tests__/date.test.js and 3 other locations - About 3 hrs to fix
src/Questions/Date/__tests__/date.test.js on lines 212..221
src/Questions/Date/__tests__/date.test.js on lines 223..232
src/Questions/Date/__tests__/date.test.js on lines 234..243

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

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