gitlabhq/gitlabhq

View on GitHub

Showing 1,405 of 2,015 total issues

Method track_query has 5 arguments (exceeds 4 allowed). Consider refactoring.
Open

      def track_query(raw_query, bindings, backtrace, start, finish)
Severity: Minor
Found in lib/gitlab/performance_bar/peek_query_tracker.rb - About 35 mins to fix

    Method initialize has 5 arguments (exceeds 4 allowed). Consider refactoring.
    Open

          def initialize(repo, fb_session, namespace, current_user, user_map = nil)
    Severity: Minor
    Found in lib/gitlab/fogbugz_import/project_creator.rb - About 35 mins to fix

      Function trigger has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
      Open

        trigger: function trigger(getEntireList) {
          var config = this.hook.config.AjaxFilter;
          var searchValue = this.trigger.value;
          if (!config || !config.endpoint || !config.searchKey) {
            return;
      Severity: Minor
      Found in app/assets/javascripts/droplab/plugins/ajax_filter.js - About 35 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 toggleCollapsedSidebar has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
      Open

        toggleCollapsedSidebar(collapsed, saveCookie) {
          const breakpoint = bp.getBreakpointSize();
          const dbp = ContextualSidebar.isDesktopBreakpoint();
      
          if (this.$sidebar.length) {
      Severity: Minor
      Found in app/assets/javascripts/contextual_sidebar.js - About 35 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.DISCARD_FILE_CHANGES has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
      Open

        [types.DISCARD_FILE_CHANGES](state, path) {
          const stagedFile = state.stagedFiles.find(f => f.path === path);
          const entry = state.entries[path];
          const { deleted, prevPath } = entry;
      
      
      Severity: Minor
      Found in app/assets/javascripts/ide/stores/mutations/file.js - About 35 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.RECEIVE_TRACE_SUCCESS has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
      Open

        [types.RECEIVE_TRACE_SUCCESS](state, log) {
          if (log.state) {
            state.traceState = log.state;
          }
      
      
      Severity: Minor
      Found in app/assets/javascripts/jobs/store/mutations.js - About 35 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 getFormData has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
      Open

      export function getFormData(params) {
        const {
          commit,
          note,
          noteableType,
      Severity: Minor
      Found in app/assets/javascripts/diffs/store/utils.js - About 35 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 7 (exceeds 5 allowed). Consider refactoring.
      Open

        constructor(obj, defaultAvatar) {
          this.id = obj.id;
          this._uid = this.guid();
          this.position = obj.position;
          this.title = obj.list_type === 'backlog' ? __('Open') : obj.title;
      Severity: Minor
      Found in app/assets/javascripts/boards/models/list.js - About 35 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 onClick has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
      Open

        onClick(item, $el, e) {
          if (window.location.pathname.indexOf(item.url) !== -1) {
            if (!e.metaKey) e.preventDefault();
            if (item.category === 'Projects') {
              this.projectInputEl.val(item.id);
      Severity: Minor
      Found in app/assets/javascripts/search_autocomplete.js - About 35 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 highlighter has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
      Open

      const highlighter = function(element, text, matches) {
        var highlightText, j, lastIndex, len, matchIndex, matchedChars, unmatched;
        lastIndex = 0;
        highlightText = '';
        matchedChars = [];
      Severity: Minor
      Found in app/assets/javascripts/project_find_file.js - About 35 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 getData has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
      Open

        getData(term, callback) {
          if (!term) {
            const contents = this.getCategoryContents();
            if (contents) {
              const glDropdownInstance = this.searchInput.data('glDropdown');
      Severity: Minor
      Found in app/assets/javascripts/search_autocomplete.js - About 35 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 message has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
      Open

        message() {
          if (this.errorCode === window.u2f.ErrorCodes.BAD_REQUEST && this.httpsDisabled) {
            return __(
              'U2F only works with HTTPS-enabled websites. Contact your administrator for more details.',
            );
      Severity: Minor
      Found in app/assets/javascripts/u2f/error.js - About 35 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 getCategoryContents has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
      Open

        getCategoryContents() {
          const userName = gon.current_username;
          const { projectOptions, groupOptions, dashboardOptions } = gl;
      
          // Get options
      Severity: Minor
      Found in app/assets/javascripts/search_autocomplete.js - About 35 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

      Method on_class has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
      Open

              def on_class(node)
                message =
                  if in_service_class?(node)
                    IN_SERVICE
                  elsif in_finder?(node)
      Severity: Minor
      Found in rubocop/cop/code_reuse/presenter.rb - About 35 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

      Method position_between has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
      Open

          def position_between(pos_before, pos_after)
            pos_before ||= MIN_POSITION
            pos_after ||= MAX_POSITION
      
            pos_before, pos_after = [pos_before, pos_after].sort
      Severity: Minor
      Found in app/models/concerns/relative_positioning.rb - About 35 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 loadDropdown has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
      Open

        loadDropdown(dropdownName = '') {
          let firstLoad = false;
      
          if (!this.droplab) {
            firstLoad = true;

      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

      Method delete_helm_release has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
      Open

        def delete_helm_release(release)
          print_release_state(subject: 'Release', release_name: release.name, release_status: release.status, release_date: release.last_update, action: 'cleaning')
          helm.delete(release_name: release.name)
          kubernetes.cleanup(release_name: release.name)
        rescue Quality::HelmClient::CommandFailedError => ex
      Severity: Minor
      Found in scripts/review_apps/automated_cleanup.rb - About 35 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

      Method milestones has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
      Open

        def milestones
          return @milestones if defined?(@milestones)
      
          @milestones =
            if milestones?
      Severity: Minor
      Found in app/finders/issuable_finder.rb - About 35 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

      Method on_block has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
      Open

            def on_block(node)
              block_body = node.body
      
              return unless block_body
              return unless top_block?(node)
      Severity: Minor
      Found in rubocop/cop/avoid_return_from_blocks.rb - About 35 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

      Method all_groups has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
      Open

        def all_groups
          return [owned_groups] if params[:owned]
          return [groups_with_min_access_level] if min_access_level?
          return [Group.all] if current_user&.full_private_access? && all_available?
      
      
      Severity: Minor
      Found in app/finders/groups_finder.rb - About 35 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