Showing 2,206 of 2,206 total issues

Function providers has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

export const providers = (provider, isLive) =>
  ({
    instagram: {
      script: 'https://www.instagram.com/embed.js',
      styles: `
Severity: Minor
Found in src/app/legacy/psammead/psammead-social-embed/src/Canonical/index.jsx - About 35 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 getEllipsisVisibility has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

const getEllipsisVisibility = (side: string, state: StateType) => {
  // If we pruned some pages on this side, we display an ellipsis on all devices
  const wasTruncated =
    side === 'left' ? state.pagesTruncatedOnLeft : state.pagesTruncatedOnRight;
  if (wasTruncated) return VISIBILITY.ALL;
Severity: Minor
Found in src/app/components/Pagination/buildBlocks.ts - About 35 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 OEmbedLoader has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

const OEmbedLoader = ({ oembed }: OEmbedProps) => {
  const { isAmp, isLite, canonicalLink } = useContext(RequestContext);
  const { translations } = useContext(ServiceContext);

  if (isLite) return null;
Severity: Minor
Found in src/app/components/Embeds/OEmbed/index.tsx - About 35 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 getType has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

export const getType = (pageType: PageTypes | 'index', shorthand = false) => {
  switch (pageType) {
    case FRONT_PAGE:
    case 'index':
      return shorthand ? 'IDX' : 'Index';
Severity: Minor
Found in src/app/components/ChartbeatAnalytics/utils/index.ts - About 35 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 buildATIPageTrackPath has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

export const buildATIPageTrackPath = ({
  appName,
  contentId,
  contentType,
  language,
Severity: Minor
Found in src/app/components/ATIAnalytics/atiUrl/index.ts - About 35 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 SingleDoc has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

const SingleDoc = ({ label, status, url, urlLabel }: SingleDocProps) => {
  const iconStatusStyle = status ? styles.positive : styles.negative;
  const hasIcon = status ? (
    <Confirm css={styles.icon} />
  ) : (
Severity: Minor
Found in .storybook/DocsDecorator/HealthFactors/SingleDoc/index.tsx - About 35 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 SidebarLabel has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

const SidebarLabel = ({ item }) => {
  const api = useStorybookApi();
  const { isRoot, parameters, name, children, isComponent } = item;
  const { docsOnly } = parameters ?? {};

Severity: Minor
Found in .storybook/SidebarLabel/index.tsx - About 35 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 RelatedContentItem has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

  ({ item, ariaLabelledBy, eventTrackingData = null }, viewRef) => {
    if (!item || isEmpty(item)) return null;

    const headlineFirst = pathOr<string>(
      '',
Severity: Minor
Found in src/app/components/RelatedContentSection/RelatedContentItem/index.tsx - About 35 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

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

  6: {
    input: range(0, 6),
    expectedFrontSectionAllowedItems: range(0, 6),
    expectedNotFrontSectionAllowedItems: range(0, 6),
    expectedShowAllPromosAllowedItems: range(0, 6),
src/app/legacy/containers/IndexPageSection/utilities/filterAllowedItems.test.jsx on lines 16..21
src/app/legacy/containers/IndexPageSection/utilities/filterAllowedItems.test.jsx on lines 22..27
src/app/legacy/containers/IndexPageSection/utilities/filterAllowedItems.test.jsx on lines 28..33
src/app/legacy/containers/IndexPageSection/utilities/filterAllowedItems.test.jsx on lines 34..39
src/app/legacy/containers/IndexPageSection/utilities/filterAllowedItems.test.jsx on lines 40..45
src/app/legacy/containers/IndexPageSection/utilities/filterAllowedItems.test.jsx on lines 52..57
src/app/legacy/containers/IndexPageSection/utilities/filterAllowedItems.test.jsx on lines 58..63
src/app/legacy/containers/IndexPageSection/utilities/filterAllowedItems.test.jsx on lines 64..69
src/app/legacy/containers/IndexPageSection/utilities/filterAllowedItems.test.jsx on lines 70..75
src/app/legacy/containers/IndexPageSection/utilities/filterAllowedItems.test.jsx on lines 76..81
src/app/legacy/containers/IndexPageSection/utilities/filterAllowedItems.test.jsx on lines 82..87
src/app/legacy/containers/IndexPageSection/utilities/filterAllowedItems.test.jsx on lines 88..93
src/app/legacy/containers/IndexPageSection/utilities/filterAllowedItems.test.jsx on lines 94..99
src/app/legacy/containers/IndexPageSection/utilities/filterAllowedItems.test.jsx on lines 100..105

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

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

  4: {
    input: range(0, 4),
    expectedFrontSectionAllowedItems: range(0, 4),
    expectedNotFrontSectionAllowedItems: range(0, 4),
    expectedShowAllPromosAllowedItems: range(0, 4),
src/app/legacy/containers/IndexPageSection/utilities/filterAllowedItems.test.jsx on lines 16..21
src/app/legacy/containers/IndexPageSection/utilities/filterAllowedItems.test.jsx on lines 22..27
src/app/legacy/containers/IndexPageSection/utilities/filterAllowedItems.test.jsx on lines 28..33
src/app/legacy/containers/IndexPageSection/utilities/filterAllowedItems.test.jsx on lines 40..45
src/app/legacy/containers/IndexPageSection/utilities/filterAllowedItems.test.jsx on lines 46..51
src/app/legacy/containers/IndexPageSection/utilities/filterAllowedItems.test.jsx on lines 52..57
src/app/legacy/containers/IndexPageSection/utilities/filterAllowedItems.test.jsx on lines 58..63
src/app/legacy/containers/IndexPageSection/utilities/filterAllowedItems.test.jsx on lines 64..69
src/app/legacy/containers/IndexPageSection/utilities/filterAllowedItems.test.jsx on lines 70..75
src/app/legacy/containers/IndexPageSection/utilities/filterAllowedItems.test.jsx on lines 76..81
src/app/legacy/containers/IndexPageSection/utilities/filterAllowedItems.test.jsx on lines 82..87
src/app/legacy/containers/IndexPageSection/utilities/filterAllowedItems.test.jsx on lines 88..93
src/app/legacy/containers/IndexPageSection/utilities/filterAllowedItems.test.jsx on lines 94..99
src/app/legacy/containers/IndexPageSection/utilities/filterAllowedItems.test.jsx on lines 100..105

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

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

  11: {
    input: range(0, 11),
    expectedFrontSectionAllowedItems: range(0, 11),
    expectedNotFrontSectionAllowedItems: range(0, 10),
    expectedShowAllPromosAllowedItems: range(0, 11),
src/app/legacy/containers/IndexPageSection/utilities/filterAllowedItems.test.jsx on lines 16..21
src/app/legacy/containers/IndexPageSection/utilities/filterAllowedItems.test.jsx on lines 22..27
src/app/legacy/containers/IndexPageSection/utilities/filterAllowedItems.test.jsx on lines 28..33
src/app/legacy/containers/IndexPageSection/utilities/filterAllowedItems.test.jsx on lines 34..39
src/app/legacy/containers/IndexPageSection/utilities/filterAllowedItems.test.jsx on lines 40..45
src/app/legacy/containers/IndexPageSection/utilities/filterAllowedItems.test.jsx on lines 46..51
src/app/legacy/containers/IndexPageSection/utilities/filterAllowedItems.test.jsx on lines 52..57
src/app/legacy/containers/IndexPageSection/utilities/filterAllowedItems.test.jsx on lines 58..63
src/app/legacy/containers/IndexPageSection/utilities/filterAllowedItems.test.jsx on lines 64..69
src/app/legacy/containers/IndexPageSection/utilities/filterAllowedItems.test.jsx on lines 70..75
src/app/legacy/containers/IndexPageSection/utilities/filterAllowedItems.test.jsx on lines 82..87
src/app/legacy/containers/IndexPageSection/utilities/filterAllowedItems.test.jsx on lines 88..93
src/app/legacy/containers/IndexPageSection/utilities/filterAllowedItems.test.jsx on lines 94..99
src/app/legacy/containers/IndexPageSection/utilities/filterAllowedItems.test.jsx on lines 100..105

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

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

  8: {
    input: range(0, 8),
    expectedFrontSectionAllowedItems: range(0, 8),
    expectedNotFrontSectionAllowedItems: range(0, 8),
    expectedShowAllPromosAllowedItems: range(0, 8),
src/app/legacy/containers/IndexPageSection/utilities/filterAllowedItems.test.jsx on lines 16..21
src/app/legacy/containers/IndexPageSection/utilities/filterAllowedItems.test.jsx on lines 22..27
src/app/legacy/containers/IndexPageSection/utilities/filterAllowedItems.test.jsx on lines 28..33
src/app/legacy/containers/IndexPageSection/utilities/filterAllowedItems.test.jsx on lines 34..39
src/app/legacy/containers/IndexPageSection/utilities/filterAllowedItems.test.jsx on lines 40..45
src/app/legacy/containers/IndexPageSection/utilities/filterAllowedItems.test.jsx on lines 46..51
src/app/legacy/containers/IndexPageSection/utilities/filterAllowedItems.test.jsx on lines 52..57
src/app/legacy/containers/IndexPageSection/utilities/filterAllowedItems.test.jsx on lines 64..69
src/app/legacy/containers/IndexPageSection/utilities/filterAllowedItems.test.jsx on lines 70..75
src/app/legacy/containers/IndexPageSection/utilities/filterAllowedItems.test.jsx on lines 76..81
src/app/legacy/containers/IndexPageSection/utilities/filterAllowedItems.test.jsx on lines 82..87
src/app/legacy/containers/IndexPageSection/utilities/filterAllowedItems.test.jsx on lines 88..93
src/app/legacy/containers/IndexPageSection/utilities/filterAllowedItems.test.jsx on lines 94..99
src/app/legacy/containers/IndexPageSection/utilities/filterAllowedItems.test.jsx on lines 100..105

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

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

  10: {
    input: range(0, 10),
    expectedFrontSectionAllowedItems: range(0, 10),
    expectedNotFrontSectionAllowedItems: range(0, 10),
    expectedShowAllPromosAllowedItems: range(0, 10),
src/app/legacy/containers/IndexPageSection/utilities/filterAllowedItems.test.jsx on lines 16..21
src/app/legacy/containers/IndexPageSection/utilities/filterAllowedItems.test.jsx on lines 22..27
src/app/legacy/containers/IndexPageSection/utilities/filterAllowedItems.test.jsx on lines 28..33
src/app/legacy/containers/IndexPageSection/utilities/filterAllowedItems.test.jsx on lines 34..39
src/app/legacy/containers/IndexPageSection/utilities/filterAllowedItems.test.jsx on lines 40..45
src/app/legacy/containers/IndexPageSection/utilities/filterAllowedItems.test.jsx on lines 46..51
src/app/legacy/containers/IndexPageSection/utilities/filterAllowedItems.test.jsx on lines 52..57
src/app/legacy/containers/IndexPageSection/utilities/filterAllowedItems.test.jsx on lines 58..63
src/app/legacy/containers/IndexPageSection/utilities/filterAllowedItems.test.jsx on lines 64..69
src/app/legacy/containers/IndexPageSection/utilities/filterAllowedItems.test.jsx on lines 76..81
src/app/legacy/containers/IndexPageSection/utilities/filterAllowedItems.test.jsx on lines 82..87
src/app/legacy/containers/IndexPageSection/utilities/filterAllowedItems.test.jsx on lines 88..93
src/app/legacy/containers/IndexPageSection/utilities/filterAllowedItems.test.jsx on lines 94..99
src/app/legacy/containers/IndexPageSection/utilities/filterAllowedItems.test.jsx on lines 100..105

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

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

  3: {
    input: range(0, 3),
    expectedFrontSectionAllowedItems: range(0, 3),
    expectedNotFrontSectionAllowedItems: range(0, 3),
    expectedShowAllPromosAllowedItems: range(0, 3),
src/app/legacy/containers/IndexPageSection/utilities/filterAllowedItems.test.jsx on lines 16..21
src/app/legacy/containers/IndexPageSection/utilities/filterAllowedItems.test.jsx on lines 22..27
src/app/legacy/containers/IndexPageSection/utilities/filterAllowedItems.test.jsx on lines 34..39
src/app/legacy/containers/IndexPageSection/utilities/filterAllowedItems.test.jsx on lines 40..45
src/app/legacy/containers/IndexPageSection/utilities/filterAllowedItems.test.jsx on lines 46..51
src/app/legacy/containers/IndexPageSection/utilities/filterAllowedItems.test.jsx on lines 52..57
src/app/legacy/containers/IndexPageSection/utilities/filterAllowedItems.test.jsx on lines 58..63
src/app/legacy/containers/IndexPageSection/utilities/filterAllowedItems.test.jsx on lines 64..69
src/app/legacy/containers/IndexPageSection/utilities/filterAllowedItems.test.jsx on lines 70..75
src/app/legacy/containers/IndexPageSection/utilities/filterAllowedItems.test.jsx on lines 76..81
src/app/legacy/containers/IndexPageSection/utilities/filterAllowedItems.test.jsx on lines 82..87
src/app/legacy/containers/IndexPageSection/utilities/filterAllowedItems.test.jsx on lines 88..93
src/app/legacy/containers/IndexPageSection/utilities/filterAllowedItems.test.jsx on lines 94..99
src/app/legacy/containers/IndexPageSection/utilities/filterAllowedItems.test.jsx on lines 100..105

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

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

  20: {
    input: range(0, 20),
    expectedFrontSectionAllowedItems: range(0, 13),
    expectedNotFrontSectionAllowedItems: range(0, 10),
    expectedShowAllPromosAllowedItems: range(0, 20),
src/app/legacy/containers/IndexPageSection/utilities/filterAllowedItems.test.jsx on lines 16..21
src/app/legacy/containers/IndexPageSection/utilities/filterAllowedItems.test.jsx on lines 22..27
src/app/legacy/containers/IndexPageSection/utilities/filterAllowedItems.test.jsx on lines 28..33
src/app/legacy/containers/IndexPageSection/utilities/filterAllowedItems.test.jsx on lines 34..39
src/app/legacy/containers/IndexPageSection/utilities/filterAllowedItems.test.jsx on lines 40..45
src/app/legacy/containers/IndexPageSection/utilities/filterAllowedItems.test.jsx on lines 46..51
src/app/legacy/containers/IndexPageSection/utilities/filterAllowedItems.test.jsx on lines 52..57
src/app/legacy/containers/IndexPageSection/utilities/filterAllowedItems.test.jsx on lines 58..63
src/app/legacy/containers/IndexPageSection/utilities/filterAllowedItems.test.jsx on lines 64..69
src/app/legacy/containers/IndexPageSection/utilities/filterAllowedItems.test.jsx on lines 70..75
src/app/legacy/containers/IndexPageSection/utilities/filterAllowedItems.test.jsx on lines 76..81
src/app/legacy/containers/IndexPageSection/utilities/filterAllowedItems.test.jsx on lines 82..87
src/app/legacy/containers/IndexPageSection/utilities/filterAllowedItems.test.jsx on lines 88..93
src/app/legacy/containers/IndexPageSection/utilities/filterAllowedItems.test.jsx on lines 94..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 46.

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

  13: {
    input: range(0, 13),
    expectedFrontSectionAllowedItems: range(0, 13),
    expectedNotFrontSectionAllowedItems: range(0, 10),
    expectedShowAllPromosAllowedItems: range(0, 13),
src/app/legacy/containers/IndexPageSection/utilities/filterAllowedItems.test.jsx on lines 16..21
src/app/legacy/containers/IndexPageSection/utilities/filterAllowedItems.test.jsx on lines 22..27
src/app/legacy/containers/IndexPageSection/utilities/filterAllowedItems.test.jsx on lines 28..33
src/app/legacy/containers/IndexPageSection/utilities/filterAllowedItems.test.jsx on lines 34..39
src/app/legacy/containers/IndexPageSection/utilities/filterAllowedItems.test.jsx on lines 40..45
src/app/legacy/containers/IndexPageSection/utilities/filterAllowedItems.test.jsx on lines 46..51
src/app/legacy/containers/IndexPageSection/utilities/filterAllowedItems.test.jsx on lines 52..57
src/app/legacy/containers/IndexPageSection/utilities/filterAllowedItems.test.jsx on lines 58..63
src/app/legacy/containers/IndexPageSection/utilities/filterAllowedItems.test.jsx on lines 64..69
src/app/legacy/containers/IndexPageSection/utilities/filterAllowedItems.test.jsx on lines 70..75
src/app/legacy/containers/IndexPageSection/utilities/filterAllowedItems.test.jsx on lines 76..81
src/app/legacy/containers/IndexPageSection/utilities/filterAllowedItems.test.jsx on lines 82..87
src/app/legacy/containers/IndexPageSection/utilities/filterAllowedItems.test.jsx on lines 94..99
src/app/legacy/containers/IndexPageSection/utilities/filterAllowedItems.test.jsx on lines 100..105

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

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

  5: {
    input: range(0, 5),
    expectedFrontSectionAllowedItems: range(0, 5),
    expectedNotFrontSectionAllowedItems: range(0, 5),
    expectedShowAllPromosAllowedItems: range(0, 5),
src/app/legacy/containers/IndexPageSection/utilities/filterAllowedItems.test.jsx on lines 16..21
src/app/legacy/containers/IndexPageSection/utilities/filterAllowedItems.test.jsx on lines 22..27
src/app/legacy/containers/IndexPageSection/utilities/filterAllowedItems.test.jsx on lines 28..33
src/app/legacy/containers/IndexPageSection/utilities/filterAllowedItems.test.jsx on lines 34..39
src/app/legacy/containers/IndexPageSection/utilities/filterAllowedItems.test.jsx on lines 46..51
src/app/legacy/containers/IndexPageSection/utilities/filterAllowedItems.test.jsx on lines 52..57
src/app/legacy/containers/IndexPageSection/utilities/filterAllowedItems.test.jsx on lines 58..63
src/app/legacy/containers/IndexPageSection/utilities/filterAllowedItems.test.jsx on lines 64..69
src/app/legacy/containers/IndexPageSection/utilities/filterAllowedItems.test.jsx on lines 70..75
src/app/legacy/containers/IndexPageSection/utilities/filterAllowedItems.test.jsx on lines 76..81
src/app/legacy/containers/IndexPageSection/utilities/filterAllowedItems.test.jsx on lines 82..87
src/app/legacy/containers/IndexPageSection/utilities/filterAllowedItems.test.jsx on lines 88..93
src/app/legacy/containers/IndexPageSection/utilities/filterAllowedItems.test.jsx on lines 94..99
src/app/legacy/containers/IndexPageSection/utilities/filterAllowedItems.test.jsx on lines 100..105

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

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

  7: {
    input: range(0, 7),
    expectedFrontSectionAllowedItems: range(0, 7),
    expectedNotFrontSectionAllowedItems: range(0, 7),
    expectedShowAllPromosAllowedItems: range(0, 7),
src/app/legacy/containers/IndexPageSection/utilities/filterAllowedItems.test.jsx on lines 16..21
src/app/legacy/containers/IndexPageSection/utilities/filterAllowedItems.test.jsx on lines 22..27
src/app/legacy/containers/IndexPageSection/utilities/filterAllowedItems.test.jsx on lines 28..33
src/app/legacy/containers/IndexPageSection/utilities/filterAllowedItems.test.jsx on lines 34..39
src/app/legacy/containers/IndexPageSection/utilities/filterAllowedItems.test.jsx on lines 40..45
src/app/legacy/containers/IndexPageSection/utilities/filterAllowedItems.test.jsx on lines 46..51
src/app/legacy/containers/IndexPageSection/utilities/filterAllowedItems.test.jsx on lines 58..63
src/app/legacy/containers/IndexPageSection/utilities/filterAllowedItems.test.jsx on lines 64..69
src/app/legacy/containers/IndexPageSection/utilities/filterAllowedItems.test.jsx on lines 70..75
src/app/legacy/containers/IndexPageSection/utilities/filterAllowedItems.test.jsx on lines 76..81
src/app/legacy/containers/IndexPageSection/utilities/filterAllowedItems.test.jsx on lines 82..87
src/app/legacy/containers/IndexPageSection/utilities/filterAllowedItems.test.jsx on lines 88..93
src/app/legacy/containers/IndexPageSection/utilities/filterAllowedItems.test.jsx on lines 94..99
src/app/legacy/containers/IndexPageSection/utilities/filterAllowedItems.test.jsx on lines 100..105

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

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

  1: {
    input: range(0, 1),
    expectedFrontSectionAllowedItems: range(0, 1),
    expectedNotFrontSectionAllowedItems: range(0, 1),
    expectedShowAllPromosAllowedItems: range(0, 1),
src/app/legacy/containers/IndexPageSection/utilities/filterAllowedItems.test.jsx on lines 22..27
src/app/legacy/containers/IndexPageSection/utilities/filterAllowedItems.test.jsx on lines 28..33
src/app/legacy/containers/IndexPageSection/utilities/filterAllowedItems.test.jsx on lines 34..39
src/app/legacy/containers/IndexPageSection/utilities/filterAllowedItems.test.jsx on lines 40..45
src/app/legacy/containers/IndexPageSection/utilities/filterAllowedItems.test.jsx on lines 46..51
src/app/legacy/containers/IndexPageSection/utilities/filterAllowedItems.test.jsx on lines 52..57
src/app/legacy/containers/IndexPageSection/utilities/filterAllowedItems.test.jsx on lines 58..63
src/app/legacy/containers/IndexPageSection/utilities/filterAllowedItems.test.jsx on lines 64..69
src/app/legacy/containers/IndexPageSection/utilities/filterAllowedItems.test.jsx on lines 70..75
src/app/legacy/containers/IndexPageSection/utilities/filterAllowedItems.test.jsx on lines 76..81
src/app/legacy/containers/IndexPageSection/utilities/filterAllowedItems.test.jsx on lines 82..87
src/app/legacy/containers/IndexPageSection/utilities/filterAllowedItems.test.jsx on lines 88..93
src/app/legacy/containers/IndexPageSection/utilities/filterAllowedItems.test.jsx on lines 94..99
src/app/legacy/containers/IndexPageSection/utilities/filterAllowedItems.test.jsx on lines 100..105

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

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

  12: {
    input: range(0, 12),
    expectedFrontSectionAllowedItems: range(0, 12),
    expectedNotFrontSectionAllowedItems: range(0, 10),
    expectedShowAllPromosAllowedItems: range(0, 12),
src/app/legacy/containers/IndexPageSection/utilities/filterAllowedItems.test.jsx on lines 16..21
src/app/legacy/containers/IndexPageSection/utilities/filterAllowedItems.test.jsx on lines 22..27
src/app/legacy/containers/IndexPageSection/utilities/filterAllowedItems.test.jsx on lines 28..33
src/app/legacy/containers/IndexPageSection/utilities/filterAllowedItems.test.jsx on lines 34..39
src/app/legacy/containers/IndexPageSection/utilities/filterAllowedItems.test.jsx on lines 40..45
src/app/legacy/containers/IndexPageSection/utilities/filterAllowedItems.test.jsx on lines 46..51
src/app/legacy/containers/IndexPageSection/utilities/filterAllowedItems.test.jsx on lines 52..57
src/app/legacy/containers/IndexPageSection/utilities/filterAllowedItems.test.jsx on lines 58..63
src/app/legacy/containers/IndexPageSection/utilities/filterAllowedItems.test.jsx on lines 64..69
src/app/legacy/containers/IndexPageSection/utilities/filterAllowedItems.test.jsx on lines 70..75
src/app/legacy/containers/IndexPageSection/utilities/filterAllowedItems.test.jsx on lines 76..81
src/app/legacy/containers/IndexPageSection/utilities/filterAllowedItems.test.jsx on lines 88..93
src/app/legacy/containers/IndexPageSection/utilities/filterAllowedItems.test.jsx on lines 94..99
src/app/legacy/containers/IndexPageSection/utilities/filterAllowedItems.test.jsx on lines 100..105

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

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