rosa-abf/rosa-build

View on GitHub

Showing 210 of 210 total issues

Method activity has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

def activity(is_my_activity = false)
@filter = t('feed_menu').has_key?(params[:filter].try(:to_sym)) ? params[:filter].to_sym : :all
@activity_feeds = current_user.activity_feeds
.by_project_name(params[:project_name_filter])
.by_owner_uname(params[:owner_filter])
Severity: Minor
Found in app/controllers/home_controller.rb - About 45 mins to fix

Method initialize has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

def initialize(commit, opts = {})
comment = opts[:comment]
@is_reference_to_issue = !!comment # is it reference issue from commit
@project = if comment
Project.where(id: comment.data[:from_project_id]).first
Severity: Minor
Found in app/presenters/git_presenters/commit_as_message_presenter.rb - About 45 mins to fix

Method _call has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

def _call(env)
super
if git?
return render_not_found if project.blank?
 
 
Severity: Minor
Found in lib/plugins/grack/auth.rb - About 45 mins to fix

Similar blocks of code found in 2 locations. Consider refactoring.
Open

mouseleave: function(e) {
this.mousedover = false
if (!this.focused && this.shown)
this.hide()
}
Severity: Minor
Found in app/assets/javascripts/lib/bootstrap-typeahead.js and 1 other location - About 45 mins to fix
app/assets/javascripts/lib/bootstrap-typeahead.js on lines 425..429

Similar blocks of code found in 2 locations. Consider refactoring.
Open

blur: function(e) {
this.focused = false
if (!this.mousedover && this.shown)
this.hide()
},
Severity: Minor
Found in app/assets/javascripts/lib/bootstrap-typeahead.js and 1 other location - About 45 mins to fix
app/assets/javascripts/lib/bootstrap-typeahead.js on lines 441..445

Method publish? has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

def publish?
return false unless record.new_core?
return false unless record.can_publish?
if record.build_published?
local_admin?(record.save_to_platform) || record.save_to_repository.members.exists?(id: user.id)
Severity: Minor
Found in app/policies/build_list_policy.rb - About 45 mins to fix

Method read_and_write has 6 arguments (exceeds 4 allowed). Consider refactoring.
Open

def read_and_write(input, stdin, stdout, stderr, timeout=nil, max=nil)
Severity: Minor
Found in lib/ext/posix_spawn.rb - About 45 mins to fix

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

    def build_for(mass_build, repository_id, arch = Arch.find_by(name: 'i586'), priority = 0, increase_rt = false)
    Severity: Minor
    Found in app/models/project.rb - About 35 mins to fix

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

      def run_mass_import(url, srpms_list, visibility, owner, add_to_repository_id)
      Severity: Minor
      Found in app/models/concerns/git.rb - About 35 mins to fix

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

        def self.perform(build_list_id, user_id, project_ids, arch_ids, options)
        Severity: Minor
        Found in app/jobs/build_lists/dependent_packages_job.rb - About 35 mins to fix

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

          def new
          to_project = find_destination_project(false)
          authorize to_project, :show?
           
          @pull = to_project.pull_requests.new
          Severity: Minor
          Found in app/controllers/projects/pull_requests_controller.rb - About 35 mins to fix

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

          def set_options(options)
          @options = HashWithIndifferentAccess.new(options.reverse_merge({
          ownership: nil,
          status: nil,
          updated_at_start: nil,
          Severity: Minor
          Found in app/models/build_list/filter.rb - About 35 mins to fix

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

          def subscribe_users
          if issue_comment?
          commentable.subscribes.create(user: user) if !commentable.subscribes.exists?(user_id: user.id)
          elsif commit_comment?
          recipients = project.all_members
          Severity: Minor
          Found in app/models/comment.rb - About 35 mins to fix

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

          def send_assign_notifications
          return if @skip_assign_notifications
          @skip_assign_notifications = true
          if assignee_id && assignee_id_changed?
          if assignee.notifier.issue_assign && assignee.notifier.can_notify
          Severity: Minor
          Found in app/models/concerns/feed/issue.rb - About 35 mins to fix

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

          def set_data
          if save_to_platform
          self.name = "#{Time.now.utc.to_date.strftime("%d.%b")}-#{save_to_platform.name}"
          self.build_for_platform = save_to_platform if save_to_platform.main?
          end
          Severity: Minor
          Found in app/models/mass_build.rb - About 35 mins to fix

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

          def will_paginate(collection_or_options = nil, options = {})
          if collection_or_options.is_a? Hash
          options, collection_or_options = collection_or_options, nil
          end
          options.merge!(renderer: BootstrapLinkRenderer) unless options[:renderer]
          Severity: Minor
          Found in app/helpers/paginate_helper.rb - About 35 mins to fix

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

          def update
          authorize @pull
          status = 422
          if (action = params[:pull_request_action]) && %w(close reopen).include?(params[:pull_request_action])
          if @pull.send("can_#{action}?")
          Severity: Minor
          Found in app/controllers/projects/pull_requests_controller.rb - About 35 mins to fix

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

          def self.find_by_hash_tag(hash_tag, current_user, project)
          hash_tag =~ HASH_TAG_REGEXP
          owner_uname = Regexp.last_match[1].presence || Regexp.last_match[2].presence || project.owner.uname
          project_name = Regexp.last_match[1] ? Regexp.last_match[2] : project.name
          serial_id = Regexp.last_match[3]
          Severity: Minor
          Found in app/models/issue.rb - About 35 mins to fix

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

          def prepare_extra_build_lists
          if mass_build && mass_build.extra_mass_builds.present?
          extra_build_lists << BuildList.where(mass_build_id: mass_build.extra_mass_builds).pluck(:id)
          extra_build_lists.flatten!
          end
          Severity: Minor
          Found in app/models/build_list.rb - About 35 mins to fix

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

          def lock_file_actions(action, lock_file)
          result = false
          (['SRPMS'] << Arch.pluck(:name)).each do |arch|
          path = "#{platform.path}/repository/#{arch}/#{name}/#{LOCK_FILE_NAMES[lock_file]}"
          case action
          Severity: Minor
          Found in app/models/repository.rb - About 35 mins to fix
          Severity
          Category
          Status
          Source
          Language