gitlabhq/gitlabhq

View on GitHub

Showing 1,605 of 2,285 total issues

File object_storage.rb has 317 lines of code (exceeds 250 allowed). Consider refactoring.
Open

require 'fog/aws'
require 'carrierwave/storage/fog'

#
# This concern should add object storage support
Severity: Minor
Found in app/uploaders/object_storage.rb - About 3 hrs to fix

    Method fabricate! has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring.
    Open

          def fabricate!
            @project.visit!
    
            Page::Project::Menu.perform(
              &:go_to_operations_kubernetes)
    Severity: Minor
    Found in qa/qa/resource/kubernetes_cluster.rb - About 3 hrs 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 fabricate! has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring.
    Open

            def fabricate!
              Git::Repository.perform do |repository|
                @output = ''
    
                if ssh_key
    Severity: Minor
    Found in qa/qa/resource/repository/push.rb - About 3 hrs 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 89 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      getData(term, callback) {
        if (!term) {
          const contents = this.getCategoryContents();
          if (contents) {
            const glDropdownInstance = this.searchInput.data('glDropdown');
    Severity: Major
    Found in app/assets/javascripts/search_autocomplete.js - About 3 hrs to fix

      File application_setting_implementation.rb has 315 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      module ApplicationSettingImplementation
        extend ActiveSupport::Concern
        include Gitlab::Utils::StrongMemoize
      
        STRING_LIST_SEPARATOR = %r{\s*[,;]\s*     # comma or semicolon, optionally surrounded by whitespace
      Severity: Minor
      Found in app/models/application_setting_implementation.rb - About 3 hrs to fix

        File git_access.rb has 315 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        module Gitlab
          class GitAccess
            include Gitlab::Utils::StrongMemoize
        
            UnauthorizedError = Class.new(StandardError)
        Severity: Minor
        Found in lib/gitlab/git_access.rb - About 3 hrs to fix

          Class TodosFinder has 29 methods (exceeds 20 allowed). Consider refactoring.
          Open

          class TodosFinder
            prepend FinderWithCrossProjectAccess
            include FinderMethods
            include Gitlab::Utils::StrongMemoize
          
          
          Severity: Minor
          Found in app/finders/todos_finder.rb - About 3 hrs to fix

            Class OmniauthCallbacksController has 29 methods (exceeds 20 allowed). Consider refactoring.
            Open

            class OmniauthCallbacksController < Devise::OmniauthCallbacksController
              include AuthenticatesWithTwoFactor
              include Devise::Controllers::Rememberable
              include AuthHelper
            
            
            Severity: Minor
            Found in app/controllers/omniauth_callbacks_controller.rb - About 3 hrs to fix

              Class ProjectWiki has 29 methods (exceeds 20 allowed). Consider refactoring.
              Open

              class ProjectWiki
                include Gitlab::ShellAdapter
                include Storage::LegacyProjectWiki
              
                MARKUPS = {
              Severity: Minor
              Found in app/models/project_wiki.rb - About 3 hrs to fix

                Class ProjectTeam has 29 methods (exceeds 20 allowed). Consider refactoring.
                Open

                class ProjectTeam
                  include BulkMemberAccessLoad
                
                  attr_accessor :project
                
                
                Severity: Minor
                Found in app/models/project_team.rb - About 3 hrs to fix

                  File file.rb has 312 lines of code (exceeds 250 allowed). Consider refactoring.
                  Open

                  module Gitlab
                    module Diff
                      class File
                        include Gitlab::Utils::StrongMemoize
                  
                  
                  Severity: Minor
                  Found in lib/gitlab/diff/file.rb - About 3 hrs to fix

                    Function chooseTemplate has 87 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                      function chooseTemplate() {
                        $projectTemplateButtons.addClass('hidden');
                        $projectFieldsForm.addClass('selected');
                        $selectedIcon.empty();
                        const value = $(this).val();
                    Severity: Major
                    Found in app/assets/javascripts/projects/project_new.js - About 3 hrs to fix

                      File project_presenter.rb has 310 lines of code (exceeds 250 allowed). Consider refactoring.
                      Open

                      class ProjectPresenter < Gitlab::View::Presenter::Delegated
                        include ActionView::Helpers::NumberHelper
                        include ActionView::Helpers::UrlHelper
                        include GitlabRoutingHelper
                        include StorageHelper
                      Severity: Minor
                      Found in app/presenters/project_presenter.rb - About 3 hrs to fix

                        Function addIssue has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring.
                        Open

                          addIssue(issue, listFrom, newIndex) {
                            let moveBeforeId = null;
                            let moveAfterId = null;
                        
                            if (!this.findIssue(issue.id)) {
                        Severity: Minor
                        Found in app/assets/javascripts/boards/models/list.js - About 3 hrs 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 addMultipleIssues has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring.
                        Open

                          addMultipleIssues(issues, listFrom, newIndex) {
                            let moveBeforeId = null;
                            let moveAfterId = null;
                        
                            const listHasIssues = issues.every(issue => this.findIssue(issue.id));
                        Severity: Minor
                        Found in app/assets/javascripts/boards/models/list.js - About 3 hrs 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 keydownNoteText has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring.
                        Open

                          keydownNoteText(e) {
                            var $textarea,
                              discussionNoteForm,
                              editNote,
                              myLastNote,
                        Severity: Minor
                        Found in app/assets/javascripts/notes.js - About 3 hrs 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 sections has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring.
                        Open

                              def sections
                                return @sections if @sections
                        
                                chunked_lines = lines.chunk { |line| line.type.nil? }.to_a
                                match_line = nil
                        Severity: Minor
                        Found in lib/gitlab/conflict/file.rb - About 3 hrs 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 getMappings has 84 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                          getMappings() {
                            return {
                              author: {
                                reference: null,
                                gl: DropdownUser,
                        Severity: Major
                        Found in app/assets/javascripts/filtered_search/available_dropdown_mappings.js - About 3 hrs to fix

                          File commits.rb has 306 lines of code (exceeds 250 allowed). Consider refactoring.
                          Open

                          require 'mime/types'
                          
                          module API
                            class Commits < Grape::API
                              include PaginationParams
                          Severity: Minor
                          Found in lib/api/commits.rb - About 3 hrs to fix

                            `` has 28 functions (exceeds 20 allowed). Consider refactoring.
                            Open

                            export default {
                              [types.ADD_NEW_NOTE](state, data) {
                                const note = data.discussion ? data.discussion.notes[0] : data;
                                const { discussion_id, type } = note;
                                const [exists] = state.discussions.filter(n => n.id === note.discussion_id);
                            Severity: Minor
                            Found in app/assets/javascripts/notes/stores/mutations.js - About 3 hrs to fix
                              Severity
                              Category
                              Status
                              Source
                              Language