Showing 165 of 175 total issues

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

import { h, Component } from 'preact';
import PropTypes from 'prop-types';
import { setupPusher } from '../utilities/connect';
import { notifyUser } from '../utilities/connect/newMessageNotify';
import { debounceAction } from '../utilities/debounceAction';
Severity: Major
Found in app/javascript/chat/chat.jsx - About 5 days to fix

    Function initializePodcastPlayback has 498 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 89 functions (exceeds 20 allowed). Consider refactoring.
      Open

      export 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

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

        function buildArticleHTML(article) {
          if (article && article.class_name === 'PodcastEpisode') {
            return `<article class="crayons-story crayons-podcast-episode mb-2">
                <div class="crayons-story__body flex flex-start">
                  <a href="${article.podcast.slug}" class="crayons-podcast-episode__cover">
        Severity: Major
        Found in app/assets/javascripts/utilities/buildArticleHTML.js - About 1 day to fix

          Class User has 71 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

            File user.rb has 539 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

              File initializePodcastPlayback.js has 501 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: Major
              Found in app/assets/javascripts/initializers/initializePodcastPlayback.js - About 1 day to fix

                Function render has 187 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 tags.jsx has 410 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 409 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

                      File initScrolling.js has 406 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 stories_controller.rb has 403 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
                        Severity: Minor
                        Found in app/controllers/stories_controller.rb - About 5 hrs to fix

                          Class Comment has 42 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

                            Function initializeVideoPlayback has 164 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 StoriesController has 38 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
                              Severity: Minor
                              Found in app/controllers/stories_controller.rb - About 5 hrs to fix

                                File actionsPanel.js has 362 lines of code (exceeds 250 allowed). Consider refactoring.
                                Open

                                import { toggleFlagUserModal } from '../packs/flagUserModal';
                                import { request } from '@utilities/http';
                                
                                export function addCloseListener() {
                                  const button = document.getElementsByClassName('close-actions-panel')[0];
                                Severity: Minor
                                Found in app/javascript/actionsPanel/actionsPanel.js - 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

                                    File articleForm.jsx has 348 lines of code (exceeds 250 allowed). Consider refactoring.
                                    Open

                                    import { h, Component } from 'preact';
                                    import PropTypes from 'prop-types';
                                    import linkState from 'linkstate';
                                    import postscribe from 'postscribe';
                                    import { KeyboardShortcuts } from '../shared/components/useKeyboardShortcuts';
                                    Severity: Minor
                                    Found in app/javascript/article-form/articleForm.jsx - About 4 hrs to fix

                                      File site_config.rb has 347 lines of code (exceeds 250 allowed). Consider refactoring.
                                      Open

                                      module Constants
                                        module SiteConfig
                                          IMAGE_PLACEHOLDER = "https://url/image.png".freeze
                                          SVG_PLACEHOLDER = "<svg ...></svg>".freeze
                                      
                                      
                                      Severity: Minor
                                      Found in app/lib/constants/site_config.rb - About 4 hrs to fix

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

                                          render() {
                                            const {
                                              slidesCount,
                                              currentSlideIndex,
                                              prev,
                                        Severity: Major
                                        Found in app/javascript/onboarding/components/IntroSlide.jsx - About 4 hrs to fix
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language