glitch-soc/mastodon

View on GitHub

Showing 1,278 of 4,906 total issues

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

  render () {
    const { isLoading, links } = this.props;

    const banner = (
      <DismissableBanner id='explore/links'>
Severity: Minor
Found in app/javascript/flavours/glitch/features/explore/links.jsx - About 1 hr to fix

    Function ColumnSettings has 38 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    const ColumnSettings = () => {
      const intl = useIntl();
      const dispatch = useAppDispatch();
      const settings = useAppSelector((state) => state.getIn(['settings', 'firehose']));
      const onChange = useCallback(
    Severity: Minor
    Found in app/javascript/flavours/glitch/features/firehose/index.jsx - About 1 hr to fix

      Function announcementsReducer has 38 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      export default function announcementsReducer(state = initialState, action) {
        switch(action.type) {
        case ANNOUNCEMENTS_TOGGLE_SHOW:
          return state.withMutations(map => {
            map.set('show', !map.get('show'));
      Severity: Minor
      Found in app/javascript/flavours/glitch/reducers/announcements.js - About 1 hr to fix

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

          render () {
            const { isLoading, links } = this.props;
        
            const banner = (
              <DismissableBanner id='explore/links'>
        Severity: Minor
        Found in app/javascript/mastodon/features/explore/links.jsx - About 1 hr to fix

          Function announcementsReducer has 38 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          export default function announcementsReducer(state = initialState, action) {
            switch(action.type) {
            case ANNOUNCEMENTS_TOGGLE_SHOW:
              return state.withMutations(map => {
                map.set('show', !map.get('show'));
          Severity: Minor
          Found in app/javascript/mastodon/reducers/announcements.js - About 1 hr to fix

            Method initialize has 38 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

              def initialize
                @flavours = {}
            
                Rails.root.glob('app/javascript/flavours/*/theme.yml') do |pathname|
                  data = YAML.load_file(pathname)
            Severity: Minor
            Found in app/lib/themes.rb - About 1 hr to fix

              Method remove_statuses has 38 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  def remove_statuses
                    return if options[:skip_status_remove]
              
                    start_at = Time.now.to_f
              
              
              Severity: Minor
              Found in lib/mastodon/cli/statuses.rb - About 1 hr to fix

                Function EditIndicator has 37 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                export const EditIndicator = () => {
                  const intl = useIntl();
                  const dispatch = useDispatch();
                  const id = useSelector(state => state.getIn(['compose', 'id']));
                  const status = useSelector(state => state.getIn(['statuses', id]));

                  Function SignInBanner has 37 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  const SignInBanner = () => {
                    const dispatch = useAppDispatch();
                  
                    const openClosedRegistrationsModal = useCallback(
                      () => dispatch(openModal({ modalType: 'CLOSED_REGISTRATIONS' })),

                    Function EditIndicator has 37 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    export const EditIndicator = () => {
                      const intl = useIntl();
                      const dispatch = useDispatch();
                      const id = useSelector(state => state.getIn(['compose', 'id']));
                      const status = useSelector(state => state.getIn(['statuses', id]));

                      Function SignInBanner has 37 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                      const SignInBanner = () => {
                        const dispatch = useAppDispatch();
                      
                        const openClosedRegistrationsModal = useCallback(
                          () => dispatch(openModal({ modalType: 'CLOSED_REGISTRATIONS' })),
                      Severity: Minor
                      Found in app/javascript/mastodon/features/ui/components/sign_in_banner.jsx - About 1 hr to fix

                        Method configuration has 37 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                          def configuration
                            {
                              urls: {
                                streaming: Rails.configuration.x.streaming_api_base_url,
                                status: object.status_page_url,
                        Severity: Minor
                        Found in app/serializers/rest/instance_serializer.rb - About 1 hr to fix

                          Function handleKeyDown has 37 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              (e: React.KeyboardEvent) => {
                                switch (e.key) {
                                  case 'Escape':
                                    e.preventDefault();
                                    unfocus();

                            Function handleKeyDown has 37 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                (e: React.KeyboardEvent) => {
                                  switch (e.key) {
                                    case 'Escape':
                                      e.preventDefault();
                                      unfocus();
                            Severity: Minor
                            Found in app/javascript/mastodon/features/compose/components/search.tsx - About 1 hr to fix

                              Function makeGetStatus has 36 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                              export const makeGetStatus = () => {
                                return createSelector(
                                  [
                                    (state, { id }) => state.getIn(['statuses', id]),
                                    (state, { id }) => state.getIn(['statuses', state.getIn(['statuses', id, 'reblog'])]),
                              Severity: Minor
                              Found in app/javascript/flavours/glitch/selectors/index.js - About 1 hr to fix

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

                                  render () {
                                    const { value, suggestions, disabled, placeholder, onKeyUp, autoFocus, className, id, maxLength, lang, spellCheck } = this.props;
                                    const { suggestionsHidden } = this.state;
                                
                                    return (
                                Severity: Minor
                                Found in app/javascript/flavours/glitch/components/autosuggest_input.jsx - About 1 hr to fix

                                  Function onReceive has 36 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                        onReceive(data) {
                                          switch (data.event) {
                                          case 'update':
                                            // @ts-expect-error
                                            dispatch(updateTimeline(timelineId, JSON.parse(data.payload), options.accept));
                                  Severity: Minor
                                  Found in app/javascript/flavours/glitch/actions/streaming.js - About 1 hr to fix

                                    Function expandTimeline has 36 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                    export function expandTimeline(timelineId, path, params = {}) {
                                      return async (dispatch, getState) => {
                                        const timeline = getState().getIn(['timelines', timelineId], ImmutableMap());
                                        const isLoadingMore = !!params.max_id;
                                    
                                    
                                    Severity: Minor
                                    Found in app/javascript/flavours/glitch/actions/timelines.js - About 1 hr to fix

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

                                        render () {
                                          const { disabledAcct, movedToAcct } = this.props;
                                      
                                          const disabledAccountLink = (
                                            <Link to={`/@${disabledAcct}`}>

                                        Function componentDidMount has 36 lines of code (exceeds 25 allowed). Consider refactoring.
                                        Open

                                          componentDidMount () {
                                            const { signedIn } = this.props.identity;
                                        
                                            window.addEventListener('beforeunload', this.handleBeforeUnload, false);
                                            window.addEventListener('resize', this.handleResize, { passive: true });
                                        Severity: Minor
                                        Found in app/javascript/flavours/glitch/features/ui/index.jsx - About 1 hr to fix
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language