gitlabhq/gitlabhq

View on GitHub

Showing 1,126 of 1,532 total issues

Function initDropdown has 29 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  initDropdown() {
    this.$dropdownToggle.glDropdown({
      search: {
        fields: ['name_with_namespace'],
      },
Severity: Minor
Found in app/assets/javascripts/sidebar/lib/sidebar_move_issue.js - About 1 hr to fix

    Function itemClicked has 29 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      itemClicked(e) {
        const { selected } = e.detail;
    
        if (selected.tagName === 'LI') {
          if (selected.hasAttribute('data-value')) {
    Severity: Minor
    Found in app/assets/javascripts/filtered_search/dropdown_hint.js - About 1 hr to fix

      Function handleInputVisualToken has 29 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        handleInputVisualToken() {
          const input = this.filteredSearchInput;
          const { tokens, searchToken }
            = this.tokenizer.processTokens(input.value, this.filteredSearchTokenKeys.getKeys());
          const { isLastVisualTokenValid }
      Severity: Minor
      Found in app/assets/javascripts/filtered_search/filtered_search_manager.js - About 1 hr to fix

        Method create_merge_request has 29 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

                def create_merge_request
                  author_id, author_found = user_finder.author_id_for(pull_request)
        
                  description = MarkdownText
                    .format(pull_request.description, pull_request.author, author_found)
        Severity: Minor
        Found in lib/gitlab/github_import/importer/pull_request_importer.rb - About 1 hr to fix

          Method build has 29 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

                def build(project, user, oldrev, newrev, ref, commits = [], message = nil, commits_count: nil)
                  commits = Array(commits)
          
                  # Total commits count
                  commits_count ||= commits.size
          Severity: Minor
          Found in lib/gitlab/data_builder/push.rb - About 1 hr to fix

            Method call_receive_hook has 29 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                  def call_receive_hook(gl_id, gl_username, oldrev, newrev, ref)
                    changes = [oldrev, newrev, ref].join(" ")
            
                    exit_status = false
                    exit_message = nil
            Severity: Minor
            Found in lib/gitlab/git/hook.rb - About 1 hr to fix

              Method clipboard_button has 29 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                def clipboard_button(data = {})
                  css_class = data[:class] || 'btn-clipboard btn-transparent'
                  title = data[:title] || 'Copy to clipboard'
                  button_text = data[:button_text] || ''
                  hide_tooltip = data[:hide_tooltip] || false
              Severity: Minor
              Found in app/helpers/button_helper.rb - About 1 hr to fix

                Method execute has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                  def execute(data)
                    return unless supported_events.include?(data[:object_kind])
                
                    ref = Gitlab::Git.ref_name(data[:ref])
                    before = data[:before]
                Severity: Minor
                Found in app/models/project_services/pushover_service.rb - About 1 hr to fix

                  Method place_chain has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      def place_chain(commit, parent_time = nil)
                        leaves = take_left_leaves(commit)
                        if leaves.empty?
                          return
                        end
                  Severity: Minor
                  Found in app/models/network/graph.rb - About 1 hr to fix

                    Method handle_failure has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                      def handle_failure(raw, e)
                        Rails.logger.warn("Email can not be processed: #{e}\n\n#{raw}")
                    
                        return unless raw.present?
                    
                    
                    Severity: Minor
                    Found in app/workers/email_receiver_worker.rb - About 1 hr to fix

                      Method execute has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                        def execute
                          deployments = project.deployments
                          deployments =
                            if ref
                              deployments_query = params[:with_tags] ? 'ref = :ref OR tag IS TRUE' : 'ref = :ref'
                      Severity: Minor
                      Found in app/finders/environments_finder.rb - About 1 hr to fix

                        Method show has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                          def show
                            unless current_user.otp_secret
                              current_user.otp_secret = User.generate_otp_secret(32)
                            end
                        
                        
                        Severity: Minor
                        Found in app/controllers/profiles/two_factor_auths_controller.rb - About 1 hr to fix

                          Function setSearchOptions has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                          function setSearchOptions() {
                            var $projectOptionsDataEl = $('.js-search-project-options');
                            var $groupOptionsDataEl = $('.js-search-group-options');
                            var $dashboardOptionsDataEl = $('.js-search-dashboard-options');
                          
                          
                          Severity: Minor
                          Found in app/assets/javascripts/search_autocomplete.js - About 1 hr to fix

                            Function nodeToGFM has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                              static nodeToGFM(node, respectWhitespaceParam = false) {
                                if (node.nodeType === Node.COMMENT_NODE) {
                                  return '';
                                }
                            
                            
                            Severity: Minor
                            Found in app/assets/javascripts/behaviors/copy_as_gfm.js - About 1 hr to fix

                              Function simulateEvent has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                              function simulateEvent(el, type, options = {}) {
                                let event;
                                if (!el) return null;
                              
                                if (/^mouse/.test(type)) {
                              Severity: Minor
                              Found in app/assets/javascripts/test_utils/simulate_drag.js - About 1 hr to fix

                                Function onSaveClicked has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                  onSaveClicked() {
                                    const loadingIcon = this.saveButton.querySelector('.js-secret-variables-save-loading-icon');
                                    loadingIcon.classList.toggle('hide', false);
                                    this.errorBox.classList.toggle('hide', true);
                                    // We use this to prevent a user from changing a key before we have a chance
                                Severity: Minor
                                Found in app/assets/javascripts/ci_variable_list/ajax_variable_list.js - About 1 hr to fix

                                  Function handleClickUnfold has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                    handleClickUnfold(e) {
                                      const $target = $(e.target);
                                      const [oldLineNumber, newLineNumber] = this.lineNumbers($target.parent());
                                      const offset = newLineNumber - oldLineNumber;
                                      const bottom = $target.hasClass('js-unfold-bottom');
                                  Severity: Minor
                                  Found in app/assets/javascripts/diff.js - About 1 hr to fix

                                    Function initTargetBranchDropdown has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                      initTargetBranchDropdown() {
                                        this.$targetBranchSelect.select2({
                                          ...AutoWidthDropdownSelect.selectOptions('js-target-branch-select'),
                                          ajax: {
                                            url: this.$targetBranchSelect.data('endpoint'),
                                    Severity: Minor
                                    Found in app/assets/javascripts/issuable_form.js - About 1 hr to fix

                                      Function buildChart has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                                      Open

                                        const buildChart = (chartScope) => {
                                          const data = {
                                            labels: chartScope.labels,
                                            datasets: [{
                                              fillColor: '#707070',
                                      Severity: Minor
                                      Found in app/assets/javascripts/pipelines/pipelines_charts.js - About 1 hr to fix

                                        Function storeEnvironments has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                                        Open

                                          storeEnvironments(environments = []) {
                                            const filteredEnvironments = environments.map((env) => {
                                              const oldEnvironmentState = this.state.environments
                                              .find((element) => {
                                                if (env.latest) {
                                        Severity: Minor
                                        Found in app/assets/javascripts/environments/stores/environments_store.js - About 1 hr to fix
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language