glitch-soc/mastodon

View on GitHub

Showing 1,278 of 4,906 total issues

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

  render () {
    const { columns, children, singleColumn, isModalOpen, openSettings } = this.props;
    const { renderComposePanel } = this.state;

    if (singleColumn) {

    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/mastodon/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/mastodon/actions/timelines.js - About 1 hr to fix

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

          _updateStatusLinks () {
            const node = this.node;
        
            if (!node) {
              return;
        Severity: Minor
        Found in app/javascript/mastodon/components/status_content.jsx - 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/mastodon/components/autosuggest_input.jsx - 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 render has 36 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                render () {
                  const { category, startedFrom, rules, intl } = this.props;
              
                  const options = rules.size > 0 ? [
                    'dislike',
              Severity: Minor
              Found in app/javascript/mastodon/features/report/category.jsx - About 1 hr to fix

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

                  render () {
                    const { columns, children, singleColumn, isModalOpen } = this.props;
                    const { renderComposePanel } = this.state;
                
                    if (singleColumn) {
                Severity: Minor
                Found in app/javascript/mastodon/features/ui/components/columns_area.jsx - About 1 hr to fix

                  Method load_groups_data has 36 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      def load_groups_data(account_id, group_keys, pagination_range: nil)
                        return {} if group_keys.empty?
                  
                        if pagination_range.present?
                          binds = [
                  Severity: Minor
                  Found in app/models/notification_group.rb - About 1 hr to fix

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

                    function processNewNotification(
                      groups: NotificationGroupsState['groups'],
                      notification: ApiNotificationJSON,
                      groupedTypes: NotificationType[],
                    ) {
                    Severity: Minor
                    Found in app/javascript/flavours/glitch/reducers/notification_groups.ts - About 1 hr to fix

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

                      function processNewNotification(
                        groups: NotificationGroupsState['groups'],
                        notification: ApiNotificationJSON,
                        groupedTypes: NotificationType[],
                      ) {
                      Severity: Minor
                      Found in app/javascript/mastodon/reducers/notification_groups.ts - About 1 hr to fix

                        Function unicodeToFilename has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
                        Open

                        exports.unicodeToFilename = (str) => {
                          let result = '';
                          let charCode = 0;
                          let p = 0;
                          let i = 0;

                        Cognitive Complexity

                        Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                        A method's cognitive complexity is based on a few simple rules:

                        • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                        • Code is considered more complex for each "break in the linear flow of the code"
                        • Code is considered more complex when "flow breaking structures are nested"

                        Further reading

                        Function render has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
                        Open

                          render () {
                            const { statusIds, featuredStatusIds, onLoadMore, timelineId, ...other }  = this.props;
                            const { isLoading, isPartial } = other;
                        
                            if (isPartial) {
                        Severity: Minor
                        Found in app/javascript/flavours/glitch/components/status_list.jsx - About 1 hr to fix

                        Cognitive Complexity

                        Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                        A method's cognitive complexity is based on a few simple rules:

                        • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                        • Code is considered more complex for each "break in the linear flow of the code"
                        • Code is considered more complex when "flow breaking structures are nested"

                        Further reading

                        Function isLinkMisleading has a Cognitive Complexity of 12 (exceeds 5 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

                        Cognitive Complexity

                        Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                        A method's cognitive complexity is based on a few simple rules:

                        • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                        • Code is considered more complex for each "break in the linear flow of the code"
                        • Code is considered more complex when "flow breaking structures are nested"

                        Further reading

                        Function render has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
                        Open

                          render () {
                            let ancestors, descendants, remoteHint;
                            const { isLoading, status, settings, ancestorsIds, descendantsIds, intl, domain, multiColumn, pictureInPicture } = this.props;
                            const { fullscreen } = this.state;
                        
                        
                        Severity: Minor
                        Found in app/javascript/flavours/glitch/features/status/index.jsx - About 1 hr to fix

                        Cognitive Complexity

                        Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                        A method's cognitive complexity is based on a few simple rules:

                        • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                        • Code is considered more complex for each "break in the linear flow of the code"
                        • Code is considered more complex when "flow breaking structures are nested"

                        Further reading

                        Function render has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
                        Open

                          render () {
                            const { statusIds, featuredStatusIds, onLoadMore, timelineId, ...other }  = this.props;
                            const { isLoading, isPartial } = other;
                        
                            if (isPartial) {
                        Severity: Minor
                        Found in app/javascript/mastodon/components/status_list.jsx - About 1 hr to fix

                        Cognitive Complexity

                        Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                        A method's cognitive complexity is based on a few simple rules:

                        • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                        • Code is considered more complex for each "break in the linear flow of the code"
                        • Code is considered more complex when "flow breaking structures are nested"

                        Further reading

                        Function unicodeToFilename has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
                        Open

                        exports.unicodeToFilename = (str) => {
                          let result = '';
                          let charCode = 0;
                          let p = 0;
                          let i = 0;
                        Severity: Minor
                        Found in app/javascript/mastodon/features/emoji/unicode_to_filename.js - About 1 hr to fix

                        Cognitive Complexity

                        Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                        A method's cognitive complexity is based on a few simple rules:

                        • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                        • Code is considered more complex for each "break in the linear flow of the code"
                        • Code is considered more complex when "flow breaking structures are nested"

                        Further reading

                        Function render has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
                        Open

                          render () {
                            const { accountId, accountIds, hasMore, blockedBy, isAccount, multiColumn, isLoading, suspended, hidden, remote, remoteUrl, hideCollections } = this.props;
                        
                            if (!isAccount) {
                              return (
                        Severity: Minor
                        Found in app/javascript/mastodon/features/followers/index.jsx - About 1 hr to fix

                        Cognitive Complexity

                        Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                        A method's cognitive complexity is based on a few simple rules:

                        • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                        • Code is considered more complex for each "break in the linear flow of the code"
                        • Code is considered more complex when "flow breaking structures are nested"

                        Further reading

                        Function notifications has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
                        Open

                        export default function notifications(state = initialState, action) {
                          switch(action.type) {
                          case fetchMarkers.fulfilled.type:
                            return action.payload.markers.notifications ? recountUnread(state, action.payload.markers.notifications.last_read_id) : state;
                          case NOTIFICATIONS_MOUNT:
                        Severity: Minor
                        Found in app/javascript/mastodon/reducers/notifications.js - About 1 hr to fix

                        Cognitive Complexity

                        Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                        A method's cognitive complexity is based on a few simple rules:

                        • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                        • Code is considered more complex for each "break in the linear flow of the code"
                        • Code is considered more complex when "flow breaking structures are nested"

                        Further reading

                        Function render has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
                        Open

                          render () {
                            const { children, singleColumn } = this.props;
                            const { signedIn } = this.props.identity;
                            const pathName = this.props.location.pathname;
                        
                        
                        Severity: Minor
                        Found in app/javascript/mastodon/features/ui/index.jsx - About 1 hr to fix

                        Cognitive Complexity

                        Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                        A method's cognitive complexity is based on a few simple rules:

                        • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                        • Code is considered more complex for each "break in the linear flow of the code"
                        • Code is considered more complex when "flow breaking structures are nested"

                        Further reading

                        Severity
                        Category
                        Status
                        Source
                        Language