glitch-soc/mastodon

View on GitHub

Showing 1,278 of 4,906 total issues

Function checkCanvasReliability has 33 lines of code (exceeds 25 allowed). Consider refactoring.
Open

const checkCanvasReliability = () => new Promise((resolve, reject) => {
  switch(_browser_quirks['canvas-read-unreliable']) {
  case true:
    reject('Canvas reading unreliable');
    break;
Severity: Minor
Found in app/javascript/flavours/glitch/utils/resize_image.js - About 1 hr to fix

    Function isLinkMisleading has 33 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    const isLinkMisleading = (link) => {
      let linkTextParts = [];
    
      // Reconstruct visible text, as we do not have much control over how links
      // from remote software look, and we can't rely on `innerText` because the
    Severity: Minor
    Found in app/javascript/flavours/glitch/components/status_content.jsx - About 1 hr to fix

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

        render () {
          const { announcements, intl } = this.props;
          const { index } = this.state;
      
          if (announcements.isEmpty()) {

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

          render () {
            const { intl, hasUnread, columnId, multiColumn, onlyMedia } = this.props;
            const pinned = !!columnId;
        
            return (

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

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

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

              render () {
                const { alt, lang, src, width, height, onClick, zoomedIn } = this.props;
                const { loading } = this.state;
            
                const className = classNames('image-loader', {

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

                render () {
                  const { intl, onPickEmoji, onSkinTone, skinTone, frequentlyUsedEmojis } = this.props;
                  const title = intl.formatMessage(messages.emoji);
                  const { active, loading, placement } = this.state;
              
              

                Function onChange has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                  onChange (path, checked) {
                    if (path[0] === 'push') {
                      if (checked && typeof window.Notification !== 'undefined' && Notification.permission !== 'granted') {
                        dispatch(requestBrowserPermission((permission) => {
                          if (permission === 'granted') {

                  Function settings has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  export default function settings(state = initialState, action) {
                    switch(action.type) {
                    case STORE_HYDRATE:
                      return hydrate(state, action.state.get('settings'));
                    case NOTIFICATIONS_FILTER_SET:
                  Severity: Minor
                  Found in app/javascript/flavours/glitch/reducers/settings.js - About 1 hr to fix

                    Function onChange has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                      onChange (path, checked) {
                        if (path[0] === 'push') {
                          if (checked && typeof window.Notification !== 'undefined' && Notification.permission !== 'granted') {
                            dispatch(requestBrowserPermission((permission) => {
                              if (permission === 'granted') {

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

                        render () {
                          const { announcements, intl } = this.props;
                          const { index } = this.state;
                      
                          if (announcements.isEmpty()) {

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

                          render () {
                            const { alt, lang, src, width, height, onClick, zoomedIn } = this.props;
                            const { loading } = this.state;
                        
                            const className = classNames('image-loader', {
                        Severity: Minor
                        Found in app/javascript/mastodon/features/ui/components/image_loader.jsx - About 1 hr to fix

                          Function settings has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                          export default function settings(state = initialState, action) {
                            switch(action.type) {
                            case STORE_HYDRATE:
                              return hydrate(state, action.state.get('settings'));
                            case NOTIFICATIONS_FILTER_SET:
                          Severity: Minor
                          Found in app/javascript/mastodon/reducers/settings.js - About 1 hr to fix

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

                              render () {
                                const { intl, onPickEmoji, onSkinTone, skinTone, frequentlyUsedEmojis } = this.props;
                                const title = intl.formatMessage(messages.emoji);
                                const { active, loading, placement } = this.state;
                            
                            

                              Method attempt_oembed has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                def attempt_oembed
                                  service         = FetchOEmbedService.new
                                  url_domain      = Addressable::URI.parse(@url).normalized_host
                                  cached_endpoint = Rails.cache.read("oembed_endpoint:#{url_domain}")
                              
                              
                              Severity: Minor
                              Found in app/services/fetch_link_card_service.rb - About 1 hr to fix

                                Method parallelize_with_progress has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                    def parallelize_with_progress(scope)
                                      fail_with_message 'Cannot run with this concurrency setting, must be at least 1' if options[:concurrency] < 1
                                
                                      reset_connection_pools!
                                
                                
                                Severity: Minor
                                Found in lib/mastodon/cli/progress_helper.rb - About 1 hr to fix

                                  Method create has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                      def create(username)
                                        role_id  = nil
                                  
                                        if options[:role]
                                          role = UserRole.find_by(name: options[:role])
                                  Severity: Minor
                                  Found in lib/mastodon/cli/accounts.rb - About 1 hr to fix

                                    Method import has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                        def import(path)
                                          imported = 0
                                          skipped  = 0
                                          failed   = 0
                                          category = options[:category] ? CustomEmojiCategory.find_or_create_by(name: options[:category]) : nil
                                    Severity: Minor
                                    Found in lib/mastodon/cli/emoji.rb - About 1 hr to fix

                                      Function handleContentRef has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                                      Open

                                          (node: HTMLDivElement | null) => {
                                            if (!node) {
                                              return;
                                            }
                                      
                                      

                                        Function handleContentRef has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                                        Open

                                            (node: HTMLDivElement | null) => {
                                              if (!node) {
                                                return;
                                              }
                                        
                                        
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language