gitlabhq/gitlabhq

View on GitHub

Showing 1,551 of 2,202 total issues

Class GithubController has 37 methods (exceeds 20 allowed). Consider refactoring.
Open

class Import::GithubController < Import::BaseController
  include ImportHelper
  include ActionView::Helpers::SanitizeHelper

  before_action :verify_import_enabled
Severity: Minor
Found in app/controllers/import/github_controller.rb - About 4 hrs to fix

    Class IssuableBaseService has 37 methods (exceeds 20 allowed). Consider refactoring.
    Open

    class IssuableBaseService < BaseService
      private
    
      attr_accessor :params, :skip_milestone_email
    
    
    Severity: Minor
    Found in app/services/issuable_base_service.rb - About 4 hrs to fix

      File note.rb has 367 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      class Note < ApplicationRecord
        extend ActiveModel::Naming
        include Participable
        include Mentionable
        include Awardable
      Severity: Minor
      Found in app/models/note.rb - About 4 hrs to fix

        Method has_internal_id has a Cognitive Complexity of 32 (exceeds 5 allowed). Consider refactoring.
        Open

            def has_internal_id(column, scope:, init:, ensure_if: nil, presence: true) # rubocop:disable Naming/PredicateName
              # We require init here to retain the ability to recalculate in the absence of a
              # InternaLId record (we may delete records in `internal_ids` for example).
              raise "has_internal_id requires a init block, none given." unless init
              raise "has_internal_id needs to be defined on association." unless self.reflect_on_association(scope)
        Severity: Minor
        Found in app/models/concerns/atomic_internal_id.rb - About 4 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

        File commit_service.rb has 362 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        module Gitlab
          module GitalyClient
            class CommitService
              include Gitlab::EncodingHelper
        
        
        Severity: Minor
        Found in lib/gitlab/gitaly_client/commit_service.rb - About 4 hrs to fix

          Class Base has 36 methods (exceeds 20 allowed). Consider refactoring.
          Open

            class Base
              # A map of ability => list of rules together with :enable
              # or :prevent actions. Used to look up which rules apply to
              # a given ability. See Base.ability_map
              class AbilityMap
          Severity: Minor
          Found in lib/declarative_policy/base.rb - About 4 hrs to fix

            Class AbstractReferenceFilter has 36 methods (exceeds 20 allowed). Consider refactoring.
            Open

                class AbstractReferenceFilter < ReferenceFilter
                  include CrossProjectReference
            
                  # REFERENCE_PLACEHOLDER is used for re-escaping HTML text except found
                  # reference (which we replace with placeholder during re-scaping).  The
            Severity: Minor
            Found in lib/banzai/filter/abstract_reference_filter.rb - About 4 hrs to fix

              Class Shell has 36 methods (exceeds 20 allowed). Consider refactoring.
              Open

                class Shell
                  GITLAB_SHELL_ENV_VARS = %w(GIT_TERMINAL_PROMPT).freeze
              
                  Error = Class.new(StandardError)
              
              
              Severity: Minor
              Found in lib/gitlab/shell.rb - About 4 hrs to fix

                Function ContributorsMasterGraph has 115 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                export const ContributorsMasterGraph = (function(superClass) {
                  extend(ContributorsMasterGraph, superClass);
                
                  function ContributorsMasterGraph(data1) {
                    const $parentElement = $('#contributors-master');

                  File datetime_utility.js has 357 lines of code (exceeds 250 allowed). Consider refactoring.
                  Open

                  import $ from 'jquery';
                  import _ from 'underscore';
                  import timeago from 'timeago.js';
                  import dateFormat from 'dateformat';
                  import { languageCode, s__, __, n__ } from '../../locale';
                  Severity: Minor
                  Found in app/assets/javascripts/lib/utils/datetime_utility.js - About 4 hrs to fix

                    File merge_conflict_store.js has 355 lines of code (exceeds 250 allowed). Consider refactoring.
                    Open

                    /* eslint-disable no-param-reassign, camelcase, no-nested-ternary, no-continue */
                    
                    import $ from 'jquery';
                    import Vue from 'vue';
                    import Cookies from 'js-cookie';
                    Severity: Minor
                    Found in app/assets/javascripts/merge_conflicts/merge_conflict_store.js - About 4 hrs to fix

                      File projects_controller.rb has 355 lines of code (exceeds 250 allowed). Consider refactoring.
                      Open

                      class ProjectsController < Projects::ApplicationController
                        include API::Helpers::RelatedResourcesHelpers
                        include IssuableCollections
                        include ExtractsPath
                        include PreviewMarkdown
                      Severity: Minor
                      Found in app/controllers/projects_controller.rb - About 4 hrs to fix

                        File qa.rb has 355 lines of code (exceeds 250 allowed). Consider refactoring.
                        Open

                        $: << File.expand_path(File.dirname(__FILE__))
                        
                        Encoding.default_external = 'UTF-8'
                        
                        require_relative '../lib/gitlab'
                        Severity: Minor
                        Found in qa/qa.rb - About 4 hrs to fix

                          Api has 35 functions (exceeds 20 allowed). Consider refactoring.
                          Open

                          const Api = {
                            groupsPath: '/api/:version/groups.json',
                            groupPath: '/api/:version/groups/:id',
                            groupMembersPath: '/api/:version/groups/:id/members',
                            subgroupsPath: '/api/:version/groups/:id/subgroups',
                          Severity: Minor
                          Found in app/assets/javascripts/api.js - About 4 hrs to fix

                            Class WikiPage has 35 methods (exceeds 20 allowed). Consider refactoring.
                            Open

                            class WikiPage
                              PageChangedError = Class.new(StandardError)
                              PageRenameError = Class.new(StandardError)
                            
                              include ActiveModel::Validations
                            Severity: Minor
                            Found in app/models/wiki_page.rb - About 4 hrs to fix

                              Class NotifyPreview has 35 methods (exceeds 20 allowed). Consider refactoring.
                              Open

                              class NotifyPreview < ActionMailer::Preview
                                def note_merge_request_email_for_individual_note
                                  note_email(:note_merge_request_email) do
                                    note = <<-MD.strip_heredoc
                                      This is an individual note on a merge request :smiley:
                              Severity: Minor
                              Found in app/mailers/previews/notify_preview.rb - About 4 hrs to fix

                                Class Repository has 35 methods (exceeds 20 allowed). Consider refactoring.
                                Open

                                    class Repository
                                      include Scenario::Actable
                                      RepositoryCommandError = Class.new(StandardError)
                                
                                      attr_writer :use_lfs, :gpg_key_id
                                Severity: Minor
                                Found in qa/qa/git/repository.rb - About 4 hrs to fix

                                  File repository_service.rb has 354 lines of code (exceeds 250 allowed). Consider refactoring.
                                  Open

                                  module Gitlab
                                    module GitalyClient
                                      class RepositoryService
                                        include Gitlab::EncodingHelper
                                  
                                  
                                  Severity: Minor
                                  Found in lib/gitlab/gitaly_client/repository_service.rb - About 4 hrs to fix

                                    File commit.rb has 352 lines of code (exceeds 250 allowed). Consider refactoring.
                                    Open

                                    class Commit
                                      extend ActiveModel::Naming
                                      extend Gitlab::Cache::RequestCache
                                    
                                      include ActiveModel::Conversion
                                    Severity: Minor
                                    Found in app/models/commit.rb - About 4 hrs to fix

                                      Class PagesDomain has 34 methods (exceeds 20 allowed). Consider refactoring.
                                      Open

                                      class PagesDomain < ApplicationRecord
                                        VERIFICATION_KEY = 'gitlab-pages-verification-code'
                                        VERIFICATION_THRESHOLD = 3.days.freeze
                                        SSL_RENEWAL_THRESHOLD = 30.days.freeze
                                      
                                      
                                      Severity: Minor
                                      Found in app/models/pages_domain.rb - About 4 hrs to fix
                                        Severity
                                        Category
                                        Status
                                        Source
                                        Language