glitch-soc/mastodon

View on GitHub

Showing 3,648 of 4,938 total issues

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

const messages = defineMessages({
  logoutTitle: { id: 'confirmations.logout.title', defaultMessage: 'Log out?' },
  logoutMessage: {
    id: 'confirmations.logout.message',
    defaultMessage: 'Are you sure you want to log out?',
app/javascript/entrypoints/public.tsx on lines 25..38
app/javascript/flavours/glitch/entrypoints/public.tsx on lines 25..38
app/javascript/flavours/glitch/features/ui/components/confirmation_modals/clear_notifications.tsx on lines 11..25
app/javascript/flavours/glitch/features/ui/components/confirmation_modals/delete_list.tsx on lines 14..27
app/javascript/flavours/glitch/features/ui/components/confirmation_modals/edit_status.tsx on lines 11..22
app/javascript/flavours/glitch/features/ui/components/confirmation_modals/log_out.tsx on lines 10..20
app/javascript/flavours/glitch/features/ui/components/confirmation_modals/reply.tsx on lines 12..23
app/javascript/mastodon/features/ui/components/confirmation_modals/clear_notifications.tsx on lines 11..25
app/javascript/mastodon/features/ui/components/confirmation_modals/delete_list.tsx on lines 14..27
app/javascript/mastodon/features/ui/components/confirmation_modals/edit_status.tsx on lines 11..22
app/javascript/mastodon/features/ui/components/confirmation_modals/reply.tsx on lines 12..23

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

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

const messages = defineMessages({
  logoutTitle: { id: 'confirmations.logout.title', defaultMessage: 'Log out?' },
  logoutMessage: {
    id: 'confirmations.logout.message',
    defaultMessage: 'Are you sure you want to log out?',
app/javascript/entrypoints/public.tsx on lines 25..38
app/javascript/flavours/glitch/entrypoints/public.tsx on lines 25..38
app/javascript/flavours/glitch/features/ui/components/confirmation_modals/clear_notifications.tsx on lines 11..25
app/javascript/flavours/glitch/features/ui/components/confirmation_modals/delete_list.tsx on lines 14..27
app/javascript/flavours/glitch/features/ui/components/confirmation_modals/edit_status.tsx on lines 11..22
app/javascript/flavours/glitch/features/ui/components/confirmation_modals/reply.tsx on lines 12..23
app/javascript/mastodon/features/ui/components/confirmation_modals/clear_notifications.tsx on lines 11..25
app/javascript/mastodon/features/ui/components/confirmation_modals/delete_list.tsx on lines 14..27
app/javascript/mastodon/features/ui/components/confirmation_modals/edit_status.tsx on lines 11..22
app/javascript/mastodon/features/ui/components/confirmation_modals/log_out.tsx on lines 10..20
app/javascript/mastodon/features/ui/components/confirmation_modals/reply.tsx on lines 12..23

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

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

const messages = defineMessages({
  editTitle: {
    id: 'confirmations.edit.title',
    defaultMessage: 'Overwrite post?',
  },
app/javascript/entrypoints/public.tsx on lines 25..38
app/javascript/flavours/glitch/entrypoints/public.tsx on lines 25..38
app/javascript/flavours/glitch/features/ui/components/confirmation_modals/clear_notifications.tsx on lines 11..25
app/javascript/flavours/glitch/features/ui/components/confirmation_modals/delete_list.tsx on lines 14..27
app/javascript/flavours/glitch/features/ui/components/confirmation_modals/log_out.tsx on lines 10..20
app/javascript/flavours/glitch/features/ui/components/confirmation_modals/reply.tsx on lines 12..23
app/javascript/mastodon/features/ui/components/confirmation_modals/clear_notifications.tsx on lines 11..25
app/javascript/mastodon/features/ui/components/confirmation_modals/delete_list.tsx on lines 14..27
app/javascript/mastodon/features/ui/components/confirmation_modals/edit_status.tsx on lines 11..22
app/javascript/mastodon/features/ui/components/confirmation_modals/log_out.tsx on lines 10..20
app/javascript/mastodon/features/ui/components/confirmation_modals/reply.tsx on lines 12..23

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

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

const messages = defineMessages({
  deleteListTitle: {
    id: 'confirmations.delete_list.title',
    defaultMessage: 'Delete list?',
  },
app/javascript/entrypoints/public.tsx on lines 25..38
app/javascript/flavours/glitch/entrypoints/public.tsx on lines 25..38
app/javascript/flavours/glitch/features/ui/components/confirmation_modals/clear_notifications.tsx on lines 11..25
app/javascript/flavours/glitch/features/ui/components/confirmation_modals/delete_list.tsx on lines 14..27
app/javascript/flavours/glitch/features/ui/components/confirmation_modals/edit_status.tsx on lines 11..22
app/javascript/flavours/glitch/features/ui/components/confirmation_modals/log_out.tsx on lines 10..20
app/javascript/flavours/glitch/features/ui/components/confirmation_modals/reply.tsx on lines 12..23
app/javascript/mastodon/features/ui/components/confirmation_modals/clear_notifications.tsx on lines 11..25
app/javascript/mastodon/features/ui/components/confirmation_modals/edit_status.tsx on lines 11..22
app/javascript/mastodon/features/ui/components/confirmation_modals/log_out.tsx on lines 10..20
app/javascript/mastodon/features/ui/components/confirmation_modals/reply.tsx on lines 12..23

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

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

const messages = defineMessages({
  replyTitle: {
    id: 'confirmations.reply.title',
    defaultMessage: 'Overwrite post?',
  },
app/javascript/entrypoints/public.tsx on lines 25..38
app/javascript/flavours/glitch/entrypoints/public.tsx on lines 25..38
app/javascript/flavours/glitch/features/ui/components/confirmation_modals/clear_notifications.tsx on lines 11..25
app/javascript/flavours/glitch/features/ui/components/confirmation_modals/delete_list.tsx on lines 14..27
app/javascript/flavours/glitch/features/ui/components/confirmation_modals/edit_status.tsx on lines 11..22
app/javascript/flavours/glitch/features/ui/components/confirmation_modals/log_out.tsx on lines 10..20
app/javascript/flavours/glitch/features/ui/components/confirmation_modals/reply.tsx on lines 12..23
app/javascript/mastodon/features/ui/components/confirmation_modals/clear_notifications.tsx on lines 11..25
app/javascript/mastodon/features/ui/components/confirmation_modals/delete_list.tsx on lines 14..27
app/javascript/mastodon/features/ui/components/confirmation_modals/edit_status.tsx on lines 11..22
app/javascript/mastodon/features/ui/components/confirmation_modals/log_out.tsx on lines 10..20

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

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

const messages = defineMessages({
  clearTitle: {
    id: 'notifications.clear_title',
    defaultMessage: 'Clear notifications?',
  },
app/javascript/entrypoints/public.tsx on lines 25..38
app/javascript/flavours/glitch/entrypoints/public.tsx on lines 25..38
app/javascript/flavours/glitch/features/ui/components/confirmation_modals/delete_list.tsx on lines 14..27
app/javascript/flavours/glitch/features/ui/components/confirmation_modals/edit_status.tsx on lines 11..22
app/javascript/flavours/glitch/features/ui/components/confirmation_modals/log_out.tsx on lines 10..20
app/javascript/flavours/glitch/features/ui/components/confirmation_modals/reply.tsx on lines 12..23
app/javascript/mastodon/features/ui/components/confirmation_modals/clear_notifications.tsx on lines 11..25
app/javascript/mastodon/features/ui/components/confirmation_modals/delete_list.tsx on lines 14..27
app/javascript/mastodon/features/ui/components/confirmation_modals/edit_status.tsx on lines 11..22
app/javascript/mastodon/features/ui/components/confirmation_modals/log_out.tsx on lines 10..20
app/javascript/mastodon/features/ui/components/confirmation_modals/reply.tsx on lines 12..23

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

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

const messages = defineMessages({
  usernameTaken: {
    id: 'username.taken',
    defaultMessage: 'That username is taken. Try another',
  },
Severity: Major
Found in app/javascript/flavours/glitch/entrypoints/public.tsx and 11 other locations - About 1 hr to fix
app/javascript/entrypoints/public.tsx on lines 25..38
app/javascript/flavours/glitch/features/ui/components/confirmation_modals/clear_notifications.tsx on lines 11..25
app/javascript/flavours/glitch/features/ui/components/confirmation_modals/delete_list.tsx on lines 14..27
app/javascript/flavours/glitch/features/ui/components/confirmation_modals/edit_status.tsx on lines 11..22
app/javascript/flavours/glitch/features/ui/components/confirmation_modals/log_out.tsx on lines 10..20
app/javascript/flavours/glitch/features/ui/components/confirmation_modals/reply.tsx on lines 12..23
app/javascript/mastodon/features/ui/components/confirmation_modals/clear_notifications.tsx on lines 11..25
app/javascript/mastodon/features/ui/components/confirmation_modals/delete_list.tsx on lines 14..27
app/javascript/mastodon/features/ui/components/confirmation_modals/edit_status.tsx on lines 11..22
app/javascript/mastodon/features/ui/components/confirmation_modals/log_out.tsx on lines 10..20
app/javascript/mastodon/features/ui/components/confirmation_modals/reply.tsx on lines 12..23

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

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

const messages = defineMessages({
  editTitle: {
    id: 'confirmations.edit.title',
    defaultMessage: 'Overwrite post?',
  },
app/javascript/entrypoints/public.tsx on lines 25..38
app/javascript/flavours/glitch/entrypoints/public.tsx on lines 25..38
app/javascript/flavours/glitch/features/ui/components/confirmation_modals/clear_notifications.tsx on lines 11..25
app/javascript/flavours/glitch/features/ui/components/confirmation_modals/delete_list.tsx on lines 14..27
app/javascript/flavours/glitch/features/ui/components/confirmation_modals/edit_status.tsx on lines 11..22
app/javascript/flavours/glitch/features/ui/components/confirmation_modals/log_out.tsx on lines 10..20
app/javascript/flavours/glitch/features/ui/components/confirmation_modals/reply.tsx on lines 12..23
app/javascript/mastodon/features/ui/components/confirmation_modals/clear_notifications.tsx on lines 11..25
app/javascript/mastodon/features/ui/components/confirmation_modals/delete_list.tsx on lines 14..27
app/javascript/mastodon/features/ui/components/confirmation_modals/log_out.tsx on lines 10..20
app/javascript/mastodon/features/ui/components/confirmation_modals/reply.tsx on lines 12..23

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

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

const messages = defineMessages({
  usernameTaken: {
    id: 'username.taken',
    defaultMessage: 'That username is taken. Try another',
  },
Severity: Major
Found in app/javascript/entrypoints/public.tsx and 11 other locations - About 1 hr to fix
app/javascript/flavours/glitch/entrypoints/public.tsx on lines 25..38
app/javascript/flavours/glitch/features/ui/components/confirmation_modals/clear_notifications.tsx on lines 11..25
app/javascript/flavours/glitch/features/ui/components/confirmation_modals/delete_list.tsx on lines 14..27
app/javascript/flavours/glitch/features/ui/components/confirmation_modals/edit_status.tsx on lines 11..22
app/javascript/flavours/glitch/features/ui/components/confirmation_modals/log_out.tsx on lines 10..20
app/javascript/flavours/glitch/features/ui/components/confirmation_modals/reply.tsx on lines 12..23
app/javascript/mastodon/features/ui/components/confirmation_modals/clear_notifications.tsx on lines 11..25
app/javascript/mastodon/features/ui/components/confirmation_modals/delete_list.tsx on lines 14..27
app/javascript/mastodon/features/ui/components/confirmation_modals/edit_status.tsx on lines 11..22
app/javascript/mastodon/features/ui/components/confirmation_modals/log_out.tsx on lines 10..20
app/javascript/mastodon/features/ui/components/confirmation_modals/reply.tsx on lines 12..23

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

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

function removeNotificationsForStatus(
  state: NotificationGroupsState,
  statusId: string,
) {
  state.groups = filterNotificationsForStatus(state.groups, statusId);
Severity: Major
Found in app/javascript/mastodon/reducers/notification_groups.ts and 1 other location - About 1 hr to fix
app/javascript/flavours/glitch/reducers/notification_groups.ts on lines 139..148

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

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

const messages = defineMessages({
  deleteListTitle: {
    id: 'confirmations.delete_list.title',
    defaultMessage: 'Delete list?',
  },
app/javascript/entrypoints/public.tsx on lines 25..38
app/javascript/flavours/glitch/entrypoints/public.tsx on lines 25..38
app/javascript/flavours/glitch/features/ui/components/confirmation_modals/clear_notifications.tsx on lines 11..25
app/javascript/flavours/glitch/features/ui/components/confirmation_modals/edit_status.tsx on lines 11..22
app/javascript/flavours/glitch/features/ui/components/confirmation_modals/log_out.tsx on lines 10..20
app/javascript/flavours/glitch/features/ui/components/confirmation_modals/reply.tsx on lines 12..23
app/javascript/mastodon/features/ui/components/confirmation_modals/clear_notifications.tsx on lines 11..25
app/javascript/mastodon/features/ui/components/confirmation_modals/delete_list.tsx on lines 14..27
app/javascript/mastodon/features/ui/components/confirmation_modals/edit_status.tsx on lines 11..22
app/javascript/mastodon/features/ui/components/confirmation_modals/log_out.tsx on lines 10..20
app/javascript/mastodon/features/ui/components/confirmation_modals/reply.tsx on lines 12..23

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

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

const normalizeAccounts = (
  state: typeof initialState,
  accounts: ApiAccountJSON[],
) => {
  accounts.forEach((account) => {
Severity: Major
Found in app/javascript/mastodon/reducers/accounts.ts and 1 other location - About 1 hr to fix
app/javascript/flavours/glitch/reducers/accounts.ts on lines 32..41

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

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

function removeNotificationsForStatus(
  state: NotificationGroupsState,
  statusId: string,
) {
  state.groups = filterNotificationsForStatus(state.groups, statusId);
app/javascript/mastodon/reducers/notification_groups.ts on lines 139..148

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

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

interface Props {
  src: string;
  key: string;
  alt?: string;
  lang?: string;
Severity: Major
Found in app/javascript/flavours/glitch/components/gifv.tsx and 1 other location - About 1 hr to fix
app/javascript/mastodon/components/gifv.tsx on lines 3..11

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

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

const normalizeRelationships = (
  state: State,
  relationships: ApiRelationshipJSON[],
) => {
  relationships.forEach((relationship) => {
Severity: Major
Found in app/javascript/flavours/glitch/reducers/relationships.ts and 1 other location - About 1 hr to fix
app/javascript/mastodon/reducers/relationships.ts on lines 42..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 60.

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

interface Props {
  src: string;
  key: string;
  alt?: string;
  lang?: string;
Severity: Major
Found in app/javascript/mastodon/components/gifv.tsx and 1 other location - About 1 hr to fix
app/javascript/flavours/glitch/components/gifv.tsx on lines 3..11

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

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

const normalizeAccounts = (
  state: typeof initialState,
  accounts: ApiAccountJSON[],
) => {
  accounts.forEach((account) => {
Severity: Major
Found in app/javascript/flavours/glitch/reducers/accounts.ts and 1 other location - About 1 hr to fix
app/javascript/mastodon/reducers/accounts.ts on lines 32..41

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

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

const normalizeRelationships = (
  state: State,
  relationships: ApiRelationshipJSON[],
) => {
  relationships.forEach((relationship) => {
Severity: Major
Found in app/javascript/mastodon/reducers/relationships.ts and 1 other location - About 1 hr to fix
app/javascript/flavours/glitch/reducers/relationships.ts on lines 42..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 60.

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

const usesRenderer = (displayNumber, pluralReady) => (
  <FormattedMessage
    id='hashtag.counter_by_uses'
    defaultMessage='{count, plural, one {{counter} post} other {{counter} posts}}'
    values={{
app/javascript/flavours/glitch/features/explore/components/story.jsx on lines 18..27
app/javascript/flavours/glitch/features/hashtag_timeline/components/hashtag_header.jsx on lines 15..24
app/javascript/flavours/glitch/features/hashtag_timeline/components/hashtag_header.jsx on lines 26..35
app/javascript/flavours/glitch/features/hashtag_timeline/components/hashtag_header.jsx on lines 37..46
app/javascript/mastodon/features/explore/components/story.jsx on lines 18..27
app/javascript/mastodon/features/hashtag_timeline/components/hashtag_header.jsx on lines 26..35
app/javascript/mastodon/features/hashtag_timeline/components/hashtag_header.jsx on lines 37..46

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

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

          <LocalSettingsPageItem
            settings={settings}
            item={['status_icons', 'language']}
            id='mastodon-settings--status-icons-language'
            onChange={onChange}
app/javascript/flavours/glitch/features/local_settings/page/index.jsx on lines 128..135
app/javascript/flavours/glitch/features/local_settings/page/index.jsx on lines 136..143
app/javascript/flavours/glitch/features/local_settings/page/index.jsx on lines 144..151
app/javascript/flavours/glitch/features/local_settings/page/index.jsx on lines 152..159
app/javascript/flavours/glitch/features/local_settings/page/index.jsx on lines 454..461
app/javascript/flavours/glitch/features/local_settings/page/index.jsx on lines 470..477
app/javascript/flavours/glitch/features/local_settings/page/index.jsx on lines 478..485

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

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