thepracticaldev/dev.to

View on GitHub

Showing 350 of 350 total issues

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

import { h, Component } from 'preact';
import PropTypes from 'prop-types';
import ConfigImage from '../../assets/images/three-dots.svg';
import {
  conductModeration,
Severity: Major
Found in app/javascript/chat/chat.jsx - About 3 days to fix

    Function initializePodcastPlayback has 447 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

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

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

      class User < ApplicationRecord
        self.ignored_columns = ["organization_id"]
      
        include CloudinaryHelper
      
      
      Severity: Major
      Found in app/models/user.rb - About 1 day to fix

        Chat has 78 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

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

          class User < ApplicationRecord
            self.ignored_columns = ["organization_id"]
          
            include CloudinaryHelper
          
          
          Severity: Major
          Found in app/models/user.rb - About 1 day to fix

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

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

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

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

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

                  render() {
                    const {
                      listings,
                      query,
                      tags,
                Severity: Major
                Found in app/javascript/listings/listings.jsx - About 1 day to fix

                  File listings.jsx has 495 lines of code (exceeds 250 allowed). Consider refactoring.
                  Open

                  import { h, Component } from 'preact';
                  import debounceAction from '../src/utils/debounceAction';
                  import { fetchSearch } from '../src/utils/search';
                  import SingleListing from './singleListing';
                  
                  
                  Severity: Minor
                  Found in app/javascript/listings/listings.jsx - About 7 hrs to fix

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

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

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

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

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

                          render() {
                            // cover image url should asking for url OR providing option to upload an image
                            const {
                              title,
                              tagList,
                        Severity: Major
                        Found in app/javascript/article-form/articleForm.jsx - About 7 hrs to fix

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

                          'use strict'
                          
                          /**
                           * 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
                          Severity: Minor
                          Found in app/assets/javascripts/initializers/initializePodcastPlayback.js - About 6 hrs to fix

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

                              render() {
                                const { previousLocation, variant } = this.props;
                            
                                const previousLocationListElement = () => {
                                  if (variant === '6' || variant === '8') {
                            Severity: Major
                            Found in app/javascript/onboarding/components/ClosingSlide.jsx - About 6 hrs to fix

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

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

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

                                  render() {
                                    const channel = this.props.channel; // eslint-disable-line
                                    const users = Object.values(channel.channel_users).map(user => (
                                      <div className="channeldetails__user">
                                        <img
                                Severity: Major
                                Found in app/javascript/chat/channelDetails.jsx - About 5 hrs to fix

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

                                  class Comment < ApplicationRecord
                                    TITLE_DELETED = "[deleted]".freeze
                                    TITLE_HIDDEN = "[hidden by post author]".freeze
                                  
                                    has_ancestry
                                  Severity: Minor
                                  Found in app/models/comment.rb - About 4 hrs to fix

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

                                      render() {
                                        const { onExit, mainImage, version } = this.props;
                                        const { insertionImageUrls, uploadError, uploadErrorMessage } = this.state;
                                        let mainImageArea;
                                    
                                    
                                    Severity: Major
                                    Found in app/javascript/article-form/elements/imageManagement.jsx - About 4 hrs to fix

                                      Function nextStepLinks has 113 lines of code (exceeds 25 allowed). Consider refactoring.
                                      Open

                                          const nextStepLinks = () => {
                                            if (variant === '7' || variant === '8') {
                                              return (
                                                <div className="onboarding-what-next">
                                                  <a
                                      Severity: Major
                                      Found in app/javascript/onboarding/components/ClosingSlide.jsx - About 4 hrs to fix

                                        Class Feed has 33 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
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language