rosa-abf/rosa-build

View on GitHub

Showing 210 of 210 total issues

Method build_for has 28 lines of code (exceeds 25 allowed). Consider refactoring.
Open

def build_for(mass_build, repository_id, arch = Arch.find_by(name: 'i586'), priority = 0, increase_rt = false)
build_for_platform = mass_build.build_for_platform
save_to_platform = mass_build.save_to_platform
user = mass_build.user
# Select main and project platform repository(contrib, non-free and etc)
Severity: Minor
Found in app/models/project.rb - About 1 hr to fix

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

    def create!
    cleanup_folder
     
    if filter_build_lists_without_packages(build_list).blank?
    build_list.fail_publish_container
    Severity: Minor
    Found in app/services/abf_worker_service/container.rb - About 1 hr to fix

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

      def create
      from_project = Project.find_by(id: pull_params[:from_project_id])
      from_project ||= @project
      authorize from_project, :show?
       
       
      Severity: Minor
      Found in app/controllers/api/v1/pull_requests_controller.rb - About 1 hr to fix

      Method receive_issues has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
      Open

      def receive_issues(issue, action)
      pull = issue.pull_request
      return if action.to_sym == :create && pull
      default_url_options
       
       
      Severity: Minor
      Found in app/models/hook.rb - About 1 hr to fix

      Method diff has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
      Open

      def diff
      res = params[:diff].split(/\A(.*)\.\.\.(.*)\z/).select {|e| e.present?}
      if res[1].present?
      params1 = res[0]
      params2 = res[1] == 'HEAD' ? @project.resolve_default_branch : res.last
      Severity: Minor
      Found in app/controllers/projects/git/commits_controller.rb - About 1 hr to fix

      Function highlightShow has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
      Open

      function highlightShow(id) {
      $('td.code span.highlight-line').removeClass('highlight-line');
      var from = to = id.substring(4);
      if (/[0-9]+\-lc-[0-9]+$/.test(from)) {
      var index = to.indexOf('-');
      Severity: Minor
      Found in app/assets/javascripts/extra/highlight.js - About 1 hr to fix

      Method actor_name has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
      Open

      def actor_name
      if @actor.present?
      @actor.instance_of?(User) ? "#{@actor.uname}#{ @actor.try(:name) and !@actor.name.empty? ? " (#{@actor.name})" : ''}" : @actor.uname
      else
      nil
      Severity: Minor
      Found in app/models/collaborator.rb - About 1 hr to fix

      Method set_fingerprint has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
      Open

      def set_fingerprint
      return false unless key
       
      file = Tempfile.new('key_file', '/tmp')
      filename = file.path
      Severity: Minor
      Found in app/models/ssh_key.rb - About 1 hr to fix

      Method render_path has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
      Open

      def render_path
      # TODO: Looks ugly, rewrite with clear mind.
      if @path.present?
      if @treeish == @project.resolve_default_branch
      res = "#{link_to @project.name, tree_path(@project)} / "
      Severity: Minor
      Found in app/helpers/git_helper.rb - About 1 hr to fix

      Method render_diff has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
      Open

      def render_diff(diff, args = {})#diff_counter, comments, opts = nil diffpath = nil)
      if diff.respond_to?(:diff)
      diff, filepath, in_discussion = diff.diff, diff.a_path, false
      comments = (args[:comments] || []).select{|c| c.data.try('[]', :path) == filepath}
      else
      Severity: Minor
      Found in app/helpers/diff_helper.rb - About 1 hr to fix

      Method find has 27 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      def find
      build_lists = @project ? @project.build_lists : BuildList.all
       
      if @options[:id]
      build_lists = build_lists.where(id: @options[:id])
      Severity: Minor
      Found in app/models/build_list/filter.rb - About 1 hr to fix

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

        self.get_sha1_of_archive_path = function(project, type) {
        return Routes.get_sha1_of_archive_path(project.fullname, project.name + '-' + self.ref, {format: type});
        }
        Severity: Major
        Found in app/assets/javascripts/angularjs/models/project_ref.js and 1 other location - About 1 hr to fix
        app/assets/javascripts/angularjs/models/project_ref.js on lines 25..27

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

        self.archive_path = function(project, type) {
        return Routes.archive_path(project.fullname, project.name + '-' + self.ref, {format: type});
        }
        Severity: Major
        Found in app/assets/javascripts/angularjs/models/project_ref.js and 1 other location - About 1 hr to fix
        app/assets/javascripts/angularjs/models/project_ref.js on lines 29..31

        Function keyup has 26 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        keyup: function(e) {
        switch (e.keyCode) {
        case 40: // down arrow
        case 38: // up arrow
        case 16: // shift
        Severity: Minor
        Found in app/assets/javascripts/lib/bootstrap-typeahead.js - About 1 hr to fix

          Method render_diff_stats has 26 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          def render_diff_stats(options = {})
          stats = options[:stats]
          diff = options[:diff]
          repo = options[:repo]
          commit = options[:commit]
          Severity: Minor
          Found in app/helpers/diff_helper.rb - About 1 hr to fix

            Method set_fingerprint has 26 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            def set_fingerprint
            return false unless key
             
            file = Tempfile.new('key_file', '/tmp')
            filename = file.path
            Severity: Minor
            Found in app/models/ssh_key.rb - About 1 hr to fix

              Method regenerate! has 26 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              def regenerate!
              # Checks mirror sync status
              return if repository.repo_lock_file_exists?
               
              platform_path = "#{repository.platform.path}/repository"
              Severity: Minor
              Found in app/services/abf_worker_service/repository_metadata.rb - About 1 hr to fix

                Method initialize has 8 arguments (exceeds 4 allowed). Consider refactoring.
                Open

                def initialize(owner_uname, repo, newrev, oldrev, ref, newrev_type, user = nil, message = nil)
                Severity: Major
                Found in app/models/git_hook.rb - About 1 hr to fix

                  Consider simplifying this complex logical expression.
                  Open

                  if subscribe.user.notifier.can_notify && !own_comment?(subscribe.user)
                  ( (subscribe.project.owner?(subscribe.user) && subscribe.user.notifier.new_comment_commit_repo_owner) ||
                  (subscribe.user.commentor?(self.commentable) && subscribe.user.notifier.new_comment_commit_commentor) ||
                  (subscribe.user.committer?(self.commentable) && subscribe.user.notifier.new_comment_commit_owner) )
                  UserMailer.new_comment_notification(self, subscribe.user_id).deliver
                  Severity: Major
                  Found in app/models/concerns/feed/comment.rb - About 1 hr to fix

                    Method process_hook has 8 arguments (exceeds 4 allowed). Consider refactoring.
                    Open

                    def process_hook(owner_uname, repo, newrev, oldrev, ref, newrev_type, user = nil, message = nil)
                    Severity: Major
                    Found in app/models/concerns/git.rb - About 1 hr to fix
                      Severity
                      Category
                      Status
                      Source
                      Language