glitch-soc/mastodon

View on GitHub

Showing 4,938 of 4,938 total issues

Function importFetchedStatuses has 27 lines of code (exceeds 25 allowed). Consider refactoring.
Open

export function importFetchedStatuses(statuses) {
  return (dispatch, getState) => {
    const accounts = [];
    const normalStatuses = [];
    const polls = [];
Severity: Minor
Found in app/javascript/mastodon/actions/importer/index.js - About 1 hr to fix

    Function expandNormalizedTimeline has 27 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    const expandNormalizedTimeline = (state, timeline, statuses, next, isPartial, isLoadingRecent, usePendingItems) => {
      // This method is pretty tricky because:
      // - existing items in the timeline might be out of order
      // - the existing timeline may have gaps, most often explicitly noted with a `null` item
      // - ideally, we don't want it to reorder existing items of the timeline
    Severity: Minor
    Found in app/javascript/flavours/glitch/reducers/timelines.js - About 1 hr to fix

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

        render () {
          const { intl, domains, hasMore, multiColumn } = this.props;
      
          if (!domains) {
            return (
      Severity: Minor
      Found in app/javascript/flavours/glitch/features/domain_blocks/index.jsx - About 1 hr to fix

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

          render () {
            const { reactions } = this.props;
            const visibleReactions = reactions.filter(x => x.get('count') > 0);
        
            const styles = visibleReactions.map(reaction => ({

          Function expandNormalizedTimeline has 27 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          const expandNormalizedTimeline = (state, timeline, statuses, next, isPartial, isLoadingRecent, usePendingItems) => {
            // This method is pretty tricky because:
            // - existing items in the timeline might be out of order
            // - the existing timeline may have gaps, most often explicitly noted with a `null` item
            // - ideally, we don't want it to reorder existing items of the timeline
          Severity: Minor
          Found in app/javascript/mastodon/reducers/timelines.js - About 1 hr to fix

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

              render () {
                const { intl, domains, hasMore, multiColumn } = this.props;
            
                if (!domains) {
                  return (
            Severity: Minor
            Found in app/javascript/mastodon/features/domain_blocks/index.jsx - About 1 hr to fix

              Function expandNormalizedConversations has 27 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              const expandNormalizedConversations = (state, conversations, next, isLoadingRecent) => {
                let items = ImmutableList(conversations.map(conversationToMap));
              
                return state.withMutations(mutable => {
                  if (!items.isEmpty()) {
              Severity: Minor
              Found in app/javascript/mastodon/reducers/conversations.js - About 1 hr to fix

                Method cc has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                  def cc(status)
                    cc = []
                
                    cc << uri_for(status.reblog.account) if status.reblog?
                
                
                Severity: Minor
                Found in app/lib/activitypub/tag_manager.rb - About 1 hr to fix

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

                          menu.push({ text: intl.formatMessage(messages.direct, { name: status.getIn(['account', 'username']) }), action: this.handleDirectClick });
                  app/javascript/flavours/glitch/components/status_action_bar.jsx on lines 258..258
                  app/javascript/flavours/glitch/components/status_action_bar.jsx on lines 259..259
                  app/javascript/flavours/glitch/features/status/components/action_bar.jsx on lines 193..193
                  app/javascript/mastodon/features/status/components/action_bar.jsx on lines 235..235

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

                  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

                          menu.push({ text: intl.formatMessage(messages.direct, { name: status.getIn(['account', 'username']) }), action: this.handleDirectClick });
                  app/javascript/flavours/glitch/components/status_action_bar.jsx on lines 258..258
                  app/javascript/flavours/glitch/features/status/components/action_bar.jsx on lines 193..193
                  app/javascript/flavours/glitch/features/status/components/action_bar.jsx on lines 194..194
                  app/javascript/mastodon/features/status/components/action_bar.jsx on lines 235..235

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

                  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

                          menu.push({ text: intl.formatMessage(messages.mention, { name: status.getIn(['account', 'username']) }), action: this.handleMentionClick });
                  app/javascript/flavours/glitch/components/status_action_bar.jsx on lines 258..258
                  app/javascript/flavours/glitch/components/status_action_bar.jsx on lines 259..259
                  app/javascript/flavours/glitch/features/status/components/action_bar.jsx on lines 194..194
                  app/javascript/mastodon/features/status/components/action_bar.jsx on lines 235..235

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

                  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

                          menu.push({ text: intl.formatMessage(messages.mention, { name: status.getIn(['account', 'username']) }), action: this.handleMentionClick });
                  app/javascript/flavours/glitch/components/status_action_bar.jsx on lines 259..259
                  app/javascript/flavours/glitch/features/status/components/action_bar.jsx on lines 193..193
                  app/javascript/flavours/glitch/features/status/components/action_bar.jsx on lines 194..194
                  app/javascript/mastodon/features/status/components/action_bar.jsx on lines 235..235

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

                  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

                          menu.push({ text: intl.formatMessage(messages.mention, { name: status.getIn(['account', 'username']) }), action: this.handleMentionClick });
                  app/javascript/flavours/glitch/components/status_action_bar.jsx on lines 258..258
                  app/javascript/flavours/glitch/components/status_action_bar.jsx on lines 259..259
                  app/javascript/flavours/glitch/features/status/components/action_bar.jsx on lines 193..193
                  app/javascript/flavours/glitch/features/status/components/action_bar.jsx on lines 194..194

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

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

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

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

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

                  Refactorings

                  Further Reading

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

                  export default function meta(state = initialState, action) {
                    switch(action.type) {
                    case STORE_HYDRATE:
                      return state.merge(action.state.get('media_attachments'));
                    default:
                  app/javascript/mastodon/reducers/media_attachments.js on lines 9..16

                  Duplicated Code

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

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

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

                  Tuning

                  This issue has a mass of 56.

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

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

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

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

                  Refactorings

                  Further Reading

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

                              {canViewAdminDashboard(permissions) && <ColumnLink transparent href='/admin/dashboard' icon='tachometer' iconComponent={AdministrationIcon} text={intl.formatMessage(messages.administration)} />}
                  app/javascript/flavours/glitch/features/ui/components/navigation_panel.jsx on lines 181..181
                  app/javascript/mastodon/features/ui/components/navigation_panel.jsx on lines 182..182
                  app/javascript/mastodon/features/ui/components/navigation_panel.jsx on lines 183..183

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

                  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

                  Option.propTypes = {
                    title: PropTypes.string.isRequired,
                    index: PropTypes.number.isRequired,
                    multipleChoice: PropTypes.bool,
                    autoFocus: PropTypes.bool,
                  app/javascript/mastodon/features/compose/components/poll_form.jsx on lines 101..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 56.

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

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

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

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

                  Refactorings

                  Further Reading

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

                              {canManageReports(permissions) && <ColumnLink transparent href='/admin/reports' icon='flag' iconComponent={ModerationIcon} text={intl.formatMessage(messages.moderation)} />}
                  app/javascript/flavours/glitch/features/ui/components/navigation_panel.jsx on lines 181..181
                  app/javascript/flavours/glitch/features/ui/components/navigation_panel.jsx on lines 182..182
                  app/javascript/mastodon/features/ui/components/navigation_panel.jsx on lines 183..183

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

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

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

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

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

                  Refactorings

                  Further Reading

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

                  export default function meta(state = initialState, action) {
                    switch(action.type) {
                    case STORE_HYDRATE:
                      return state.merge(action.state.get('media_attachments'));
                    default:
                  Severity: Major
                  Found in app/javascript/mastodon/reducers/media_attachments.js and 1 other location - About 1 hr to fix
                  app/javascript/flavours/glitch/reducers/media_attachments.js on lines 9..16

                  Duplicated Code

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

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

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

                  Tuning

                  This issue has a mass of 56.

                  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 severityMessages = {
                    silence: {
                      title: messages.silenced,
                      explanation: messages.silencedExplanation,
                    },
                  Severity: Major
                  Found in app/javascript/flavours/glitch/features/about/index.jsx and 1 other location - About 1 hr to fix
                  app/javascript/mastodon/features/about/index.jsx on lines 33..43

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

                  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 severityMessages = {
                    silence: {
                      title: messages.silenced,
                      explanation: messages.silencedExplanation,
                    },
                  Severity: Major
                  Found in app/javascript/mastodon/features/about/index.jsx and 1 other location - About 1 hr to fix
                  app/javascript/flavours/glitch/features/about/index.jsx on lines 33..43

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

                  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