gitlabhq/gitlabhq

View on GitHub

Showing 1,757 of 2,500 total issues

Avoid too many return statements within this method.
Open

    return false if last_diff_sha != diff_head_sha
Severity: Major
Found in app/models/merge_request.rb - About 30 mins to fix

    Avoid too many return statements within this method.
    Open

        return false unless skip_discussions_check || mergeable_discussions_state?
    Severity: Major
    Found in app/models/merge_request.rb - About 30 mins to fix

      Avoid too many return statements within this method.
      Open

          return unless result
      Severity: Major
      Found in app/models/concerns/diff_positionable_note.rb - About 30 mins to fix

        Avoid too many return statements within this method.
        Open

            return false unless suitable_notification_level?
        Severity: Major
        Found in app/models/notification_recipient.rb - About 30 mins to fix

          Avoid too many return statements within this method.
          Open

              return false if @type != :mention && unsubscribed?
          Severity: Major
          Found in app/models/notification_recipient.rb - About 30 mins to fix

            Avoid too many return statements within this method.
            Open

                return false if diff_refs && diff_refs != noteable.diff_refs
            Severity: Major
            Found in app/models/legacy_diff_note.rb - About 30 mins to fix

              Avoid too many return statements within this method.
              Open

                    return 'user_remove_from_group' if event == :destroy
              Severity: Major
              Found in app/services/system_hooks_service.rb - About 30 mins to fix

                Avoid too many return statements within this method.
                Open

                      return 'user_update_for_group'  if event == :update
                Severity: Major
                Found in app/services/system_hooks_service.rb - About 30 mins to fix

                  Avoid too many return statements within this method.
                  Open

                        return error("Milestone(s) not found: #{inexistent_milestones.join(', ')}", 400) if inexistent_milestones.any?
                  Severity: Major
                  Found in app/services/releases/update_service.rb - About 30 mins to fix

                    Avoid too many return statements within this method.
                    Open

                          return true unless source_sha = merge_request.source_branch_sha
                    Severity: Major
                    Found in app/services/merge_requests/mergeability_check_service.rb - About 30 mins to fix

                      Avoid too many return statements within this method.
                      Open

                            return VALID
                      Severity: Major
                      Found in app/services/access_token_validation_service.rb - About 30 mins to fix

                        Avoid too many return statements within this method.
                        Open

                              return 4 if @condition.scope == DeclarativePolicy.preferred_scope
                        Severity: Major
                        Found in lib/declarative_policy/condition.rb - About 30 mins to fix

                          Avoid too many return statements within this method.
                          Open

                                  return DiffViewer::Added if new_file?
                          Severity: Major
                          Found in lib/gitlab/diff/file.rb - About 30 mins to fix

                            Avoid too many return statements within this method.
                            Open

                                    return DiffViewer::ModeChanged if mode_changed?
                            Severity: Major
                            Found in lib/gitlab/diff/file.rb - About 30 mins to fix

                              Avoid too many return statements within this method.
                              Open

                                      return DiffViewer::Deleted if deleted_file?
                              Severity: Major
                              Found in lib/gitlab/diff/file.rb - About 30 mins to fix

                                Avoid too many return statements within this method.
                                Open

                                        return DiffViewer::Renamed if renamed_file?
                                Severity: Major
                                Found in lib/gitlab/diff/file.rb - About 30 mins to fix

                                  Function countSourceFiles has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                                  Open

                                  const countSourceFiles = path =>
                                    forEachFileIn(path, fileName => {
                                      if (fileName.endsWith('.vue') || fileName.endsWith('.js')) {
                                        if (isVerbose) {
                                          console.log(`source file: ${fileName}`);
                                  Severity: Minor
                                  Found in scripts/frontend/file_test_coverage.js - About 25 mins 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 toggleCollapsed has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                                  Open

                                  export function toggleCollapsed(event) {
                                    const toggleButtonEl = event.currentTarget;
                                    const discussionNotesEl = toggleButtonEl.closest('.discussion-notes');
                                    const formEl = discussionNotesEl.querySelector('.discussion-form');
                                    const isCollapsed = discussionNotesEl.classList.contains('collapsed');
                                  Severity: Minor
                                  Found in app/assets/javascripts/image_diff/helpers/dom_helper.js - About 25 mins 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 emptyStateFromError has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                                  Open

                                  const emptyStateFromError = error => {
                                    if (!error) {
                                      return metricStates.UNKNOWN_ERROR;
                                    }
                                  
                                  
                                  Severity: Minor
                                  Found in app/assets/javascripts/monitoring/stores/mutations.js - About 25 mins 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 types.TOGGLE_LOADING has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                                  Open

                                    [types.TOGGLE_LOADING](state, { entry, forceValue = undefined }) {
                                      if (entry.path) {
                                        Object.assign(state.entries[entry.path], {
                                          loading: forceValue !== undefined ? forceValue : !state.entries[entry.path].loading,
                                        });
                                  Severity: Minor
                                  Found in app/assets/javascripts/ide/stores/mutations.js - About 25 mins 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