mashirozx/mastodon

View on GitHub

Showing 1,785 of 1,785 total issues

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

  render () {
    const { intl, hidden, account, onAuthorize, onReject } = this.props;

    if (!account) {
      return <div />;

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

      render () {
        const { announcement } = this.props;
        const { unread } = this.state;
        const startsAt = announcement.get('starts_at') && new Date(announcement.get('starts_at'));
        const endsAt = announcement.get('ends_at') && new Date(announcement.get('ends_at'));

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

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

        Function renderStatus has 26 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          renderStatus (notification, link) {
            const { intl, unread } = this.props;
        
            return (
              <HotKeys handlers={this.getHandlers()}>

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

            render () {
              const { account, submitted } = this.props;
          
              return (
                <React.Fragment>
          Severity: Minor
          Found in app/javascript/mastodon/features/report/thanks.js - About 1 hr to fix

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

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

              Function renderFavourite has 26 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                renderFavourite (notification, link) {
                  const { intl, unread } = this.props;
              
                  return (
                    <HotKeys handlers={this.getHandlers()}>

                Method privatize_media_attachments! has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                  def privatize_media_attachments!
                    attachment_names = MediaAttachment.attachment_definitions.keys
                
                    @account.media_attachments.find_each do |media_attachment|
                      attachment_names.each do |attachment_name|
                Severity: Minor
                Found in app/services/suspend_account_service.rb - About 1 hr to fix

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

                    def call(uri, id: true, prefetched_body: nil, on_behalf_of: nil)
                      @json = begin
                        if prefetched_body.nil?
                          fetch_resource(uri, id, on_behalf_of)
                        else
                  Severity: Minor
                  Found in app/services/activitypub/fetch_remote_status_service.rb - About 1 hr to fix

                    Method publish_media_attachments! has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                      def publish_media_attachments!
                        attachment_names = MediaAttachment.attachment_definitions.keys
                    
                        @account.media_attachments.find_each do |media_attachment|
                          attachment_names.each do |attachment_name|
                    Severity: Minor
                    Found in app/services/unsuspend_account_service.rb - About 1 hr to fix

                      Method export has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          def export(path)
                            exported         = 0
                            category         = CustomEmojiCategory.find_by(name: options[:category])
                            export_file_name = File.join(path, 'export.tar.gz')
                      
                      
                      Severity: Minor
                      Found in lib/mastodon/emoji_cli.rb - About 1 hr to fix

                        Method add has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            def add(*addresses)
                              if addresses.empty?
                                say('No IP(s) given', :red)
                                exit(1)
                              end
                        Severity: Minor
                        Found in lib/mastodon/ip_blocks_cli.rb - About 1 hr to fix

                          Consider simplifying this complex logical expression.
                          Open

                              } else if (isLoading || childrenCount > 0 || numPending > 0 || hasMore || !emptyMessage) {
                                scrollableArea = (
                                  <div className={classNames('scrollable', { fullscreen })} ref={this.setRef} onMouseMove={this.handleMouseMove}>
                                    <div role='feed' className='item-list'>
                                      {prepend}
                          Severity: Major
                          Found in app/javascript/mastodon/components/scrollable_list.js - About 1 hr to fix

                            Consider simplifying this complex logical expression.
                            Open

                                if current_account_id.nil?
                                  @reblogs_map    = {}
                                  @favourites_map = {}
                                  @bookmarks_map  = {}
                                  @mutes_map      = {}
                            Severity: Major
                            Found in app/presenters/status_relationships_presenter.rb - About 1 hr to fix

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

                                  const custom = [
                                    {
                                      id: 'mastodon',
                                      name: 'mastodon',
                                      short_names: ['mastodon'],
                              app/javascript/mastodon/features/emoji/__tests__/emoji_index-test.js on lines 53..64
                              app/javascript/mastodon/features/emoji/__tests__/emoji_index-test.js on lines 99..110

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

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

                                  const custom = [
                                    {
                                      id: 'mastodon',
                                      name: 'mastodon',
                                      short_names: ['mastodon'],
                              app/javascript/mastodon/features/emoji/__tests__/emoji_index-test.js on lines 53..64
                              app/javascript/mastodon/features/emoji/__tests__/emoji_index-test.js on lines 79..90

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

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

                                  const custom = [
                                    {
                                      id: 'mastodon',
                                      name: 'mastodon',
                                      short_names: ['mastodon'],
                              app/javascript/mastodon/features/emoji/__tests__/emoji_index-test.js on lines 79..90
                              app/javascript/mastodon/features/emoji/__tests__/emoji_index-test.js on lines 99..110

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

                              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

                              export function addColumn(id, params) {
                                return dispatch => {
                                  dispatch({
                                    type: COLUMN_ADD,
                                    id,
                              Severity: Major
                              Found in app/javascript/mastodon/actions/columns.js and 2 other locations - About 1 hr to fix
                              app/javascript/mastodon/actions/columns.js on lines 31..41
                              app/javascript/mastodon/actions/settings.js on lines 8..18

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

                              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

                                          <NavLink exact to={`/@${account.get('acct')}`}><FormattedMessage id='account.posts' defaultMessage='Posts' /></NavLink>
                              app/javascript/mastodon/features/account_timeline/components/header.js on lines 127..127
                              app/javascript/mastodon/features/account_timeline/components/header.js on lines 128..128

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

                              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

                              export function moveColumn(uuid, direction) {
                                return dispatch => {
                                  dispatch({
                                    type: COLUMN_MOVE,
                                    uuid,
                              Severity: Major
                              Found in app/javascript/mastodon/actions/columns.js and 2 other locations - About 1 hr to fix
                              app/javascript/mastodon/actions/columns.js on lines 8..18
                              app/javascript/mastodon/actions/settings.js on lines 8..18

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

                              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