mashirozx/mastodon

View on GitHub

Showing 1,785 of 1,785 total issues

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

  render () {
    const { poll, intl } = this.props;
    const { expired } = this.state;

    if (!poll) {
Severity: Minor
Found in app/javascript/mastodon/components/poll.js - About 1 hr to fix

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

      render () {
        const { intl, statusIds, columnId, multiColumn, hasMore, isLoading } = this.props;
        const pinned = !!columnId;
    
        const emptyMessage = <FormattedMessage id='empty_column.bookmarked_statuses' defaultMessage="You don't have any bookmarked posts yet. When you bookmark one, it will show up here." />;
    Severity: Minor
    Found in app/javascript/mastodon/features/bookmarked_statuses/index.js - About 1 hr to fix

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

      const dropOrientationIfNeeded = (orientation) => new Promise(resolve => {
        switch (_browser_quirks['image-orientation-automatic']) {
        case true:
          resolve(1);
          break;
      Severity: Minor
      Found in app/javascript/mastodon/utils/resize_image.js - About 1 hr to fix

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

          render () {
            const { items, style, placement, arrowOffsetLeft, arrowOffsetTop, scrollable, renderHeader, loading } = this.props;
            const { mounted } = this.state;
        
            let renderItem = this.props.renderItem || this.renderItem;
        Severity: Minor
        Found in app/javascript/mastodon/components/dropdown_menu.js - About 1 hr to fix

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

            render () {
              const { intl, statusIds, columnId, multiColumn, hasMore, isLoading } = this.props;
              const pinned = !!columnId;
          
              const emptyMessage = <FormattedMessage id='empty_column.favourited_statuses' defaultMessage="You don't have any favourite posts yet. When you favourite one, it will show up here." />;
          Severity: Minor
          Found in app/javascript/mastodon/features/favourited_statuses/index.js - 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 render has 27 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                render () {
                  const { notification } = this.props;
                  const account          = notification.get('account');
                  const displayNameHtml  = { __html: account.get('display_name_html') };
                  const link             = <bdi><Permalink className='notification__display-name' href={account.get('url')} title={account.get('acct')} to={`/@${account.get('acct')}`} dangerouslySetInnerHTML={displayNameHtml} /></bdi>;

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

                  render () {
                    const { intl, hasUnread, columnId, multiColumn, onlyMedia } = this.props;
                    const pinned = !!columnId;
                
                    return (
                Severity: Minor
                Found in app/javascript/mastodon/features/community_timeline/index.js - About 1 hr to fix

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

                    render () {
                      const { comment, isRemote, forward, domain, isSubmitting, intl } = this.props;
                  
                      return (
                        <React.Fragment>
                  Severity: Minor
                  Found in app/javascript/mastodon/features/report/comment.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/mastodon/reducers/timelines.js - 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 show has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                          def show
                            unless ENV['TRANSLATION_SERVER_HOST']
                              render json: { 'message' => 'TRANSLATION_SERVER_HOST not found in ENV'}, status:400
                              return
                            end
                        Severity: Minor
                        Found in app/controllers/translation_controller.rb - 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

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

                                    <Link to={`/@${status.getIn(['account', 'acct'])}/${status.get('id')}/favourites`} className='detailed-status__link'>
                                      <Icon id='star' />
                                      <span className='detailed-status__favorites'>
                                        <AnimatedNumber value={status.get('favourites_count')} />
                                      </span>
                            app/javascript/mastodon/features/status/components/detailed_status.js on lines 349..354

                            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

                                    menu.push({ text: intl.formatMessage(status.get('pinned') ? messages.unpin : messages.pin), action: this.handlePinClick });
                            app/javascript/mastodon/components/status_action_bar.js on lines 273..273
                            app/javascript/mastodon/components/status_action_bar.js on lines 276..276
                            app/javascript/mastodon/features/direct_timeline/components/conversation.js on lines 127..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 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

                                menu.push({ text: intl.formatMessage(lastStatus.get('muted') ? messages.unmuteConversation : messages.muteConversation), action: this.handleConversationMute });
                            app/javascript/mastodon/components/status_action_bar.js on lines 273..273
                            app/javascript/mastodon/components/status_action_bar.js on lines 276..276
                            app/javascript/mastodon/features/status/components/action_bar.js on lines 222..222

                            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

                                    <a href={`/interact/${status.get('id')}?type=favourite`} className='detailed-status__link' onClick={this.handleModalLink}>
                                      <Icon id='star' />
                                      <span className='detailed-status__favorites'>
                                        <AnimatedNumber value={status.get('favourites_count')} />
                                      </span>
                            app/javascript/mastodon/features/status/components/detailed_status.js on lines 340..345

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

                              new CacheFirst({
                                cacheName: `m${CACHE_NAME_PREFIX}media`,
                                plugins: [
                                  new ExpirationPlugin({
                                    maxAgeSeconds: 7 * 24 * 60 * 60, // 1 week
                            Severity: Major
                            Found in app/javascript/mastodon/service_worker/entry.js and 2 other locations - About 1 hr to fix
                            app/javascript/mastodon/service_worker/entry.js on lines 21..29
                            app/javascript/mastodon/service_worker/entry.js on lines 34..42

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

                              new CacheFirst({
                                cacheName: `${CACHE_NAME_PREFIX}locales`,
                                plugins: [
                                  new ExpirationPlugin({
                                    maxAgeSeconds: 30 * 24 * 60 * 60, // 1 month
                            Severity: Major
                            Found in app/javascript/mastodon/service_worker/entry.js and 2 other locations - About 1 hr to fix
                            app/javascript/mastodon/service_worker/entry.js on lines 34..42
                            app/javascript/mastodon/service_worker/entry.js on lines 47..55

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

                              new CacheFirst({
                                cacheName: `${CACHE_NAME_PREFIX}fonts`,
                                plugins: [
                                  new ExpirationPlugin({
                                    maxAgeSeconds: 30 * 24 * 60 * 60, // 1 month
                            Severity: Major
                            Found in app/javascript/mastodon/service_worker/entry.js and 2 other locations - About 1 hr to fix
                            app/javascript/mastodon/service_worker/entry.js on lines 21..29
                            app/javascript/mastodon/service_worker/entry.js on lines 47..55

                            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