src/app/pages/FrontPage/index.test.jsx

Summary

Maintainability
C
1 day
Test Coverage

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

      const expectedJPGSrcSetURLs = [
        `https://ichef.test.bbci.co.uk/ace/ws/70${path} 70w`,
        `https://ichef.test.bbci.co.uk/ace/ws/95${path} 95w`,
        `https://ichef.test.bbci.co.uk/ace/ws/144${path} 144w`,
        `https://ichef.test.bbci.co.uk/ace/ws/183${path} 183w`,
Severity: Major
Found in src/app/pages/FrontPage/index.test.jsx and 2 other locations - About 2 hrs to fix
src/app/pages/FeatureIdxPage/index.test.jsx on lines 176..184
src/app/pages/FrontPage/index.test.jsx on lines 188..196

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

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 expectedWebpSrcSetURLs = [
        `https://ichef.test.bbci.co.uk/ace/ws/70${path}.webp 70w`,
        `https://ichef.test.bbci.co.uk/ace/ws/95${path}.webp 95w`,
        `https://ichef.test.bbci.co.uk/ace/ws/144${path}.webp 144w`,
        `https://ichef.test.bbci.co.uk/ace/ws/183${path}.webp 183w`,
Severity: Major
Found in src/app/pages/FrontPage/index.test.jsx and 2 other locations - About 2 hrs to fix
src/app/pages/FeatureIdxPage/index.test.jsx on lines 176..184
src/app/pages/FrontPage/index.test.jsx on lines 198..206

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

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

jest.mock('uuid', () => {
  let x = 1;
  return {
    v4: () => {
      x += 1;
Severity: Major
Found in src/app/pages/FrontPage/index.test.jsx and 1 other location - About 1 hr to fix
src/app/pages/FeatureIdxPage/index.test.jsx on lines 56..64

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

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

jest.mock('#containers/PageHandlers/withContexts', () => Component => {
  return props => (
    <div id="ContextsContainer">
      <Component {...props} />
    </div>
Severity: Major
Found in src/app/pages/FrontPage/index.test.jsx and 9 other locations - About 1 hr to fix
src/app/pages/FeatureIdxPage/index.test.jsx on lines 73..79
src/app/pages/FeatureIdxPage/index.test.jsx on lines 81..87
src/app/pages/FeatureIdxPage/index.test.jsx on lines 89..95
src/app/pages/FeatureIdxPage/index.test.jsx on lines 97..103
src/app/pages/FeatureIdxPage/index.test.jsx on lines 105..111
src/app/pages/FrontPage/index.test.jsx on lines 82..88
src/app/pages/FrontPage/index.test.jsx on lines 90..96
src/app/pages/FrontPage/index.test.jsx on lines 98..104
src/app/pages/FrontPage/index.test.jsx on lines 106..112

Duplicated Code

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

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

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

Tuning

This issue has a mass of 55.

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

jest.mock('#containers/PageHandlers/withPageWrapper', () => Component => {
  return props => (
    <div id="PageWrapperContainer">
      <Component {...props} />
    </div>
Severity: Major
Found in src/app/pages/FrontPage/index.test.jsx and 9 other locations - About 1 hr to fix
src/app/pages/FeatureIdxPage/index.test.jsx on lines 73..79
src/app/pages/FeatureIdxPage/index.test.jsx on lines 81..87
src/app/pages/FeatureIdxPage/index.test.jsx on lines 89..95
src/app/pages/FeatureIdxPage/index.test.jsx on lines 97..103
src/app/pages/FeatureIdxPage/index.test.jsx on lines 105..111
src/app/pages/FrontPage/index.test.jsx on lines 74..80
src/app/pages/FrontPage/index.test.jsx on lines 90..96
src/app/pages/FrontPage/index.test.jsx on lines 98..104
src/app/pages/FrontPage/index.test.jsx on lines 106..112

Duplicated Code

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

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

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

Tuning

This issue has a mass of 55.

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

jest.mock('#containers/PageHandlers/withContexts', () => Component => {
  return props => (
    <div id="ContextsContainer">
      <Component {...props} />
    </div>
Severity: Major
Found in src/app/pages/FrontPage/index.test.jsx and 9 other locations - About 1 hr to fix
src/app/pages/FeatureIdxPage/index.test.jsx on lines 73..79
src/app/pages/FeatureIdxPage/index.test.jsx on lines 81..87
src/app/pages/FeatureIdxPage/index.test.jsx on lines 89..95
src/app/pages/FeatureIdxPage/index.test.jsx on lines 97..103
src/app/pages/FeatureIdxPage/index.test.jsx on lines 105..111
src/app/pages/FrontPage/index.test.jsx on lines 74..80
src/app/pages/FrontPage/index.test.jsx on lines 82..88
src/app/pages/FrontPage/index.test.jsx on lines 90..96
src/app/pages/FrontPage/index.test.jsx on lines 98..104

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

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

jest.mock('#containers/PageHandlers/withError', () => Component => {
  return props => (
    <div id="ErrorContainer">
      <Component {...props} />
    </div>
Severity: Major
Found in src/app/pages/FrontPage/index.test.jsx and 9 other locations - About 1 hr to fix
src/app/pages/FeatureIdxPage/index.test.jsx on lines 73..79
src/app/pages/FeatureIdxPage/index.test.jsx on lines 81..87
src/app/pages/FeatureIdxPage/index.test.jsx on lines 89..95
src/app/pages/FeatureIdxPage/index.test.jsx on lines 97..103
src/app/pages/FeatureIdxPage/index.test.jsx on lines 105..111
src/app/pages/FrontPage/index.test.jsx on lines 74..80
src/app/pages/FrontPage/index.test.jsx on lines 82..88
src/app/pages/FrontPage/index.test.jsx on lines 98..104
src/app/pages/FrontPage/index.test.jsx on lines 106..112

Duplicated Code

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

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

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

Tuning

This issue has a mass of 55.

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

jest.mock('#containers/PageHandlers/withData', () => Component => {
  return props => (
    <div id="DataContainer">
      <Component {...props} />
    </div>
Severity: Major
Found in src/app/pages/FrontPage/index.test.jsx and 9 other locations - About 1 hr to fix
src/app/pages/FeatureIdxPage/index.test.jsx on lines 73..79
src/app/pages/FeatureIdxPage/index.test.jsx on lines 81..87
src/app/pages/FeatureIdxPage/index.test.jsx on lines 89..95
src/app/pages/FeatureIdxPage/index.test.jsx on lines 97..103
src/app/pages/FeatureIdxPage/index.test.jsx on lines 105..111
src/app/pages/FrontPage/index.test.jsx on lines 74..80
src/app/pages/FrontPage/index.test.jsx on lines 82..88
src/app/pages/FrontPage/index.test.jsx on lines 90..96
src/app/pages/FrontPage/index.test.jsx on lines 106..112

Duplicated Code

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

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

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

Tuning

This issue has a mass of 55.

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

There are no issues that match your filters.

Category
Status