bufferapp/ui

View on GitHub

Showing 333 of 333 total issues

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

const ArrowRightIcon = createIconComponent({
  content: (
    <g>
      <path d="M7 4.197a1 1 0 011.657-.755l4.483 3.904a1 1 0 01-.014 1.521l-4.484 3.757A1 1 0 017 11.857v-7.66z" />
      <path d="M7 9V7H3a1 1 0 100 2h4z" />
Severity: Major
Found in src/components/Icon/Icons/ArrowRight.tsx and 10 other locations - About 1 hr to fix
src/components/Icon/Icons/AppleMusic.tsx on lines 8..15
src/components/Icon/Icons/ArrowDown.tsx on lines 8..15
src/components/Icon/Icons/ArrowUp.tsx on lines 8..15
src/components/Icon/Icons/Audience.tsx on lines 8..15
src/components/Icon/Icons/Carousel.tsx on lines 8..15
src/components/Icon/Icons/Clubhouse.tsx on lines 8..15
src/components/Icon/Icons/Google.tsx on lines 8..15
src/components/Icon/Icons/Mail.tsx on lines 8..15
src/components/Icon/Icons/OpenNew.tsx on lines 8..15
src/components/Icon/Icons/Swap.tsx on lines 8..15

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

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

Function getStyleLoaders has 26 lines of code (exceeds 25 allowed). Consider refactoring.
Open

const getStyleLoaders = (cssOptions, preProcessor) => {
  const loaders = [
    require.resolve('style-loader'),
    {
      loader: require.resolve('css-loader'),
Severity: Minor
Found in scripts/config/webpack.config.dev.js - About 1 hr to fix

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

    export default function ExampleTooltip() {
      return (
        <Tooltip label="My Tooltip Label with multiple lines. Adding up an example here with a long tooltip text.">
          <Avatar
            src="https://s3.amazonaws.com/buffer-ui/Default+Avatar.png"
    Severity: Major
    Found in src/documentation/examples/Tooltip/option/multiline.tsx and 1 other location - About 1 hr to fix
    src/documentation/examples/Tooltip/visibility/visible.tsx on lines 8..18

    Duplicated Code

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

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

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

    Tuning

    This issue has a mass of 55.

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

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

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

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

    Refactorings

    Further Reading

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

      const tree = renderer
        .create(
          // @ts-expect-error TS(2740) FIXME: Type '{ type: string; onClick: () => void; label: ... Remove this comment to see the full error message
          <Button type="primary" onClick={() => {}} label="Primary" disabled />,
        )
    Severity: Major
    Found in src/components/Button/Button.spec.tsx and 1 other location - About 1 hr to fix
    src/components/Button/Button.spec.tsx on lines 33..38

    Duplicated Code

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

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

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

    Tuning

    This issue has a mass of 55.

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

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

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

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

    Refactorings

    Further Reading

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

      const tree = renderer
        .create(
          // @ts-expect-error TS(2740) FIXME: Type '{ type: string; onClick: () => void; label: ... Remove this comment to see the full error message
          <Button type="primary" onClick={() => {}} label="Primary" loading />,
        )
    Severity: Major
    Found in src/components/Button/Button.spec.tsx and 1 other location - About 1 hr to fix
    src/components/Button/Button.spec.tsx on lines 22..27

    Duplicated Code

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

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

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

    Tuning

    This issue has a mass of 55.

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

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

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

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

    Refactorings

    Further Reading

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

    export default function ExampleTooltip() {
      return (
        <Tooltip label="Visible tooltip">
          <Avatar
            src="https://s3.amazonaws.com/buffer-ui/Default+Avatar.png"
    Severity: Major
    Found in src/documentation/examples/Tooltip/visibility/visible.tsx and 1 other location - About 1 hr to fix
    src/documentation/examples/Tooltip/option/multiline.tsx on lines 8..18

    Duplicated Code

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

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

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

    Tuning

    This issue has a mass of 55.

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

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

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

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

    Refactorings

    Further Reading

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

        case 'facebook':
          // @ts-expect-error TS(2339) FIXME: Property 'Icon' does not exist on type '{}'.
          content.Icon = <Facebook />
          // @ts-expect-error TS(2339) FIXME: Property 'name' does not exist on type '{}'.
          content.name = 'Facebook'
    Severity: Major
    Found in src/components/SocialButton/SocialButton.tsx and 4 other locations - About 55 mins to fix
    src/components/SocialButton/SocialButton.tsx on lines 12..19
    src/components/SocialButton/SocialButton.tsx on lines 20..27
    src/components/SocialButton/SocialButton.tsx on lines 36..43
    src/components/SocialButton/SocialButton.tsx on lines 44..51

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

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

        case 'linkedin':
          // @ts-expect-error TS(2339) FIXME: Property 'Icon' does not exist on type '{}'.
          content.Icon = <LinkedIn />
          // @ts-expect-error TS(2339) FIXME: Property 'name' does not exist on type '{}'.
          content.name = 'LinkedIn'
    Severity: Major
    Found in src/components/SocialButton/SocialButton.tsx and 4 other locations - About 55 mins to fix
    src/components/SocialButton/SocialButton.tsx on lines 12..19
    src/components/SocialButton/SocialButton.tsx on lines 20..27
    src/components/SocialButton/SocialButton.tsx on lines 28..35
    src/components/SocialButton/SocialButton.tsx on lines 36..43

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

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

        case 'pinterest':
          // @ts-expect-error TS(2339) FIXME: Property 'Icon' does not exist on type '{}'.
          content.Icon = <Pinterest />
          // @ts-expect-error TS(2339) FIXME: Property 'name' does not exist on type '{}'.
          content.name = 'Pinterest'
    Severity: Major
    Found in src/components/SocialButton/SocialButton.tsx and 4 other locations - About 55 mins to fix
    src/components/SocialButton/SocialButton.tsx on lines 12..19
    src/components/SocialButton/SocialButton.tsx on lines 20..27
    src/components/SocialButton/SocialButton.tsx on lines 28..35
    src/components/SocialButton/SocialButton.tsx on lines 44..51

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

    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

      componentDidMount() {
        // @ts-expect-error TS(2339) FIXME: Property 'itemsNode' does not exist on type 'Dropd... Remove this comment to see the full error message
        this.itemsNode.addEventListener('keydown', this.handleKeydown)
        // @ts-expect-error TS(2339) FIXME: Property 'itemsNode' does not exist on type 'Dropd... Remove this comment to see the full error message
        this.itemsNode.addEventListener('mousedown', this.handleMousedown)
    Severity: Major
    Found in src/components/DropdownMenu/DropdownMenu.tsx and 2 other locations - About 55 mins to fix
    src/components/DropdownMenu/ButtonItem/ButtonItem.tsx on lines 37..42
    src/components/DropdownMenu/DropdownMenu.tsx on lines 33..38

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

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

        case 'instagram':
          // @ts-expect-error TS(2339) FIXME: Property 'Icon' does not exist on type '{}'.
          content.Icon = <Instagram />
          // @ts-expect-error TS(2339) FIXME: Property 'name' does not exist on type '{}'.
          content.name = 'Instagram'
    Severity: Major
    Found in src/components/SocialButton/SocialButton.tsx and 4 other locations - About 55 mins to fix
    src/components/SocialButton/SocialButton.tsx on lines 20..27
    src/components/SocialButton/SocialButton.tsx on lines 28..35
    src/components/SocialButton/SocialButton.tsx on lines 36..43
    src/components/SocialButton/SocialButton.tsx on lines 44..51

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

    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

      componentWillUnmount() {
        // @ts-expect-error TS(2339) FIXME: Property 'itemsNode' does not exist on type 'Dropd... Remove this comment to see the full error message
        this.itemsNode.removeEventListener('keydown', this.handleKeydown)
        // @ts-expect-error TS(2339) FIXME: Property 'itemsNode' does not exist on type 'Dropd... Remove this comment to see the full error message
        this.itemsNode.removeEventListener('mousedown', this.handleMousedown)
    Severity: Major
    Found in src/components/DropdownMenu/DropdownMenu.tsx and 2 other locations - About 55 mins to fix
    src/components/DropdownMenu/ButtonItem/ButtonItem.tsx on lines 37..42
    src/components/DropdownMenu/DropdownMenu.tsx on lines 26..31

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

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

        case 'twitter':
          // @ts-expect-error TS(2339) FIXME: Property 'Icon' does not exist on type '{}'.
          content.Icon = <Twitter />
          // @ts-expect-error TS(2339) FIXME: Property 'name' does not exist on type '{}'.
          content.name = 'Twitter'
    Severity: Major
    Found in src/components/SocialButton/SocialButton.tsx and 4 other locations - About 55 mins to fix
    src/components/SocialButton/SocialButton.tsx on lines 12..19
    src/components/SocialButton/SocialButton.tsx on lines 28..35
    src/components/SocialButton/SocialButton.tsx on lines 36..43
    src/components/SocialButton/SocialButton.tsx on lines 44..51

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

    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

      componentWillUnmount() {
        // @ts-expect-error TS(2339) FIXME: Property 'item' does not exist on type 'ButtonItem... Remove this comment to see the full error message
        this.item.removeEventListener('click', this.handleClick)
        // @ts-expect-error TS(2339) FIXME: Property 'item' does not exist on type 'ButtonItem... Remove this comment to see the full error message
        this.item.removeEventListener('keydown', this.handleKeydown)
    Severity: Major
    Found in src/components/DropdownMenu/ButtonItem/ButtonItem.tsx and 2 other locations - About 55 mins to fix
    src/components/DropdownMenu/DropdownMenu.tsx on lines 26..31
    src/components/DropdownMenu/DropdownMenu.tsx on lines 33..38

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

    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

    Function render has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
    Open

      render() {
        const {
          // @ts-expect-error TS(2339) FIXME: Property 'match' does not exist on type 'Readonly<... Remove this comment to see the full error message
          match: {
            params: { route, location, view },
    Severity: Minor
    Found in src/documentation/app/AppContainer.tsx - About 55 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 Button has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
    Open

    const Button = ({
      // @ts-expect-error TS(7031) FIXME: Binding element 'disabled' implicitly has an 'any'... Remove this comment to see the full error message
      disabled,
      // @ts-expect-error TS(7031) FIXME: Binding element 'onClick' implicitly has an 'any' ... Remove this comment to see the full error message
      onClick,
    Severity: Minor
    Found in src/components/Button/Button.tsx - About 55 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 onKeyDown has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
    Open

      onKeyDown(event) {
        // eslint-disable-line
        const {
          // @ts-expect-error TS(2339) FIXME: Property 'history' does not exist on type 'Readonl... Remove this comment to see the full error message
          history,
    Severity: Minor
    Found in src/documentation/app/AppContainer.tsx - About 55 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 80 locations. Consider refactoring.
    Open

    const WhatsappIcon = createIconComponent({
      content: (
        <g>
          <path
            fillRule="evenodd"
    Severity: Major
    Found in src/components/Icon/Icons/Whatsapp.tsx and 79 other locations - About 55 mins to fix
    src/components/Icon/Icons/Appearance.tsx on lines 8..18
    src/components/Icon/Icons/Attach.tsx on lines 8..18
    src/components/Icon/Icons/BookmarkFilled.tsx on lines 8..18
    src/components/Icon/Icons/BookmarkOutline.tsx on lines 8..18
    src/components/Icon/Icons/Building.tsx on lines 8..18
    src/components/Icon/Icons/ButtonLink.tsx on lines 8..18
    src/components/Icon/Icons/Calendar.tsx on lines 8..18
    src/components/Icon/Icons/CalendarAdd.tsx on lines 8..18
    src/components/Icon/Icons/Canva.tsx on lines 8..18
    src/components/Icon/Icons/Caption.tsx on lines 8..18
    src/components/Icon/Icons/Card.tsx on lines 8..18
    src/components/Icon/Icons/CaretDown.tsx on lines 8..18
    src/components/Icon/Icons/CaretLeft.tsx on lines 8..18
    src/components/Icon/Icons/CaretRight.tsx on lines 8..18
    src/components/Icon/Icons/CaretUp.tsx on lines 8..18
    src/components/Icon/Icons/ChartLine.tsx on lines 8..18
    src/components/Icon/Icons/ChevronDown.tsx on lines 8..18
    src/components/Icon/Icons/ChevronUp.tsx on lines 8..18
    src/components/Icon/Icons/CommentRoundOutline.tsx on lines 8..18
    src/components/Icon/Icons/Copy.tsx on lines 8..18
    src/components/Icon/Icons/Coupon.tsx on lines 8..18
    src/components/Icon/Icons/Discord.tsx on lines 8..18
    src/components/Icon/Icons/Dollar.tsx on lines 8..18
    src/components/Icon/Icons/Drafts.tsx on lines 8..18
    src/components/Icon/Icons/Feed.tsx on lines 8..18
    src/components/Icon/Icons/Frequency.tsx on lines 8..18
    src/components/Icon/Icons/Gear.tsx on lines 8..18
    src/components/Icon/Icons/Giphy.tsx on lines 8..18
    src/components/Icon/Icons/Github.tsx on lines 8..18
    src/components/Icon/Icons/GoogleDrive.tsx on lines 8..18
    src/components/Icon/Icons/Hashtag.tsx on lines 8..18
    src/components/Icon/Icons/HeartFilled.tsx on lines 8..18
    src/components/Icon/Icons/HeartOutline.tsx on lines 8..18
    src/components/Icon/Icons/Image.tsx on lines 8..18
    src/components/Icon/Icons/Inbox.tsx on lines 8..18
    src/components/Icon/Icons/Info.tsx on lines 8..18
    src/components/Icon/Icons/InstagramDm.tsx on lines 8..18
    src/components/Icon/Icons/InstagramGrid.tsx on lines 8..18
    src/components/Icon/Icons/InstagramLike.tsx on lines 8..18
    src/components/Icon/Icons/Layout.tsx on lines 8..18
    src/components/Icon/Icons/LinkedIn.tsx on lines 8..18
    src/components/Icon/Icons/Location.tsx on lines 8..18
    src/components/Icon/Icons/Locked.tsx on lines 8..18
    src/components/Icon/Icons/MessageOutline.tsx on lines 8..18
    src/components/Icon/Icons/MessageRoundOutline.tsx on lines 8..18
    src/components/Icon/Icons/MessageSquareOutline.tsx on lines 8..18
    src/components/Icon/Icons/Messenger.tsx on lines 8..18
    src/components/Icon/Icons/PercentageDown.tsx on lines 8..18
    src/components/Icon/Icons/PercentageUp.tsx on lines 8..18
    src/components/Icon/Icons/Phone.tsx on lines 8..18
    src/components/Icon/Icons/PlayRound.tsx on lines 8..18
    src/components/Icon/Icons/Plus.tsx on lines 8..18
    src/components/Icon/Icons/Post.tsx on lines 8..18
    src/components/Icon/Icons/Publish.tsx on lines 8..18
    src/components/Icon/Icons/Retweet.tsx on lines 8..18
    src/components/Icon/Icons/Save.tsx on lines 8..18
    src/components/Icon/Icons/ShareArrowOutline.tsx on lines 8..18
    src/components/Icon/Icons/Sms.tsx on lines 8..18
    src/components/Icon/Icons/Spam.tsx on lines 8..18
    src/components/Icon/Icons/StartPage.tsx on lines 8..18
    src/components/Icon/Icons/Stats.tsx on lines 8..18
    src/components/Icon/Icons/Subheading.tsx on lines 8..18
    src/components/Icon/Icons/Tag.tsx on lines 8..18
    src/components/Icon/Icons/TextAlignCenter.tsx on lines 8..18
    src/components/Icon/Icons/TextAlignLeft.tsx on lines 8..18
    src/components/Icon/Icons/TextAlignRight.tsx on lines 8..18
    src/components/Icon/Icons/TextBold.tsx on lines 8..18
    src/components/Icon/Icons/TextExpand.tsx on lines 8..18
    src/components/Icon/Icons/TextSummarize.tsx on lines 8..18
    src/components/Icon/Icons/TextUnderline.tsx on lines 8..18
    src/components/Icon/Icons/Thread.tsx on lines 8..18
    src/components/Icon/Icons/Tiktok.tsx on lines 8..18
    src/components/Icon/Icons/Title.tsx on lines 8..18
    src/components/Icon/Icons/Twitter.tsx on lines 8..18
    src/components/Icon/Icons/Unlocked.tsx on lines 8..18
    src/components/Icon/Icons/Video.tsx on lines 8..18
    src/components/Icon/Icons/Warning.tsx on lines 8..18
    src/components/Icon/Icons/Website.tsx on lines 8..18
    src/components/Icon/Icons/Youtube.tsx on lines 8..18

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

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

    const TitleIcon = createIconComponent({
      content: (
        <g>
          <path
            fillRule="evenodd"
    Severity: Major
    Found in src/components/Icon/Icons/Title.tsx and 79 other locations - About 55 mins to fix
    src/components/Icon/Icons/Appearance.tsx on lines 8..18
    src/components/Icon/Icons/Attach.tsx on lines 8..18
    src/components/Icon/Icons/BookmarkFilled.tsx on lines 8..18
    src/components/Icon/Icons/BookmarkOutline.tsx on lines 8..18
    src/components/Icon/Icons/Building.tsx on lines 8..18
    src/components/Icon/Icons/ButtonLink.tsx on lines 8..18
    src/components/Icon/Icons/Calendar.tsx on lines 8..18
    src/components/Icon/Icons/CalendarAdd.tsx on lines 8..18
    src/components/Icon/Icons/Canva.tsx on lines 8..18
    src/components/Icon/Icons/Caption.tsx on lines 8..18
    src/components/Icon/Icons/Card.tsx on lines 8..18
    src/components/Icon/Icons/CaretDown.tsx on lines 8..18
    src/components/Icon/Icons/CaretLeft.tsx on lines 8..18
    src/components/Icon/Icons/CaretRight.tsx on lines 8..18
    src/components/Icon/Icons/CaretUp.tsx on lines 8..18
    src/components/Icon/Icons/ChartLine.tsx on lines 8..18
    src/components/Icon/Icons/ChevronDown.tsx on lines 8..18
    src/components/Icon/Icons/ChevronUp.tsx on lines 8..18
    src/components/Icon/Icons/CommentRoundOutline.tsx on lines 8..18
    src/components/Icon/Icons/Copy.tsx on lines 8..18
    src/components/Icon/Icons/Coupon.tsx on lines 8..18
    src/components/Icon/Icons/Discord.tsx on lines 8..18
    src/components/Icon/Icons/Dollar.tsx on lines 8..18
    src/components/Icon/Icons/Drafts.tsx on lines 8..18
    src/components/Icon/Icons/Feed.tsx on lines 8..18
    src/components/Icon/Icons/Frequency.tsx on lines 8..18
    src/components/Icon/Icons/Gear.tsx on lines 8..18
    src/components/Icon/Icons/Giphy.tsx on lines 8..18
    src/components/Icon/Icons/Github.tsx on lines 8..18
    src/components/Icon/Icons/GoogleDrive.tsx on lines 8..18
    src/components/Icon/Icons/Hashtag.tsx on lines 8..18
    src/components/Icon/Icons/HeartFilled.tsx on lines 8..18
    src/components/Icon/Icons/HeartOutline.tsx on lines 8..18
    src/components/Icon/Icons/Image.tsx on lines 8..18
    src/components/Icon/Icons/Inbox.tsx on lines 8..18
    src/components/Icon/Icons/Info.tsx on lines 8..18
    src/components/Icon/Icons/InstagramDm.tsx on lines 8..18
    src/components/Icon/Icons/InstagramGrid.tsx on lines 8..18
    src/components/Icon/Icons/InstagramLike.tsx on lines 8..18
    src/components/Icon/Icons/Layout.tsx on lines 8..18
    src/components/Icon/Icons/LinkedIn.tsx on lines 8..18
    src/components/Icon/Icons/Location.tsx on lines 8..18
    src/components/Icon/Icons/Locked.tsx on lines 8..18
    src/components/Icon/Icons/MessageOutline.tsx on lines 8..18
    src/components/Icon/Icons/MessageRoundOutline.tsx on lines 8..18
    src/components/Icon/Icons/MessageSquareOutline.tsx on lines 8..18
    src/components/Icon/Icons/Messenger.tsx on lines 8..18
    src/components/Icon/Icons/PercentageDown.tsx on lines 8..18
    src/components/Icon/Icons/PercentageUp.tsx on lines 8..18
    src/components/Icon/Icons/Phone.tsx on lines 8..18
    src/components/Icon/Icons/PlayRound.tsx on lines 8..18
    src/components/Icon/Icons/Plus.tsx on lines 8..18
    src/components/Icon/Icons/Post.tsx on lines 8..18
    src/components/Icon/Icons/Publish.tsx on lines 8..18
    src/components/Icon/Icons/Retweet.tsx on lines 8..18
    src/components/Icon/Icons/Save.tsx on lines 8..18
    src/components/Icon/Icons/ShareArrowOutline.tsx on lines 8..18
    src/components/Icon/Icons/Sms.tsx on lines 8..18
    src/components/Icon/Icons/Spam.tsx on lines 8..18
    src/components/Icon/Icons/StartPage.tsx on lines 8..18
    src/components/Icon/Icons/Stats.tsx on lines 8..18
    src/components/Icon/Icons/Subheading.tsx on lines 8..18
    src/components/Icon/Icons/Tag.tsx on lines 8..18
    src/components/Icon/Icons/TextAlignCenter.tsx on lines 8..18
    src/components/Icon/Icons/TextAlignLeft.tsx on lines 8..18
    src/components/Icon/Icons/TextAlignRight.tsx on lines 8..18
    src/components/Icon/Icons/TextBold.tsx on lines 8..18
    src/components/Icon/Icons/TextExpand.tsx on lines 8..18
    src/components/Icon/Icons/TextSummarize.tsx on lines 8..18
    src/components/Icon/Icons/TextUnderline.tsx on lines 8..18
    src/components/Icon/Icons/Thread.tsx on lines 8..18
    src/components/Icon/Icons/Tiktok.tsx on lines 8..18
    src/components/Icon/Icons/Twitter.tsx on lines 8..18
    src/components/Icon/Icons/Unlocked.tsx on lines 8..18
    src/components/Icon/Icons/Video.tsx on lines 8..18
    src/components/Icon/Icons/Warning.tsx on lines 8..18
    src/components/Icon/Icons/Website.tsx on lines 8..18
    src/components/Icon/Icons/Whatsapp.tsx on lines 8..18
    src/components/Icon/Icons/Youtube.tsx on lines 8..18

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

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

    const VideoIcon = createIconComponent({
      content: (
        <g>
          <path
            fillRule="evenodd"
    Severity: Major
    Found in src/components/Icon/Icons/Video.tsx and 79 other locations - About 55 mins to fix
    src/components/Icon/Icons/Appearance.tsx on lines 8..18
    src/components/Icon/Icons/Attach.tsx on lines 8..18
    src/components/Icon/Icons/BookmarkFilled.tsx on lines 8..18
    src/components/Icon/Icons/BookmarkOutline.tsx on lines 8..18
    src/components/Icon/Icons/Building.tsx on lines 8..18
    src/components/Icon/Icons/ButtonLink.tsx on lines 8..18
    src/components/Icon/Icons/Calendar.tsx on lines 8..18
    src/components/Icon/Icons/CalendarAdd.tsx on lines 8..18
    src/components/Icon/Icons/Canva.tsx on lines 8..18
    src/components/Icon/Icons/Caption.tsx on lines 8..18
    src/components/Icon/Icons/Card.tsx on lines 8..18
    src/components/Icon/Icons/CaretDown.tsx on lines 8..18
    src/components/Icon/Icons/CaretLeft.tsx on lines 8..18
    src/components/Icon/Icons/CaretRight.tsx on lines 8..18
    src/components/Icon/Icons/CaretUp.tsx on lines 8..18
    src/components/Icon/Icons/ChartLine.tsx on lines 8..18
    src/components/Icon/Icons/ChevronDown.tsx on lines 8..18
    src/components/Icon/Icons/ChevronUp.tsx on lines 8..18
    src/components/Icon/Icons/CommentRoundOutline.tsx on lines 8..18
    src/components/Icon/Icons/Copy.tsx on lines 8..18
    src/components/Icon/Icons/Coupon.tsx on lines 8..18
    src/components/Icon/Icons/Discord.tsx on lines 8..18
    src/components/Icon/Icons/Dollar.tsx on lines 8..18
    src/components/Icon/Icons/Drafts.tsx on lines 8..18
    src/components/Icon/Icons/Feed.tsx on lines 8..18
    src/components/Icon/Icons/Frequency.tsx on lines 8..18
    src/components/Icon/Icons/Gear.tsx on lines 8..18
    src/components/Icon/Icons/Giphy.tsx on lines 8..18
    src/components/Icon/Icons/Github.tsx on lines 8..18
    src/components/Icon/Icons/GoogleDrive.tsx on lines 8..18
    src/components/Icon/Icons/Hashtag.tsx on lines 8..18
    src/components/Icon/Icons/HeartFilled.tsx on lines 8..18
    src/components/Icon/Icons/HeartOutline.tsx on lines 8..18
    src/components/Icon/Icons/Image.tsx on lines 8..18
    src/components/Icon/Icons/Inbox.tsx on lines 8..18
    src/components/Icon/Icons/Info.tsx on lines 8..18
    src/components/Icon/Icons/InstagramDm.tsx on lines 8..18
    src/components/Icon/Icons/InstagramGrid.tsx on lines 8..18
    src/components/Icon/Icons/InstagramLike.tsx on lines 8..18
    src/components/Icon/Icons/Layout.tsx on lines 8..18
    src/components/Icon/Icons/LinkedIn.tsx on lines 8..18
    src/components/Icon/Icons/Location.tsx on lines 8..18
    src/components/Icon/Icons/Locked.tsx on lines 8..18
    src/components/Icon/Icons/MessageOutline.tsx on lines 8..18
    src/components/Icon/Icons/MessageRoundOutline.tsx on lines 8..18
    src/components/Icon/Icons/MessageSquareOutline.tsx on lines 8..18
    src/components/Icon/Icons/Messenger.tsx on lines 8..18
    src/components/Icon/Icons/PercentageDown.tsx on lines 8..18
    src/components/Icon/Icons/PercentageUp.tsx on lines 8..18
    src/components/Icon/Icons/Phone.tsx on lines 8..18
    src/components/Icon/Icons/PlayRound.tsx on lines 8..18
    src/components/Icon/Icons/Plus.tsx on lines 8..18
    src/components/Icon/Icons/Post.tsx on lines 8..18
    src/components/Icon/Icons/Publish.tsx on lines 8..18
    src/components/Icon/Icons/Retweet.tsx on lines 8..18
    src/components/Icon/Icons/Save.tsx on lines 8..18
    src/components/Icon/Icons/ShareArrowOutline.tsx on lines 8..18
    src/components/Icon/Icons/Sms.tsx on lines 8..18
    src/components/Icon/Icons/Spam.tsx on lines 8..18
    src/components/Icon/Icons/StartPage.tsx on lines 8..18
    src/components/Icon/Icons/Stats.tsx on lines 8..18
    src/components/Icon/Icons/Subheading.tsx on lines 8..18
    src/components/Icon/Icons/Tag.tsx on lines 8..18
    src/components/Icon/Icons/TextAlignCenter.tsx on lines 8..18
    src/components/Icon/Icons/TextAlignLeft.tsx on lines 8..18
    src/components/Icon/Icons/TextAlignRight.tsx on lines 8..18
    src/components/Icon/Icons/TextBold.tsx on lines 8..18
    src/components/Icon/Icons/TextExpand.tsx on lines 8..18
    src/components/Icon/Icons/TextSummarize.tsx on lines 8..18
    src/components/Icon/Icons/TextUnderline.tsx on lines 8..18
    src/components/Icon/Icons/Thread.tsx on lines 8..18
    src/components/Icon/Icons/Tiktok.tsx on lines 8..18
    src/components/Icon/Icons/Title.tsx on lines 8..18
    src/components/Icon/Icons/Twitter.tsx on lines 8..18
    src/components/Icon/Icons/Unlocked.tsx on lines 8..18
    src/components/Icon/Icons/Warning.tsx on lines 8..18
    src/components/Icon/Icons/Website.tsx on lines 8..18
    src/components/Icon/Icons/Whatsapp.tsx on lines 8..18
    src/components/Icon/Icons/Youtube.tsx on lines 8..18

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

    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