glitch-soc/mastodon

View on GitHub

Showing 4,903 of 4,903 total issues

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

export const afterInitialRender = (callback: Callback) => {
  if (renderSignalReceived) {
    callback();
  } else {
    onInitialRender = callback;
Severity: Minor
Found in app/javascript/flavours/glitch/hooks/useRenderSignal.ts and 1 other location - About 35 mins to fix
app/javascript/hooks/useRenderSignal.ts on lines 10..16

Duplicated Code

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

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

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

Tuning

This issue has a mass of 46.

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

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

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

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

Refactorings

Further Reading

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

const labelRenderer: LabelRenderer = (displayedName) => (
  <FormattedMessage
    id='notification.status'
    defaultMessage='{name} just posted'
    values={{ name: displayedName }}
app/javascript/flavours/glitch/features/notifications_v2/components/notification_update.tsx on lines 9..15
app/javascript/mastodon/features/notifications_v2/components/notification_status.tsx on lines 9..15
app/javascript/mastodon/features/notifications_v2/components/notification_update.tsx on lines 9..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 46.

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

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

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

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

Refactorings

Further Reading

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

const labelRenderer: LabelRenderer = (displayedName) => (
  <FormattedMessage
    id='notification.update'
    defaultMessage='{name} edited a post'
    values={{ name: displayedName }}
app/javascript/flavours/glitch/features/notifications_v2/components/notification_status.tsx on lines 9..15
app/javascript/flavours/glitch/features/notifications_v2/components/notification_update.tsx on lines 9..15
app/javascript/mastodon/features/notifications_v2/components/notification_status.tsx on lines 9..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 46.

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

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

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

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

Refactorings

Further Reading

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

export const CustomEmojiFactory = Record<CustomEmojiShape>({
  shortcode: '',
  static_url: '',
  url: '',
  category: '',
Severity: Minor
Found in app/javascript/mastodon/models/custom_emoji.ts and 1 other location - About 35 mins to fix
app/javascript/flavours/glitch/models/custom_emoji.ts on lines 9..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 46.

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

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

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

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

Refactorings

Further Reading

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

export const apiGetAccounts = (listId: string) =>
  apiRequestGet<ApiAccountJSON[]>(`v1/lists/${listId}/accounts`, {
    limit: 0,
  });
Severity: Minor
Found in app/javascript/mastodon/api/lists.ts and 1 other location - About 35 mins to fix
app/javascript/flavours/glitch/api/lists.ts on lines 16..19

Duplicated Code

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

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

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

Tuning

This issue has a mass of 46.

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

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

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

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

Refactorings

Further Reading

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

const labelRenderer: LabelRenderer = (displayedName) => (
  <FormattedMessage
    id='notification.update'
    defaultMessage='{name} edited a post'
    values={{ name: displayedName }}
app/javascript/flavours/glitch/features/notifications_v2/components/notification_status.tsx on lines 9..15
app/javascript/mastodon/features/notifications_v2/components/notification_status.tsx on lines 9..15
app/javascript/mastodon/features/notifications_v2/components/notification_update.tsx on lines 9..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 46.

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

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

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

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

Refactorings

Further Reading

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

  const onChange = useCallback(
    (key: string, checked: boolean) => {
      dispatch(changeSetting(['home', ...key], checked));
    },
    [dispatch],
app/javascript/flavours/glitch/features/home_timeline/components/column_settings.tsx on lines 30..35

Duplicated Code

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

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

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

Tuning

This issue has a mass of 46.

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

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

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

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

Refactorings

Further Reading

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

export const CustomEmojiFactory = Record<CustomEmojiShape>({
  shortcode: '',
  static_url: '',
  url: '',
  category: '',
Severity: Minor
Found in app/javascript/flavours/glitch/models/custom_emoji.ts and 1 other location - About 35 mins to fix
app/javascript/mastodon/models/custom_emoji.ts on lines 9..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 46.

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

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

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

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

Refactorings

Further Reading

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

export interface ApiCustomEmojiJSON {
  shortcode: string;
  static_url: string;
  url: string;
  category?: string;
Severity: Minor
Found in app/javascript/mastodon/api_types/custom_emoji.ts and 1 other location - About 35 mins to fix
app/javascript/flavours/glitch/api_types/custom_emoji.ts on lines 2..8

Duplicated Code

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

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

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

Tuning

This issue has a mass of 46.

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

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

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

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

Refactorings

Further Reading

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

      <Permalink href={href} to={to}>
        {name ? (
          <>
            #<span>{name}</span>
          </>
Severity: Minor
Found in app/javascript/flavours/glitch/components/hashtag.tsx and 1 other location - About 35 mins to fix
app/javascript/mastodon/components/hashtag.tsx on lines 106..114

Duplicated Code

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

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

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

Tuning

This issue has a mass of 46.

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

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

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

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

Refactorings

Further Reading

Avoid too many return statements within this function.
Open

  return showAlert({
    title: messages.unexpectedTitle,
    message: messages.unexpectedMessage,
  });
Severity: Major
Found in app/javascript/flavours/glitch/actions/alerts.js - About 30 mins to fix

    Avoid too many return statements within this function.
    Open

      return value;
    Severity: Major
    Found in app/javascript/flavours/glitch/features/interaction_modal/index.jsx - About 30 mins to fix

      Avoid too many return statements within this function.
      Open

          return '';
      Severity: Major
      Found in app/javascript/flavours/glitch/features/interaction_modal/index.jsx - About 30 mins to fix

        Avoid too many return statements within this function.
        Open

          return showAlert({
            title: messages.unexpectedTitle,
            message: messages.unexpectedMessage,
          });
        Severity: Major
        Found in app/javascript/mastodon/actions/alerts.js - About 30 mins to fix

          Avoid too many return statements within this function.
          Open

                return state;
          Severity: Major
          Found in app/javascript/flavours/glitch/reducers/statuses.js - About 30 mins to fix

            Avoid too many return statements within this function.
            Open

                  return state;
            Severity: Major
            Found in app/javascript/flavours/glitch/reducers/user_lists.js - About 30 mins to fix

              Avoid too many return statements within this function.
              Open

                  return messages.follow;
              Severity: Major
              Found in app/javascript/mastodon/features/account/components/header.jsx - About 30 mins to fix

                Avoid too many return statements within this function.
                Open

                    return state.withMutations(map => {
                      map.set('text', text);
                      map.set('content_type', action.content_type || 'text/plain');
                      map.set('in_reply_to', action.status.get('in_reply_to_id'));
                      map.set('privacy', action.status.get('visibility'));
                Severity: Major
                Found in app/javascript/flavours/glitch/reducers/compose.js - About 30 mins to fix

                  Avoid too many return statements within this method.
                  Open

                      return actor unless verify_signature(actor, signature, compare_signed_string).nil?
                  Severity: Major
                  Found in app/controllers/concerns/signature_verification.rb - About 30 mins to fix

                    Avoid too many return statements within this function.
                    Open

                          return state;
                    Severity: Major
                    Found in app/javascript/mastodon/reducers/compose.js - About 30 mins to fix
                      Severity
                      Category
                      Status
                      Source
                      Language