grommet/grommet

View on GitHub
src/js/components/Layer/StyledLayer.js

Summary

Maintainability
F
2 wks
Test Coverage

File StyledLayer.js has 754 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import styled, { css, keyframes } from 'styled-components';

import {
  baseStyle,
  backgroundStyle,
Severity: Major
Found in src/js/components/Layer/StyledLayer.js - About 1 day to fix

    Function roundStyle has 80 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    const roundStyle = (data, theme, position, margin) => {
      const styles = [];
      const size = data === true ? 'medium' : data;
      const round = theme.global.edgeSize[size] || size;
      // if user provides CSS string such as '50px 12px', apply that always
    Severity: Major
    Found in src/js/components/Layer/StyledLayer.js - About 3 hrs to fix

      Function roundStyle has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
      Open

      const roundStyle = (data, theme, position, margin) => {
        const styles = [];
        const size = data === true ? 'medium' : data;
        const round = theme.global.edgeSize[size] || size;
        // if user provides CSS string such as '50px 12px', apply that always
      Severity: Minor
      Found in src/js/components/Layer/StyledLayer.js - About 2 hrs 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 getAnimationStyle has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
      Open

      const getAnimationStyle = (props, position, full) => {
        let animation =
          props.animation !== undefined ? props.animation : props.animate;
        if (animation === undefined) animation = 'slide';
        let keys;
      Severity: Minor
      Found in src/js/components/Layer/StyledLayer.js - About 25 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 2 locations. Consider refactoring.
      Open

        'bottom-right': {
          vertical: (bounds) => css`
            top: ${bounds.top}px;
            bottom: ${bounds.bottom}px;
            right: ${bounds.right}px;
      Severity: Major
      Found in src/js/components/Layer/StyledLayer.js and 1 other location - About 1 day to fix
      src/js/components/Layer/StyledLayer.js on lines 589..618

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

      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

        'bottom-left': {
          vertical: (bounds) => css`
            top: ${bounds.top}px;
            bottom: ${bounds.bottom}px;
            left: ${bounds.left}px;
      Severity: Major
      Found in src/js/components/Layer/StyledLayer.js and 1 other location - About 1 day to fix
      src/js/components/Layer/StyledLayer.js on lines 558..587

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

      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

        'top-right': {
          vertical: (bounds) => css`
            top: ${bounds.top}px;
            bottom: ${bounds.bottom}px;
            right: ${bounds.right}px;
      Severity: Major
      Found in src/js/components/Layer/StyledLayer.js and 1 other location - About 1 day to fix
      src/js/components/Layer/StyledLayer.js on lines 527..556

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

      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

        'top-left': {
          vertical: (bounds) => css`
            top: ${bounds.top}px;
            bottom: ${bounds.bottom}px;
            left: ${bounds.left}px;
      Severity: Major
      Found in src/js/components/Layer/StyledLayer.js and 1 other location - About 1 day to fix
      src/js/components/Layer/StyledLayer.js on lines 496..525

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

      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

        left: {
          vertical: (bounds) => css`
            top: ${bounds.top}px;
            bottom: ${bounds.bottom}px;
            left: ${bounds.left}px;
      Severity: Major
      Found in src/js/components/Layer/StyledLayer.js and 3 other locations - About 1 day to fix
      src/js/components/Layer/StyledLayer.js on lines 403..432
      src/js/components/Layer/StyledLayer.js on lines 434..463
      src/js/components/Layer/StyledLayer.js on lines 465..494

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

      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

        start: {
          vertical: (bounds) => css`
            top: ${bounds.top}px;
            bottom: ${bounds.bottom}px;
            inset-inline-start: ${bounds.start}px;
      Severity: Major
      Found in src/js/components/Layer/StyledLayer.js and 3 other locations - About 1 day to fix
      src/js/components/Layer/StyledLayer.js on lines 372..401
      src/js/components/Layer/StyledLayer.js on lines 403..432
      src/js/components/Layer/StyledLayer.js on lines 465..494

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

      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

        top: {
          vertical: (bounds) => css`
            top: ${bounds.top}px;
            bottom: ${bounds.bottom}px;
            left: 50%;
      Severity: Major
      Found in src/js/components/Layer/StyledLayer.js and 1 other location - About 1 day to fix
      src/js/components/Layer/StyledLayer.js on lines 341..370

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

      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

        end: {
          vertical: (bounds) => css`
            top: ${bounds.top}px;
            bottom: ${bounds.bottom}px;
            inset-inline-end: ${bounds.end}px;
      Severity: Major
      Found in src/js/components/Layer/StyledLayer.js and 3 other locations - About 1 day to fix
      src/js/components/Layer/StyledLayer.js on lines 372..401
      src/js/components/Layer/StyledLayer.js on lines 403..432
      src/js/components/Layer/StyledLayer.js on lines 434..463

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

      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

        bottom: {
          vertical: (bounds) => css`
            top: ${bounds.top}px;
            bottom: ${bounds.bottom}px;
            left: 50%;
      Severity: Major
      Found in src/js/components/Layer/StyledLayer.js and 1 other location - About 1 day to fix
      src/js/components/Layer/StyledLayer.js on lines 310..339

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

      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

        right: {
          vertical: (bounds) => css`
            top: ${bounds.top}px;
            bottom: ${bounds.bottom}px;
            right: ${bounds.right}px;
      Severity: Major
      Found in src/js/components/Layer/StyledLayer.js and 3 other locations - About 1 day to fix
      src/js/components/Layer/StyledLayer.js on lines 372..401
      src/js/components/Layer/StyledLayer.js on lines 434..463
      src/js/components/Layer/StyledLayer.js on lines 465..494

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

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

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

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

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

      Refactorings

      Further Reading

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

        center: {
          vertical: keyframes`
            0% { transform: translateX(-50%) scale(0.8); }
            100% { transform: translateX(-50%) scale(1); }
          `,
      Severity: Major
      Found in src/js/components/Layer/StyledLayer.js and 6 other locations - About 1 hr to fix
      src/js/components/Layer/StyledLayer.js on lines 144..161
      src/js/components/Layer/StyledLayer.js on lines 162..179
      src/js/components/Layer/StyledLayer.js on lines 180..197
      src/js/components/Layer/StyledLayer.js on lines 198..215
      src/js/components/Layer/StyledLayer.js on lines 216..233
      src/js/components/Layer/StyledLayer.js on lines 234..251

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

        bottom: {
          vertical: keyframes`
            0% { transform: translate(-50%, 100%); }
            100% { transform: translate(-50%, 0); }
          `,
      Severity: Major
      Found in src/js/components/Layer/StyledLayer.js and 6 other locations - About 1 hr to fix
      src/js/components/Layer/StyledLayer.js on lines 126..143
      src/js/components/Layer/StyledLayer.js on lines 144..161
      src/js/components/Layer/StyledLayer.js on lines 180..197
      src/js/components/Layer/StyledLayer.js on lines 198..215
      src/js/components/Layer/StyledLayer.js on lines 216..233
      src/js/components/Layer/StyledLayer.js on lines 234..251

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

        start: {
          vertical: keyframes`
            0% { transform: translateX(-100%); }
            100% { transform: translateX(0); }
          `,
      Severity: Major
      Found in src/js/components/Layer/StyledLayer.js and 6 other locations - About 1 hr to fix
      src/js/components/Layer/StyledLayer.js on lines 126..143
      src/js/components/Layer/StyledLayer.js on lines 144..161
      src/js/components/Layer/StyledLayer.js on lines 162..179
      src/js/components/Layer/StyledLayer.js on lines 180..197
      src/js/components/Layer/StyledLayer.js on lines 198..215
      src/js/components/Layer/StyledLayer.js on lines 234..251

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

        top: {
          vertical: keyframes`
            0% { transform: translate(-50%, -100%); }
            100% { transform: translate(-50%, 0); }
          `,
      Severity: Major
      Found in src/js/components/Layer/StyledLayer.js and 6 other locations - About 1 hr to fix
      src/js/components/Layer/StyledLayer.js on lines 126..143
      src/js/components/Layer/StyledLayer.js on lines 162..179
      src/js/components/Layer/StyledLayer.js on lines 180..197
      src/js/components/Layer/StyledLayer.js on lines 198..215
      src/js/components/Layer/StyledLayer.js on lines 216..233
      src/js/components/Layer/StyledLayer.js on lines 234..251

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

        left: {
          vertical: keyframes`
            0% { transform: translateX(-100%); }
            100% { transform: translateX(0); }
          `,
      Severity: Major
      Found in src/js/components/Layer/StyledLayer.js and 6 other locations - About 1 hr to fix
      src/js/components/Layer/StyledLayer.js on lines 126..143
      src/js/components/Layer/StyledLayer.js on lines 144..161
      src/js/components/Layer/StyledLayer.js on lines 162..179
      src/js/components/Layer/StyledLayer.js on lines 198..215
      src/js/components/Layer/StyledLayer.js on lines 216..233
      src/js/components/Layer/StyledLayer.js on lines 234..251

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

        right: {
          vertical: keyframes`
            0% { transform: translateX(100%); }
            100% { transform: translateX(0); }
          `,
      Severity: Major
      Found in src/js/components/Layer/StyledLayer.js and 6 other locations - About 1 hr to fix
      src/js/components/Layer/StyledLayer.js on lines 126..143
      src/js/components/Layer/StyledLayer.js on lines 144..161
      src/js/components/Layer/StyledLayer.js on lines 162..179
      src/js/components/Layer/StyledLayer.js on lines 180..197
      src/js/components/Layer/StyledLayer.js on lines 216..233
      src/js/components/Layer/StyledLayer.js on lines 234..251

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

        end: {
          vertical: keyframes`
            0% { transform: translateX(100%); }
            100% { transform: translateX(0); }
          `,
      Severity: Major
      Found in src/js/components/Layer/StyledLayer.js and 6 other locations - About 1 hr to fix
      src/js/components/Layer/StyledLayer.js on lines 126..143
      src/js/components/Layer/StyledLayer.js on lines 144..161
      src/js/components/Layer/StyledLayer.js on lines 162..179
      src/js/components/Layer/StyledLayer.js on lines 180..197
      src/js/components/Layer/StyledLayer.js on lines 198..215
      src/js/components/Layer/StyledLayer.js on lines 216..233

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

        ${(props) =>
          props.theme.layer.overlay.backdropFilter &&
          `backdrop-filter: ${props.theme.layer.overlay.backdropFilter};`}
      Severity: Minor
      Found in src/js/components/Layer/StyledLayer.js and 1 other location - About 45 mins to fix
      src/js/utils/styles.js on lines 13..17

      Duplicated Code

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

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

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

      Tuning

      This issue has a mass of 50.

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

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

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

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

      Refactorings

      Further Reading

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

        max-width: ${(props) =>
          `calc(100% - ${getBounds(
            bounds,
            props.margin,
            props.theme,
      Severity: Minor
      Found in src/js/components/Layer/StyledLayer.js and 1 other location - About 40 mins to fix
      src/js/components/Layer/StyledLayer.js on lines 726..732

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

      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

        max-height: ${(props) =>
          `calc(100% - ${getBounds(
            bounds,
            props.margin,
            props.theme,
      Severity: Minor
      Found in src/js/components/Layer/StyledLayer.js and 1 other location - About 40 mins to fix
      src/js/components/Layer/StyledLayer.js on lines 733..739

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

      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

      const StyledContainer = styled.div.withConfig({
        // don't let elevation leak to DOM
        // https://styled-components.com/docs/api#shouldforwardprop
        shouldForwardProp: (prop, defaultValidatorFn) =>
          !['elevation'].includes(prop) && defaultValidatorFn(prop),
      Severity: Minor
      Found in src/js/components/Layer/StyledLayer.js and 1 other location - About 40 mins to fix
      src/js/components/Button/StyledButtonKind.js on lines 253..320

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

      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