thepracticaldev/dev.to

View on GitHub

Showing 151 of 151 total issues

File chat.jsx has 1791 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/*
  eslint-disable
  consistent-return, no-unused-vars, react/destructuring-assignment,
  react/no-access-state-in-setstate, react/button-has-type
*/
Severity: Major
Found in app/javascript/chat/chat.jsx - About 4 days to fix

    Function initializePodcastPlayback has 492 lines of code (exceeds 50 allowed). Consider refactoring.
    Open

    function initializePodcastPlayback() {
      var deviceType = 'web';
    
      function getById(name) {
        return document.getElementById(name);
    Severity: Major
    Found in app/assets/javascripts/initializers/initializePodcastPlayback.js - About 2 days to fix

      Chat has 82 functions (exceeds 20 allowed). Consider refactoring.
      Open

      export default class Chat extends Component {
        static propTypes = {
          pusherKey: PropTypes.number.isRequired,
          chatChannels: PropTypes.string.isRequired,
          chatOptions: PropTypes.string.isRequired,
      Severity: Major
      Found in app/javascript/chat/chat.jsx - About 1 day to fix

        Class User has 81 methods (exceeds 20 allowed). Consider refactoring.
        Open

        class User < ApplicationRecord
          resourcify
        
          include CloudinaryHelper
          include Searchable
        Severity: Major
        Found in app/models/user.rb - About 1 day to fix

          Function buildArticleHTML has 303 lines of code (exceeds 50 allowed). Consider refactoring.
          Open

          function buildArticleHTML(article) {
            if (article && article.class_name === 'PodcastEpisode') {
              return (
                '<div class="single-article single-article-small-pic single-article-single-podcast">\
                <div class="small-pic">\
          Severity: Major
          Found in app/assets/javascripts/utilities/buildArticleHTML.js - About 1 day to fix

            File user.rb has 562 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            class User < ApplicationRecord
              resourcify
            
              include CloudinaryHelper
              include Searchable
            Severity: Major
            Found in app/models/user.rb - About 1 day to fix

              Class Article has 63 methods (exceeds 20 allowed). Consider refactoring.
              Open

              class Article < ApplicationRecord
                include CloudinaryHelper
                include ActionView::Helpers
                include Storext.model
                include Reactable
              Severity: Major
              Found in app/models/article.rb - About 1 day to fix

                File article.rb has 525 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                class Article < ApplicationRecord
                  include CloudinaryHelper
                  include ActionView::Helpers
                  include Storext.model
                  include Reactable
                Severity: Major
                Found in app/models/article.rb - About 1 day to fix

                  File initializePodcastPlayback.js has 495 lines of code (exceeds 250 allowed). Consider refactoring.
                  Open

                  /**
                   * This script hunts for podcast's "Record" for both the podcast_episde's
                   * show page and an article page containing podcast liquid tag. It handles
                   * playback and makes sure the record will spin when the podcast is currently
                   * playing.
                  Severity: Minor
                  Found in app/assets/javascripts/initializers/initializePodcastPlayback.js - About 7 hrs to fix

                    Function render has 189 lines of code (exceeds 50 allowed). Consider refactoring.
                    Open

                      render() {
                        const {
                          listings,
                          orgListings,
                          userCredits,
                    Severity: Major
                    Found in app/javascript/listings/listingDashboard.jsx - About 6 hrs to fix

                      File stories_controller.rb has 420 lines of code (exceeds 250 allowed). Consider refactoring.
                      Open

                      class StoriesController < ApplicationController
                        DEFAULT_HOME_FEED_ATTRIBUTES_FOR_SERIALIZATION = {
                          only: %i[
                            title path id user_id comments_count public_reactions_count organization_id
                            reading_time video_thumbnail_url video video_duration_in_minutes language
                      Severity: Minor
                      Found in app/controllers/stories_controller.rb - About 6 hrs to fix

                        File initScrolling.js has 415 lines of code (exceeds 250 allowed). Consider refactoring.
                        Open

                        /* global insertAfter, insertArticles, buildArticleHTML, nextPage:writable, fetching:writable, done:writable, InstantClick */
                        
                        var client;
                        
                        function fetchNext(el, endpoint, insertCallback) {
                        Severity: Minor
                        Found in app/assets/javascripts/initializers/initScrolling.js - About 5 hrs to fix

                          File tags.jsx has 405 lines of code (exceeds 250 allowed). Consider refactoring.
                          Open

                          import { h, Component } from 'preact';
                          import PropTypes from 'prop-types';
                          import { fetchSearch } from '../../utilities/search';
                          
                          const KEYS = {
                          Severity: Minor
                          Found in app/javascript/shared/components/tags.jsx - About 5 hrs to fix

                            File ChatChannelSettings.jsx has 403 lines of code (exceeds 250 allowed). Consider refactoring.
                            Open

                            import { h, Component } from 'preact';
                            import PropTypes from 'prop-types';
                            
                            import {
                              getChannelDetails,
                            Severity: Minor
                            Found in app/javascript/chat/ChatChannelSettings/ChatChannelSettings.jsx - About 5 hrs to fix

                              Class Comment has 40 methods (exceeds 20 allowed). Consider refactoring.
                              Open

                              class Comment < ApplicationRecord
                                has_ancestry
                                resourcify
                              
                                include Reactable
                              Severity: Minor
                              Found in app/models/comment.rb - About 5 hrs to fix

                                Class StoriesController has 40 methods (exceeds 20 allowed). Consider refactoring.
                                Open

                                class StoriesController < ApplicationController
                                  DEFAULT_HOME_FEED_ATTRIBUTES_FOR_SERIALIZATION = {
                                    only: %i[
                                      title path id user_id comments_count public_reactions_count organization_id
                                      reading_time video_thumbnail_url video video_duration_in_minutes language
                                Severity: Minor
                                Found in app/controllers/stories_controller.rb - About 5 hrs to fix

                                  Function initializeVideoPlayback has 158 lines of code (exceeds 50 allowed). Consider refactoring.
                                  Open

                                  function initializeVideoPlayback() {
                                    var currentTime = '0';
                                    var deviceType = 'web';
                                    var lastEvent = '';
                                  
                                  
                                  Severity: Major
                                  Found in app/assets/javascripts/initializers/initializeVideoPlayback.js - About 5 hrs to fix

                                    Class Feed has 37 methods (exceeds 20 allowed). Consider refactoring.
                                    Open

                                      class Feed
                                        RANDOM_OFFSET_VALUES = [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 3, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13].freeze
                                    
                                        def initialize(user: nil, number_of_articles: 35, page: 1, tag: nil)
                                          @user = user
                                    Severity: Minor
                                    Found in app/services/articles/feed.rb - About 4 hrs to fix

                                      Class UsersController has 36 methods (exceeds 20 allowed). Consider refactoring.
                                      Open

                                      class UsersController < ApplicationController
                                        before_action :set_no_cache_header
                                        before_action :raise_suspended, only: %i[update]
                                        before_action :set_user, only: %i[
                                          update update_twitch_username update_language_settings confirm_destroy request_destroy full_delete remove_identity
                                      Severity: Minor
                                      Found in app/controllers/users_controller.rb - About 4 hrs to fix

                                        Function render has 141 lines of code (exceeds 50 allowed). Consider refactoring.
                                        Open

                                          render() {
                                            const { showOptions, subscriptionType, subscribed } = this.state;
                                            const {
                                              onSubscribe,
                                              onUnsubscribe,
                                        Severity: Major
                                        Found in app/javascript/CommentSubscription/CommentSubscription.jsx - About 4 hrs to fix
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language