glitch-soc/mastodon

View on GitHub
app/javascript/flavours/glitch/features/local_settings/navigation/index.jsx

Summary

Maintainability
D
1 day
Test Coverage

Function render has 62 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  render () {

    const { index, intl, onClose, onNavigate } = this.props;

    return (

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

    const messages = defineMessages({
      general: {  id: 'settings.general', defaultMessage: 'General' },
      compose: {  id: 'settings.compose_box_opts', defaultMessage: 'Compose box' },
      content_warnings: { id: 'settings.content_warnings', defaultMessage: 'Content Warnings' },
      collapsed: { id: 'settings.collapsed_statuses', defaultMessage: 'Collapsed toots' },
    app/javascript/flavours/glitch/features/about/index.jsx on lines 23..31
    app/javascript/flavours/glitch/features/compose/components/content_type_button.jsx on lines 16..24
    app/javascript/flavours/glitch/features/direct_timeline/components/conversation.jsx on lines 32..40
    app/javascript/flavours/glitch/features/notifications/components/notification_request.jsx on lines 26..34
    app/javascript/flavours/glitch/features/ui/components/focal_point_modal.jsx on lines 33..41
    app/javascript/mastodon/features/about/index.jsx on lines 23..31
    app/javascript/mastodon/features/direct_timeline/components/conversation.jsx on lines 31..39
    app/javascript/mastodon/features/notifications/components/notification_request.jsx on lines 26..34
    app/javascript/mastodon/features/ui/components/focal_point_modal.jsx on lines 33..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 124.

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

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

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

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

    Refactorings

    Further Reading

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

            <LocalSettingsNavigationItem
              active={index === 2}
              index={2}
              onNavigate={onNavigate}
              icon='warning'
    app/javascript/flavours/glitch/features/local_settings/navigation/index.jsx on lines 43..50
    app/javascript/flavours/glitch/features/local_settings/navigation/index.jsx on lines 51..58
    app/javascript/flavours/glitch/features/local_settings/navigation/index.jsx on lines 67..74
    app/javascript/flavours/glitch/features/local_settings/navigation/index.jsx on lines 75..82

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

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

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

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

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

    Refactorings

    Further Reading

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

            <LocalSettingsNavigationItem
              active={index === 0}
              index={0}
              onNavigate={onNavigate}
              icon='cogs'
    app/javascript/flavours/glitch/features/local_settings/navigation/index.jsx on lines 51..58
    app/javascript/flavours/glitch/features/local_settings/navigation/index.jsx on lines 59..66
    app/javascript/flavours/glitch/features/local_settings/navigation/index.jsx on lines 67..74
    app/javascript/flavours/glitch/features/local_settings/navigation/index.jsx on lines 75..82

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

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

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

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

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

    Refactorings

    Further Reading

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

            <LocalSettingsNavigationItem
              active={index === 3}
              index={3}
              onNavigate={onNavigate}
              icon='angle-double-up'
    app/javascript/flavours/glitch/features/local_settings/navigation/index.jsx on lines 43..50
    app/javascript/flavours/glitch/features/local_settings/navigation/index.jsx on lines 51..58
    app/javascript/flavours/glitch/features/local_settings/navigation/index.jsx on lines 59..66
    app/javascript/flavours/glitch/features/local_settings/navigation/index.jsx on lines 75..82

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

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

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

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

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

    Refactorings

    Further Reading

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

            <LocalSettingsNavigationItem
              active={index === 1}
              index={1}
              onNavigate={onNavigate}
              icon='pencil'
    app/javascript/flavours/glitch/features/local_settings/navigation/index.jsx on lines 43..50
    app/javascript/flavours/glitch/features/local_settings/navigation/index.jsx on lines 59..66
    app/javascript/flavours/glitch/features/local_settings/navigation/index.jsx on lines 67..74
    app/javascript/flavours/glitch/features/local_settings/navigation/index.jsx on lines 75..82

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

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

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

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

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

    Refactorings

    Further Reading

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

            <LocalSettingsNavigationItem
              active={index === 4}
              index={4}
              onNavigate={onNavigate}
              icon='image'
    app/javascript/flavours/glitch/features/local_settings/navigation/index.jsx on lines 43..50
    app/javascript/flavours/glitch/features/local_settings/navigation/index.jsx on lines 51..58
    app/javascript/flavours/glitch/features/local_settings/navigation/index.jsx on lines 59..66
    app/javascript/flavours/glitch/features/local_settings/navigation/index.jsx on lines 67..74

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

    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

    There are no issues that match your filters.

    Category
    Status