src/app/legacy/containers/ConsentBanner/Banner/cookie.amp.jsx

Summary

Maintainability
C
1 day
Test Coverage
A
100%

File cookie.amp.jsx has 319 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import React from 'react';
import { Helmet } from 'react-helmet';
import styled from '@emotion/styled';
import {
  getDoublePica,
Severity: Minor
Found in src/app/legacy/containers/ConsentBanner/Banner/cookie.amp.jsx - About 3 hrs to fix

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

                <Paragraph script={script}>
                  <StyledLink
                    className="focusIndicatorReducedWidth"
                    href={manage.description.para7.url}
                    text={manage.description.para7.text}
    src/app/legacy/containers/ConsentBanner/Banner/cookie.amp.jsx on lines 317..323

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

    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

                <Paragraph script={script}>
                  <StyledLink
                    className="focusIndicatorReducedWidth"
                    href={manage.description.para4.url}
                    text={manage.description.para4.text}
    src/app/legacy/containers/ConsentBanner/Banner/cookie.amp.jsx on lines 327..333

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

    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 Wrapper = styled.div`
      ${({ service }) => getSansRegular(service)}
      background-color: ${props => props.theme.palette.CONSENT_BACKGROUND};
      border: ${BORDER_WIDTH_TRANSPARENT} solid transparent;
    `;
    src/app/legacy/containers/ConsentBanner/Banner/cookie.amp.jsx on lines 57..61
    src/app/legacy/psammead/psammead-consent-banner/src/index.jsx on lines 35..39

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

    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 Title = styled.h2`
      ${({ script }) => getDoublePica(script)}
      color: ${props => props.theme.palette.WHITE};
      ${COMMON_HEADING_STYLES}
    `;
    src/app/legacy/containers/ConsentBanner/Banner/cookie.amp.jsx on lines 46..50
    src/app/legacy/psammead/psammead-consent-banner/src/index.jsx on lines 35..39

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

    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 ContentWrapper = styled.div`
      align-self: center;
      max-height: ${BANNER_MAX_HEIGHT};
      max-width: ${GEL_GROUP_2_SCREEN_WIDTH_MAX};
      overflow-y: auto;
    Severity: Minor
    Found in src/app/legacy/containers/ConsentBanner/Banner/cookie.amp.jsx and 2 other locations - About 35 mins to fix
    src/app/legacy/containers/PodcastPromo/Inline.jsx on lines 42..61
    src/app/lib/analyticsUtils/index.test.js on lines 562..571

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

                  <OptionsItem className="hide" script={script} service={service}>
                    <div>{hide}</div>
                  </OptionsItem>
    Severity: Minor
    Found in src/app/legacy/containers/ConsentBanner/Banner/cookie.amp.jsx and 2 other locations - About 35 mins to fix
    src/app/legacy/containers/ConsentBanner/Banner/cookie.amp.jsx on lines 343..345
    src/app/legacy/psammead/psammead-consent-banner/src/index.jsx on lines 245..247

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

                  <OptionsItem className="hide" script={script} service={service}>
                    <div>{hide}</div>
                  </OptionsItem>
    Severity: Minor
    Found in src/app/legacy/containers/ConsentBanner/Banner/cookie.amp.jsx and 2 other locations - About 35 mins to fix
    src/app/legacy/containers/ConsentBanner/Banner/cookie.amp.jsx on lines 298..300
    src/app/legacy/psammead/psammead-consent-banner/src/index.jsx on lines 245..247

    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

    There are no issues that match your filters.

    Category
    Status