rosa-abf/rosa-build

View on GitHub

Showing 210 of 210 total issues

Method create has 34 lines of code (exceeds 25 allowed). Consider refactoring.
Open

def create
unless pull_params
redirect :back
end
to_project = find_destination_project
Severity: Minor
Found in app/controllers/projects/pull_requests_controller.rb - About 1 hr to fix

    Method build_rpms has 34 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    def self.build_rpms(testing = false)
    available_repos = BuildList.
    select('MIN(updated_at) as min_updated_at, save_to_repository_id, build_for_platform_id').
    where(new_core: true, status: (testing ? BuildList::BUILD_PUBLISH_INTO_TESTING : BuildList::BUILD_PUBLISH)).
    group(:save_to_repository_id, :build_for_platform_id).
    Severity: Minor
    Found in app/services/abf_worker_service/rpm.rb - About 1 hr to fix

      Method create has 34 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      def create
      notices, errors = [], []
       
      @repository = Repository.find build_list_params[:save_to_repository_id]
      @platform = @repository.platform
      Severity: Minor
      Found in app/controllers/projects/build_lists_controller.rb - About 1 hr to fix

        Consider simplifying this complex logical expression.
        Open

        if (arguments[1] && arguments[1] === 'plural') {
        var n = arguments[2],
        plural;
         
        switch ($locale.id) {
        Severity: Critical
        Found in app/assets/javascripts/lib/angular-i18n.js - About 1 hr to fix

          Method render_pulls_list has 33 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          def render_pulls_list
          @pulls = @pulls.includes(issue: [:user, :assignee])
          if params[:status] == 'closed'
          @pulls = @pulls.closed_or_merged
          else
          Severity: Minor
          Found in app/controllers/api/v1/pull_requests_controller.rb - About 1 hr to fix

            Method set_options has 32 lines of code (exceeds 25 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 1 hr to fix

              Method autostart_build_lists has 32 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              def self.autostart_build_lists(autostart_status)
              Project.where(autostart_status: autostart_status).find_each do |p|
              p.project_to_repositories.autostart_enabled.includes(repository: :platform).each do |p_to_r|
              repository = p_to_r.repository
              user = User.find(p_to_r.user_id)
              Severity: Minor
              Found in app/models/project.rb - About 1 hr to fix

                Method as_json has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                def as_json(options = nil)
                {
                build_lists: {
                build_started: prepare_collection(build_lists_started),
                success: prepare_collection(build_lists_success),
                Severity: Minor
                Found in app/presenters/statistic_presenter.rb - About 1 hr to fix

                  Method get_owner has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                  Open

                  def get_owner
                  if self.class.method_defined? :parent
                  if parent and (parent.is_a? User or parent.is_a? Group)
                  return parent
                  else
                  Severity: Minor
                  Found in app/controllers/application_controller.rb - About 1 hr to fix

                  Method check has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                  Open

                  def check(do_transaction = true)
                  if do_transaction && !valid?
                  issue.set_close nil
                  issue.save(validate: false) # FIXME remove this hack
                  return false
                  Severity: Minor
                  Found in app/models/pull_request.rb - About 1 hr to fix

                  Method projects_list has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                  Open

                  def projects_list
                  render(text: @repository.projects.map(&:name).join("\n")) && return if params[:text] == 'true'
                   
                  owner_subquery = "
                  INNER JOIN (
                  Severity: Minor
                  Found in app/controllers/platforms/repositories_controller.rb - About 1 hr to fix

                  Method clone has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                  Open

                  def clone
                  return if from_project.nil?
                  git = Grit::Git.new(path)
                  if new_record? || !git.exist?
                  #~ FileUtils.mkdir_p(path)
                  Severity: Minor
                  Found in app/models/pull_request.rb - About 1 hr to fix

                  Method issues has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                  Open

                  def issues
                  @created_issues = current_user.issues
                  @assigned_issues = Issue.where(assignee_id: current_user.id)
                  @all_issues = ProjectPolicy::Scope.new(current_user, Issue).membered.uniq.joins(:project)
                   
                  Severity: Minor
                  Found in app/controllers/home_controller.rb - About 1 hr to fix

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

                  def has_new_packages?
                  if last_bl = last_published.joins(:source_packages).where(build_list_packages: {actual: true}).last
                  source_packages.each do |nsp|
                  sp = last_bl.source_packages.find{ |sp| nsp.name == sp.name }
                  return true unless sp
                  Severity: Minor
                  Found in app/models/build_list.rb - About 1 hr to fix

                  Method archive has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                  Open

                  def archive
                  format, @treeish = params[:format], params[:treeish]
                  raise Grit::NoSuchPathError unless @treeish =~ /^#{@project.name}-/ &&
                  @treeish !~ /[\s]+/ &&
                  format =~ /\A(zip|tar\.gz)\z/
                  Severity: Minor
                  Found in app/controllers/projects/git/trees_controller.rb - About 1 hr to fix

                  Method create has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                  Open

                  def create
                  notices, errors = [], []
                   
                  @repository = Repository.find build_list_params[:save_to_repository_id]
                  @platform = @repository.platform
                  Severity: Minor
                  Found in app/controllers/projects/build_lists_controller.rb - About 1 hr to fix

                  Method update_rpm_builds has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  def update_rpm_builds
                  build_lists = BuildList.where(id: options['build_list_ids'])
                  build_lists.each do |build_list|
                  update_results build_list
                  case status
                  Severity: Minor
                  Found in app/jobs/abf_worker/publish_observer.rb - About 1 hr to fix

                    Method perform has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    def self.perform
                    integrity_path = Rails.root.join('public', 'integrity')
                    Dir.mkdir(integrity_path, 0755) rescue nil
                     
                    start_time = Time.now.utc
                    Severity: Minor
                    Found in app/jobs/integrity_check_job.rb - About 1 hr to fix

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

                      def build_list_notifications
                      if mass_build.blank? && ( # Do not show mass build activity in activity feeds
                      status_changed? && [
                      BuildList::BUILD_PENDING,
                      BuildList::BUILD_PUBLISHED,
                      Severity: Minor
                      Found in app/models/concerns/feed/build_list.rb - About 1 hr to fix

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

                        def set_additional_data params
                        return true if params[:path].blank? && params[:line].blank? # not inline comment
                        if params[:in_reply].present? && reply = Comment.where(id: params[:in_reply]).first
                        self.data = reply.data
                        return true
                        Severity: Minor
                        Found in app/models/comment.rb - About 1 hr to fix
                          Severity
                          Category
                          Status
                          Source
                          Language