glitch-soc/mastodon

View on GitHub

Showing 3,390 of 4,633 total issues

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

    people={
      (hashtag.getIn(['history', 0, 'accounts']) as number) * 1 +
      (hashtag.getIn(['history', 1, 'accounts']) as number) * 1
    }
Severity: Minor
Found in app/javascript/mastodon/components/hashtag.tsx and 1 other location - About 50 mins to fix
app/javascript/flavours/glitch/components/hashtag.tsx on lines 69..72

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

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

    people={
      (hashtag.getIn(['history', 0, 'accounts']) as number) * 1 +
      (hashtag.getIn(['history', 1, 'accounts']) as number) * 1
    }
Severity: Minor
Found in app/javascript/flavours/glitch/components/hashtag.tsx and 1 other location - About 50 mins to fix
app/javascript/mastodon/components/hashtag.tsx on lines 67..70

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

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

loadPolyfills()
  .then(loadLocale)
  .then(main)
  .catch((e: unknown) => {
    console.error(e);
Severity: Minor
Found in app/javascript/flavours/glitch/entrypoints/application.ts and 1 other location - About 50 mins to fix
app/javascript/entrypoints/application.ts on lines 10..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 51.

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

async function checkConfirmation() {
  const response = await axios.get('/api/v1/emails/check_confirmation');

  if (response.data) {
    window.location.href = '/start';
Severity: Minor
Found in app/javascript/entrypoints/sign_up.ts and 1 other location - About 50 mins to fix
app/javascript/flavours/glitch/entrypoints/sign_up.ts on lines 6..12

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

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

async function checkConfirmation() {
  const response = await axios.get('/api/v1/emails/check_confirmation');

  if (response.data) {
    window.location.href = '/start';
Severity: Minor
Found in app/javascript/flavours/glitch/entrypoints/sign_up.ts and 1 other location - About 50 mins to fix
app/javascript/entrypoints/sign_up.ts on lines 6..12

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

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

loadPolyfills()
  .then(loadLocale)
  .then(main)
  .catch((e: unknown) => {
    console.error(e);
Severity: Minor
Found in app/javascript/entrypoints/application.ts and 1 other location - About 50 mins to fix
app/javascript/flavours/glitch/entrypoints/application.ts on lines 10..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 51.

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

  onPin (status) {
    if (status.get('pinned')) {
      dispatch(unpin(status));
    } else {
      dispatch(pin(status));
Severity: Major
Found in app/javascript/flavours/glitch/containers/status_container.js and 10 other locations - About 45 mins to fix
app/javascript/flavours/glitch/containers/status_container.js on lines 137..143
app/javascript/flavours/glitch/features/notifications/containers/notification_container.js on lines 54..60
app/javascript/flavours/glitch/features/status/containers/detailed_status_container.js on lines 89..95
app/javascript/flavours/glitch/features/status/containers/detailed_status_container.js on lines 97..103
app/javascript/mastodon/containers/status_container.jsx on lines 113..119
app/javascript/mastodon/containers/status_container.jsx on lines 121..127
app/javascript/mastodon/containers/status_container.jsx on lines 129..135
app/javascript/mastodon/features/notifications/containers/notification_container.js on lines 57..63
app/javascript/mastodon/features/status/containers/detailed_status_container.js on lines 92..98
app/javascript/mastodon/features/status/containers/detailed_status_container.js on lines 100..106

Duplicated Code

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

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

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

Tuning

This issue has a mass of 50.

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

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

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

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

Refactorings

Further Reading

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

  onFavourite (status) {
    if (status.get('favourited')) {
      dispatch(unfavourite(status));
    } else {
      dispatch(favourite(status));
Severity: Major
Found in app/javascript/mastodon/containers/status_container.jsx and 10 other locations - About 45 mins to fix
app/javascript/flavours/glitch/containers/status_container.js on lines 137..143
app/javascript/flavours/glitch/containers/status_container.js on lines 167..173
app/javascript/flavours/glitch/features/notifications/containers/notification_container.js on lines 54..60
app/javascript/flavours/glitch/features/status/containers/detailed_status_container.js on lines 89..95
app/javascript/flavours/glitch/features/status/containers/detailed_status_container.js on lines 97..103
app/javascript/mastodon/containers/status_container.jsx on lines 121..127
app/javascript/mastodon/containers/status_container.jsx on lines 129..135
app/javascript/mastodon/features/notifications/containers/notification_container.js on lines 57..63
app/javascript/mastodon/features/status/containers/detailed_status_container.js on lines 92..98
app/javascript/mastodon/features/status/containers/detailed_status_container.js on lines 100..106

Duplicated Code

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

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

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

Tuning

This issue has a mass of 50.

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

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

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

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

Refactorings

Further Reading

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

  onPin (status) {
    if (status.get('pinned')) {
      dispatch(unpin(status));
    } else {
      dispatch(pin(status));
app/javascript/flavours/glitch/containers/status_container.js on lines 137..143
app/javascript/flavours/glitch/containers/status_container.js on lines 167..173
app/javascript/flavours/glitch/features/notifications/containers/notification_container.js on lines 54..60
app/javascript/flavours/glitch/features/status/containers/detailed_status_container.js on lines 89..95
app/javascript/flavours/glitch/features/status/containers/detailed_status_container.js on lines 97..103
app/javascript/mastodon/containers/status_container.jsx on lines 113..119
app/javascript/mastodon/containers/status_container.jsx on lines 121..127
app/javascript/mastodon/containers/status_container.jsx on lines 129..135
app/javascript/mastodon/features/notifications/containers/notification_container.js on lines 57..63
app/javascript/mastodon/features/status/containers/detailed_status_container.js on lines 92..98

Duplicated Code

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

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

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

Tuning

This issue has a mass of 50.

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

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

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

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

Refactorings

Further Reading

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

  handleMentionClick = () => {
    this.props.onMention(this.props.status.get('account'), this.props.history);
  };
app/javascript/flavours/glitch/components/status_action_bar.jsx on lines 163..165
app/javascript/flavours/glitch/components/status_action_bar.jsx on lines 167..169
app/javascript/flavours/glitch/features/status/components/action_bar.jsx on lines 112..114
app/javascript/flavours/glitch/features/status/components/action_bar.jsx on lines 116..118
app/javascript/mastodon/components/status_action_bar.jsx on lines 175..177
app/javascript/mastodon/components/status_action_bar.jsx on lines 179..181
app/javascript/mastodon/features/status/components/action_bar.jsx on lines 125..127

Duplicated Code

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

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

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

Tuning

This issue has a mass of 50.

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

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

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

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

Refactorings

Further Reading

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

  onPin (status) {
    if (status.get('pinned')) {
      dispatch(unpin(status));
    } else {
      dispatch(pin(status));
app/javascript/flavours/glitch/containers/status_container.js on lines 137..143
app/javascript/flavours/glitch/containers/status_container.js on lines 167..173
app/javascript/flavours/glitch/features/notifications/containers/notification_container.js on lines 54..60
app/javascript/flavours/glitch/features/status/containers/detailed_status_container.js on lines 89..95
app/javascript/mastodon/containers/status_container.jsx on lines 113..119
app/javascript/mastodon/containers/status_container.jsx on lines 121..127
app/javascript/mastodon/containers/status_container.jsx on lines 129..135
app/javascript/mastodon/features/notifications/containers/notification_container.js on lines 57..63
app/javascript/mastodon/features/status/containers/detailed_status_container.js on lines 92..98
app/javascript/mastodon/features/status/containers/detailed_status_container.js on lines 100..106

Duplicated Code

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

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

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

Tuning

This issue has a mass of 50.

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

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

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

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

Refactorings

Further Reading

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

  onBookmark (status) {
    if (status.get('bookmarked')) {
      dispatch(unbookmark(status));
    } else {
      dispatch(bookmark(status));
Severity: Major
Found in app/javascript/mastodon/containers/status_container.jsx and 10 other locations - About 45 mins to fix
app/javascript/flavours/glitch/containers/status_container.js on lines 137..143
app/javascript/flavours/glitch/containers/status_container.js on lines 167..173
app/javascript/flavours/glitch/features/notifications/containers/notification_container.js on lines 54..60
app/javascript/flavours/glitch/features/status/containers/detailed_status_container.js on lines 89..95
app/javascript/flavours/glitch/features/status/containers/detailed_status_container.js on lines 97..103
app/javascript/mastodon/containers/status_container.jsx on lines 113..119
app/javascript/mastodon/containers/status_container.jsx on lines 129..135
app/javascript/mastodon/features/notifications/containers/notification_container.js on lines 57..63
app/javascript/mastodon/features/status/containers/detailed_status_container.js on lines 92..98
app/javascript/mastodon/features/status/containers/detailed_status_container.js on lines 100..106

Duplicated Code

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

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

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

Tuning

This issue has a mass of 50.

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

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

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

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

Refactorings

Further Reading

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

  onPin (status) {
    if (status.get('pinned')) {
      dispatch(unpin(status));
    } else {
      dispatch(pin(status));
Severity: Major
Found in app/javascript/mastodon/containers/status_container.jsx and 10 other locations - About 45 mins to fix
app/javascript/flavours/glitch/containers/status_container.js on lines 137..143
app/javascript/flavours/glitch/containers/status_container.js on lines 167..173
app/javascript/flavours/glitch/features/notifications/containers/notification_container.js on lines 54..60
app/javascript/flavours/glitch/features/status/containers/detailed_status_container.js on lines 89..95
app/javascript/flavours/glitch/features/status/containers/detailed_status_container.js on lines 97..103
app/javascript/mastodon/containers/status_container.jsx on lines 113..119
app/javascript/mastodon/containers/status_container.jsx on lines 121..127
app/javascript/mastodon/features/notifications/containers/notification_container.js on lines 57..63
app/javascript/mastodon/features/status/containers/detailed_status_container.js on lines 92..98
app/javascript/mastodon/features/status/containers/detailed_status_container.js on lines 100..106

Duplicated Code

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

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

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

Tuning

This issue has a mass of 50.

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

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

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

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

Refactorings

Further Reading

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

  onFavourite (status) {
    if (status.get('favourited')) {
      dispatch(unfavourite(status));
    } else {
      dispatch(favourite(status));
app/javascript/flavours/glitch/containers/status_container.js on lines 137..143
app/javascript/flavours/glitch/containers/status_container.js on lines 167..173
app/javascript/flavours/glitch/features/notifications/containers/notification_container.js on lines 54..60
app/javascript/flavours/glitch/features/status/containers/detailed_status_container.js on lines 89..95
app/javascript/flavours/glitch/features/status/containers/detailed_status_container.js on lines 97..103
app/javascript/mastodon/containers/status_container.jsx on lines 113..119
app/javascript/mastodon/containers/status_container.jsx on lines 121..127
app/javascript/mastodon/containers/status_container.jsx on lines 129..135
app/javascript/mastodon/features/status/containers/detailed_status_container.js on lines 92..98
app/javascript/mastodon/features/status/containers/detailed_status_container.js on lines 100..106

Duplicated Code

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

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

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

Tuning

This issue has a mass of 50.

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

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

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

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

Refactorings

Further Reading

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

  handleMentionClick = () => {
    this.props.onMention(this.props.status.get('account'), this.props.history);
  };
app/javascript/flavours/glitch/components/status_action_bar.jsx on lines 167..169
app/javascript/flavours/glitch/features/status/components/action_bar.jsx on lines 112..114
app/javascript/flavours/glitch/features/status/components/action_bar.jsx on lines 116..118
app/javascript/mastodon/components/status_action_bar.jsx on lines 175..177
app/javascript/mastodon/components/status_action_bar.jsx on lines 179..181
app/javascript/mastodon/features/status/components/action_bar.jsx on lines 125..127
app/javascript/mastodon/features/status/components/action_bar.jsx on lines 129..131

Duplicated Code

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

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

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

Tuning

This issue has a mass of 50.

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

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

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

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

Refactorings

Further Reading

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

  handleDirectClick = () => {
    this.props.onDirect(this.props.status.get('account'), this.props.history);
  };
app/javascript/flavours/glitch/components/status_action_bar.jsx on lines 163..165
app/javascript/flavours/glitch/features/status/components/action_bar.jsx on lines 112..114
app/javascript/flavours/glitch/features/status/components/action_bar.jsx on lines 116..118
app/javascript/mastodon/components/status_action_bar.jsx on lines 175..177
app/javascript/mastodon/components/status_action_bar.jsx on lines 179..181
app/javascript/mastodon/features/status/components/action_bar.jsx on lines 125..127
app/javascript/mastodon/features/status/components/action_bar.jsx on lines 129..131

Duplicated Code

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

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

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

Tuning

This issue has a mass of 50.

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

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

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

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

Refactorings

Further Reading

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

  handleMentionClick = () => {
    this.props.onMention(this.props.status.get('account'), this.props.history);
  };
Severity: Major
Found in app/javascript/mastodon/components/status_action_bar.jsx and 7 other locations - About 45 mins to fix
app/javascript/flavours/glitch/components/status_action_bar.jsx on lines 163..165
app/javascript/flavours/glitch/components/status_action_bar.jsx on lines 167..169
app/javascript/flavours/glitch/features/status/components/action_bar.jsx on lines 112..114
app/javascript/flavours/glitch/features/status/components/action_bar.jsx on lines 116..118
app/javascript/mastodon/components/status_action_bar.jsx on lines 179..181
app/javascript/mastodon/features/status/components/action_bar.jsx on lines 125..127
app/javascript/mastodon/features/status/components/action_bar.jsx on lines 129..131

Duplicated Code

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

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

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

Tuning

This issue has a mass of 50.

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

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

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

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

Refactorings

Further Reading

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

  handleDirectClick = () => {
    this.props.onDirect(this.props.status.get('account'), this.props.history);
  };
app/javascript/flavours/glitch/components/status_action_bar.jsx on lines 163..165
app/javascript/flavours/glitch/components/status_action_bar.jsx on lines 167..169
app/javascript/flavours/glitch/features/status/components/action_bar.jsx on lines 112..114
app/javascript/flavours/glitch/features/status/components/action_bar.jsx on lines 116..118
app/javascript/mastodon/components/status_action_bar.jsx on lines 175..177
app/javascript/mastodon/components/status_action_bar.jsx on lines 179..181
app/javascript/mastodon/features/status/components/action_bar.jsx on lines 129..131

Duplicated Code

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

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

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

Tuning

This issue has a mass of 50.

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

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

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

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

Refactorings

Further Reading

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

  handleDirectClick = () => {
    this.props.onDirect(this.props.status.get('account'), this.props.history);
  };
app/javascript/flavours/glitch/components/status_action_bar.jsx on lines 163..165
app/javascript/flavours/glitch/components/status_action_bar.jsx on lines 167..169
app/javascript/flavours/glitch/features/status/components/action_bar.jsx on lines 116..118
app/javascript/mastodon/components/status_action_bar.jsx on lines 175..177
app/javascript/mastodon/components/status_action_bar.jsx on lines 179..181
app/javascript/mastodon/features/status/components/action_bar.jsx on lines 125..127
app/javascript/mastodon/features/status/components/action_bar.jsx on lines 129..131

Duplicated Code

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

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

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

Tuning

This issue has a mass of 50.

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

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

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

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

Refactorings

Further Reading

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

  onBookmark (status) {
    if (status.get('bookmarked')) {
      dispatch(unbookmark(status));
    } else {
      dispatch(bookmark(status));
Severity: Major
Found in app/javascript/flavours/glitch/containers/status_container.js and 10 other locations - About 45 mins to fix
app/javascript/flavours/glitch/containers/status_container.js on lines 167..173
app/javascript/flavours/glitch/features/notifications/containers/notification_container.js on lines 54..60
app/javascript/flavours/glitch/features/status/containers/detailed_status_container.js on lines 89..95
app/javascript/flavours/glitch/features/status/containers/detailed_status_container.js on lines 97..103
app/javascript/mastodon/containers/status_container.jsx on lines 113..119
app/javascript/mastodon/containers/status_container.jsx on lines 121..127
app/javascript/mastodon/containers/status_container.jsx on lines 129..135
app/javascript/mastodon/features/notifications/containers/notification_container.js on lines 57..63
app/javascript/mastodon/features/status/containers/detailed_status_container.js on lines 92..98
app/javascript/mastodon/features/status/containers/detailed_status_container.js on lines 100..106

Duplicated Code

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

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

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

Tuning

This issue has a mass of 50.

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

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

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

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

Refactorings

Further Reading

Severity
Category
Status
Source
Language