glitch-soc/mastodon

View on GitHub

Showing 4,938 of 4,938 total issues

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

export async function apiRequest<ApiResponse = unknown>(
  method: Method,
  url: string,
  args: {
    params?: RequestParamsOrData;
Severity: Major
Found in app/javascript/flavours/glitch/api.ts and 1 other location - About 3 hrs to fix
app/javascript/mastodon/api.ts on lines 64..79

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

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 isJRDLink = (link: unknown): link is JRDLink =>
  typeof link === 'object' &&
  link !== null &&
  'rel' in link &&
  typeof link.rel === 'string' &&
app/javascript/entrypoints/remote_interaction_helper.ts on lines 21..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 111.

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 handleFollow = useCallback(() => {
    if (!account) return;

    if (
      account.getIn(['relationship', 'following']) ||
app/javascript/mastodon/features/directory/components/account_card.tsx on lines 80..93

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

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 handleFollow = useCallback(() => {
    if (!account) return;

    if (
      account.getIn(['relationship', 'following']) ||
app/javascript/flavours/glitch/features/directory/components/account_card.tsx on lines 80..93

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

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 isJRDLink = (link: unknown): link is JRDLink =>
  typeof link === 'object' &&
  link !== null &&
  'rel' in link &&
  typeof link.rel === 'string' &&
Severity: Major
Found in app/javascript/entrypoints/remote_interaction_helper.ts and 1 other location - About 3 hrs to fix
app/javascript/flavours/glitch/entrypoints/remote_interaction_helper.ts on lines 21..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 111.

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 94 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  render () {
    const { multiColumn, intl, server, extendedDescription, domainBlocks } = this.props;
    const isLoading = server.get('isLoading');

    return (
Severity: Major
Found in app/javascript/mastodon/features/about/index.jsx - About 3 hrs to fix

    File index.jsx has 323 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    import PropTypes from 'prop-types';
    import { PureComponent } from 'react';
    
    import { defineMessages, injectIntl, FormattedMessage } from 'react-intl';
    
    
    Severity: Minor
    Found in app/javascript/flavours/glitch/features/notifications/index.jsx - About 3 hrs to fix

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

        render () {
          const { preview, src, inline, onOpenVideo, onCloseVideo, intl, alt, lang, letterbox, fullwidth, detailed, sensitive, editable, blurhash, autoFocus } = this.props;
          const { currentTime, duration, volume, buffer, dragging, paused, fullscreen, hovered, revealed } = this.state;
          const progress = Math.min((currentTime / duration) * 100, 100);
          const muted = this.state.muted || volume === 0;
      Severity: Minor
      Found in app/javascript/flavours/glitch/features/video/index.jsx - About 3 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

      Method perform has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring.
      Open

        def perform
          return if under_load?
      
          budget = compute_budget
      
      
      Severity: Minor
      Found in app/workers/scheduler/accounts_statuses_cleanup_scheduler.rb - About 3 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 FollowButton has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring.
      Open

      }> = ({ accountId }) => {
        const intl = useIntl();
        const dispatch = useAppDispatch();
        const { signedIn } = useIdentity();
        const account = useAppSelector((state) =>
      Severity: Minor
      Found in app/javascript/mastodon/components/follow_button.tsx - About 3 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

      Identical blocks of code found in 4 locations. Consider refactoring.
      Open

        handleVolumeMouseDown = e => {
          document.addEventListener('mousemove', this.handleMouseVolSlide, true);
          document.addEventListener('mouseup', this.handleVolumeMouseUp, true);
          document.addEventListener('touchmove', this.handleMouseVolSlide, true);
          document.addEventListener('touchend', this.handleVolumeMouseUp, true);
      Severity: Major
      Found in app/javascript/mastodon/features/audio/index.jsx and 3 other locations - About 3 hrs to fix
      app/javascript/flavours/glitch/features/audio/index.jsx on lines 237..247
      app/javascript/flavours/glitch/features/video/index.jsx on lines 209..219
      app/javascript/mastodon/features/video/index.jsx on lines 206..216

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

      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

      Identical blocks of code found in 4 locations. Consider refactoring.
      Open

        handleVolumeMouseDown = e => {
          document.addEventListener('mousemove', this.handleMouseVolSlide, true);
          document.addEventListener('mouseup', this.handleVolumeMouseUp, true);
          document.addEventListener('touchmove', this.handleMouseVolSlide, true);
          document.addEventListener('touchend', this.handleVolumeMouseUp, true);
      Severity: Major
      Found in app/javascript/mastodon/features/video/index.jsx and 3 other locations - About 3 hrs to fix
      app/javascript/flavours/glitch/features/audio/index.jsx on lines 237..247
      app/javascript/flavours/glitch/features/video/index.jsx on lines 209..219
      app/javascript/mastodon/features/audio/index.jsx on lines 231..241

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

      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

      Identical blocks of code found in 4 locations. Consider refactoring.
      Open

        handleVolumeMouseDown = e => {
          document.addEventListener('mousemove', this.handleMouseVolSlide, true);
          document.addEventListener('mouseup', this.handleVolumeMouseUp, true);
          document.addEventListener('touchmove', this.handleMouseVolSlide, true);
          document.addEventListener('touchend', this.handleVolumeMouseUp, true);
      Severity: Major
      Found in app/javascript/flavours/glitch/features/video/index.jsx and 3 other locations - About 3 hrs to fix
      app/javascript/flavours/glitch/features/audio/index.jsx on lines 237..247
      app/javascript/mastodon/features/audio/index.jsx on lines 231..241
      app/javascript/mastodon/features/video/index.jsx on lines 206..216

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

      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

      Identical blocks of code found in 4 locations. Consider refactoring.
      Open

        handleVolumeMouseDown = e => {
          document.addEventListener('mousemove', this.handleMouseVolSlide, true);
          document.addEventListener('mouseup', this.handleVolumeMouseUp, true);
          document.addEventListener('touchmove', this.handleMouseVolSlide, true);
          document.addEventListener('touchend', this.handleVolumeMouseUp, true);
      Severity: Major
      Found in app/javascript/flavours/glitch/features/audio/index.jsx and 3 other locations - About 3 hrs to fix
      app/javascript/flavours/glitch/features/video/index.jsx on lines 209..219
      app/javascript/mastodon/features/audio/index.jsx on lines 231..241
      app/javascript/mastodon/features/video/index.jsx on lines 206..216

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

      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

                  {!columns.some(column => column.get('id') === 'PUBLIC') && (
                    <Link to='/public' className='drawer__tab' title={intl.formatMessage(messages.public)} aria-label={intl.formatMessage(messages.public)}><Icon id='globe' icon={PublicIcon} /></Link>
                  )}
      Severity: Major
      Found in app/javascript/flavours/glitch/features/compose/index.jsx and 6 other locations - About 3 hrs to fix
      app/javascript/flavours/glitch/features/compose/index.jsx on lines 131..133
      app/javascript/flavours/glitch/features/compose/index.jsx on lines 142..144
      app/javascript/mastodon/features/compose/index.jsx on lines 100..102
      app/javascript/mastodon/features/compose/index.jsx on lines 103..105
      app/javascript/mastodon/features/compose/index.jsx on lines 106..108
      app/javascript/mastodon/features/compose/index.jsx on lines 109..111

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

      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

                  {!columns.some(column => column.get('id') === 'COMMUNITY') && (
                    <Link to='/public/local' className='drawer__tab' title={intl.formatMessage(messages.community)} aria-label={intl.formatMessage(messages.community)}><Icon id='users' icon={PeopleIcon} /></Link>
                  )}
      Severity: Major
      Found in app/javascript/mastodon/features/compose/index.jsx and 6 other locations - About 3 hrs to fix
      app/javascript/flavours/glitch/features/compose/index.jsx on lines 131..133
      app/javascript/flavours/glitch/features/compose/index.jsx on lines 142..144
      app/javascript/flavours/glitch/features/compose/index.jsx on lines 145..147
      app/javascript/mastodon/features/compose/index.jsx on lines 100..102
      app/javascript/mastodon/features/compose/index.jsx on lines 103..105
      app/javascript/mastodon/features/compose/index.jsx on lines 109..111

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

      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

                  {!columns.some(column => column.get('id') === 'HOME') && (
                    <Link to='/home' className='drawer__tab' title={intl.formatMessage(messages.home_timeline)} aria-label={intl.formatMessage(messages.home_timeline)}><Icon id='home' icon={HomeIcon} /></Link>
                  )}
      Severity: Major
      Found in app/javascript/mastodon/features/compose/index.jsx and 6 other locations - About 3 hrs to fix
      app/javascript/flavours/glitch/features/compose/index.jsx on lines 131..133
      app/javascript/flavours/glitch/features/compose/index.jsx on lines 142..144
      app/javascript/flavours/glitch/features/compose/index.jsx on lines 145..147
      app/javascript/mastodon/features/compose/index.jsx on lines 103..105
      app/javascript/mastodon/features/compose/index.jsx on lines 106..108
      app/javascript/mastodon/features/compose/index.jsx on lines 109..111

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

      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

                  {!columns.some(column => column.get('id') === 'HOME') && (
                    <Link to='/home' className='drawer__tab' title={intl.formatMessage(messages.home_timeline)} aria-label={intl.formatMessage(messages.home_timeline)}><Icon id='home' icon={HomeIcon} /></Link>
                  )}
      Severity: Major
      Found in app/javascript/flavours/glitch/features/compose/index.jsx and 6 other locations - About 3 hrs to fix
      app/javascript/flavours/glitch/features/compose/index.jsx on lines 142..144
      app/javascript/flavours/glitch/features/compose/index.jsx on lines 145..147
      app/javascript/mastodon/features/compose/index.jsx on lines 100..102
      app/javascript/mastodon/features/compose/index.jsx on lines 103..105
      app/javascript/mastodon/features/compose/index.jsx on lines 106..108
      app/javascript/mastodon/features/compose/index.jsx on lines 109..111

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

      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

                  {!columns.some(column => column.get('id') === 'PUBLIC') && (
                    <Link to='/public' className='drawer__tab' title={intl.formatMessage(messages.public)} aria-label={intl.formatMessage(messages.public)}><Icon id='globe' icon={PublicIcon} /></Link>
                  )}
      Severity: Major
      Found in app/javascript/mastodon/features/compose/index.jsx and 6 other locations - About 3 hrs to fix
      app/javascript/flavours/glitch/features/compose/index.jsx on lines 131..133
      app/javascript/flavours/glitch/features/compose/index.jsx on lines 142..144
      app/javascript/flavours/glitch/features/compose/index.jsx on lines 145..147
      app/javascript/mastodon/features/compose/index.jsx on lines 100..102
      app/javascript/mastodon/features/compose/index.jsx on lines 103..105
      app/javascript/mastodon/features/compose/index.jsx on lines 106..108

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

      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

                  {!columns.some(column => column.get('id') === 'NOTIFICATIONS') && (
                    <Link to='/notifications' className='drawer__tab' title={intl.formatMessage(messages.notifications)} aria-label={intl.formatMessage(messages.notifications)}><Icon id='bell' icon={NotificationsIcon} /></Link>
                  )}
      Severity: Major
      Found in app/javascript/mastodon/features/compose/index.jsx and 6 other locations - About 3 hrs to fix
      app/javascript/flavours/glitch/features/compose/index.jsx on lines 131..133
      app/javascript/flavours/glitch/features/compose/index.jsx on lines 142..144
      app/javascript/flavours/glitch/features/compose/index.jsx on lines 145..147
      app/javascript/mastodon/features/compose/index.jsx on lines 100..102
      app/javascript/mastodon/features/compose/index.jsx on lines 106..108
      app/javascript/mastodon/features/compose/index.jsx on lines 109..111

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

      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