gitlabhq/gitlabhq

View on GitHub

Showing 1,313 of 1,834 total issues

Avoid too many return statements within this function.
Open

    return stateKey.shaMismatch;
Severity: Major
Found in app/assets/javascripts/vue_merge_request_widget/stores/get_state_key.js - About 30 mins to fix

    Avoid too many return statements within this function.
    Open

        return stateKey.notAllowedToMerge;
    Severity: Major
    Found in app/assets/javascripts/vue_merge_request_widget/stores/get_state_key.js - About 30 mins to fix

      Avoid too many return statements within this function.
      Open

        return null;
      Severity: Major
      Found in app/assets/javascripts/vue_merge_request_widget/stores/get_state_key.js - About 30 mins to fix

        Avoid too many return statements within this function.
        Open

              return this.setUnavailableState();
        Severity: Major
        Found in app/assets/javascripts/pages/sessions/new/username_validator.js - 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 receiver(namespace_expr) == project_expr
            Severity: Major
            Found in rubocop/cop/project_path_helper.rb - About 30 mins to fix

              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 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 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 4 if @condition.scope == DeclarativePolicy.preferred_scope
                      Severity: Major
                      Found in lib/declarative_policy/condition.rb - About 30 mins to fix

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

                        export const toggleScrollButtons = ({ dispatch }) => {
                          if (canScroll()) {
                            if (isScrolledToMiddle()) {
                              dispatch('enableScrollTop');
                              dispatch('enableScrollBottom');
                        Severity: Minor
                        Found in app/assets/javascripts/jobs/store/actions.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 testWrap has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                        Open

                        Raphael.prototype.textWrap = function testWrap(t, width) {
                          const content = t.attr('text');
                          const abc = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';
                          t.attr({
                            text: abc,
                        Severity: Minor
                        Found in app/assets/javascripts/network/raphael.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 getQuickActionText has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                        Open

                        export const getQuickActionText = note => {
                          let text = 'Applying command';
                          const quickActions = AjaxCache.get(gl.GfmAutoComplete.dataSources.commands) || [];
                        
                          const executedCommands = quickActions.filter(command => {
                        Severity: Minor
                        Found in app/assets/javascripts/notes/stores/utils.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 constructor has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                        Open

                          constructor() {
                            const $diffFile = $('.files .diff-file');
                        
                            $diffFile.each((index, file) => {
                              if (!$.data(file, 'singleFileDiff')) {
                        Severity: Minor
                        Found in app/assets/javascripts/diff.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 unresolvedDiscussionsIdsByDiff has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                        Open

                        export const unresolvedDiscussionsIdsByDiff = (state, getters) =>
                          getters.allResolvableDiscussions
                            .filter(d => !d.resolved)
                            .sort((a, b) => {
                              if (!a.diff_file || !b.diff_file) {
                        Severity: Minor
                        Found in app/assets/javascripts/notes/stores/getters.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.SET_FILE_RAW_DATA has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                        Open

                          [types.SET_FILE_RAW_DATA](state, { file, raw }) {
                            const openPendingFile = state.openFiles.find(
                              f => f.path === file.path && f.pending && !(f.tempFile && !f.prevPath),
                            );
                        
                        
                        Severity: Minor
                        Found in app/assets/javascripts/ide/stores/mutations/file.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 keydown has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                        Open

                          keydown: function(e) {
                            if (this.destroyed) return;
                        
                            var hiddenCount = 0;
                            var dataHiddenCount = 0;
                        Severity: Minor
                        Found in app/assets/javascripts/droplab/plugins/filter.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