glitch-soc/mastodon

View on GitHub

Showing 4,938 of 4,938 total issues

Function Follows has 35 lines of code (exceeds 25 allowed). Consider refactoring.
Open

export const Follows = () => {
  const dispatch = useDispatch();
  const isLoading = useAppSelector(state => state.getIn(['suggestions', 'isLoading']));
  const suggestions = useAppSelector(state => state.getIn(['suggestions', 'items']));

Severity: Minor
Found in app/javascript/flavours/glitch/features/onboarding/follows.jsx - About 1 hr to fix

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

      render () {
        const { handleClick } = this;
        const {
          active,
          className,

      Function onReceive has 35 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

            onReceive(data) {
              switch (data.event) {
              case 'update':
                // @ts-expect-error
                dispatch(updateTimeline(timelineId, JSON.parse(data.payload), options.accept));
      Severity: Minor
      Found in app/javascript/mastodon/actions/streaming.js - About 1 hr to fix

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

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

          Function makeGetStatus has 35 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          export const makeGetStatus = () => {
            return createSelector(
              [
                (state, { id }) => state.getIn(['statuses', id]),
                (state, { id }) => state.getIn(['statuses', state.getIn(['statuses', id, 'reblog'])]),
          Severity: Minor
          Found in app/javascript/mastodon/selectors/index.js - About 1 hr to fix

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

              render () {
                const { intl, hashtags, isLoading, hasMore, multiColumn } = this.props;
            
                const emptyMessage = <FormattedMessage id='empty_column.followed_tags' defaultMessage='You have not followed any hashtags yet. When you do, they will show up here.' />;
            
            
            Severity: Minor
            Found in app/javascript/mastodon/features/followed_tags/index.jsx - About 1 hr to fix

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

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

                Function Follows has 35 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                export const Follows = () => {
                  const dispatch = useDispatch();
                  const isLoading = useAppSelector(state => state.getIn(['suggestions', 'isLoading']));
                  const suggestions = useAppSelector(state => state.getIn(['suggestions', 'items']));
                
                
                Severity: Minor
                Found in app/javascript/mastodon/features/onboarding/follows.jsx - About 1 hr to fix

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

                    render () {
                      const { errorType, multiColumn, stacktrace } = this.props;
                  
                      let title, body;
                  
                  

                    Method call has 35 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                      def call(row)
                        @account = row.bulk_import.account
                        @data    = row.data
                        @type    = row.bulk_import.type.to_sym
                    
                    
                    Severity: Minor
                    Found in app/services/bulk_import_row_service.rb - About 1 hr to fix

                      Method initialize has 35 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          def initialize(prefix, operator, term, options = {})
                            @prefix = prefix
                            @negated = operator == '-'
                            @options = options
                            @operator = :filter
                      Severity: Minor
                      Found in app/lib/search_query_transformer.rb - About 1 hr to fix

                        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

                        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 === 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 === 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 === 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

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

                          onInteractionModal (account) {
                            dispatch(openModal({
                              modalType: 'INTERACTION',
                              modalProps: {
                                type: 'follow',
                        app/javascript/mastodon/features/account_timeline/containers/header_container.jsx on lines 48..57

                        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

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

                        const darkEmoji = emojiFilenames(['๐ŸŽฑ', '๐Ÿœ', 'โšซ', '๐Ÿ–ค', 'โฌ›', 'โ—ผ๏ธ', 'โ—พ', 'โ—ผ๏ธ', 'โœ’๏ธ', 'โ–ช๏ธ', '๐Ÿ’ฃ', '๐ŸŽณ', '๐Ÿ“ท', '๐Ÿ“ธ', 'โ™ฃ๏ธ', '๐Ÿ•ถ๏ธ', 'โœด๏ธ', '๐Ÿ”Œ', '๐Ÿ’‚โ€โ™€๏ธ', '๐Ÿ“ฝ๏ธ', '๐Ÿณ', '๐Ÿฆ', '๐Ÿ’‚', '๐Ÿ”ช', '๐Ÿ•ณ๏ธ', '๐Ÿ•น๏ธ', '๐Ÿ•‹', '๐Ÿ–Š๏ธ', '๐Ÿ–‹๏ธ', '๐Ÿ’‚โ€โ™‚๏ธ', '๐ŸŽค', '๐ŸŽ“', '๐ŸŽฅ', '๐ŸŽผ', 'โ™ ๏ธ', '๐ŸŽฉ', '๐Ÿฆƒ', '๐Ÿ“ผ', '๐Ÿ“น', '๐ŸŽฎ', '๐Ÿƒ', '๐Ÿด', '๐Ÿž', '๐Ÿ•บ', '๐Ÿ“ฑ', '๐Ÿ“ฒ', '๐Ÿšฒ', '๐Ÿชฎ', '๐Ÿฆโ€โฌ›']);
                        Severity: Major
                        Found in app/javascript/flavours/glitch/features/emoji/emoji.js and 1 other location - About 1 hr to fix
                        app/javascript/mastodon/features/emoji/emoji.js on lines 17..17

                        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

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

                          const handleDragEnd = useCallback(() => {
                            dispatch(changeMediaOrder(dragItem.current, dragOverItem.current));
                            dragItem.current = null;
                            dragOverItem.current = null;
                          }, [dispatch, dragItem, dragOverItem]);
                        app/javascript/flavours/glitch/features/compose/components/upload_form.jsx on lines 29..33

                        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

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

                          static propTypes = {
                            params: PropTypes.object.isRequired,
                            dispatch: PropTypes.func.isRequired,
                            lists: ImmutablePropTypes.list,
                            intl: PropTypes.object.isRequired,
                        Severity: Major
                        Found in app/javascript/mastodon/features/lists/index.jsx and 1 other location - About 1 hr to fix
                        app/javascript/flavours/glitch/features/lists/index.jsx on lines 41..47

                        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

                        Severity
                        Category
                        Status
                        Source
                        Language