rosa-abf/rosa-build

View on GitHub
app/helpers/build_lists_helper.rb

Summary

Maintainability
B
5 hrs
Test Coverage

Showing 6 of 6 total issues

File build_lists_helper.rb has 292 lines of code (exceeds 250 allowed). Consider refactoring.
Open

module BuildListsHelper
 
# See: app/assets/javascripts/angularjs/models/build_list.js.erb
def build_list_status_color(status)
case status
Severity: Minor
Found in app/helpers/build_lists_helper.rb - About 3 hrs to fix

    Method build_list_version_name has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
    Open

    def build_list_version_name(bl)
    hash_size=5
    if bl.commit_hash.present?
    if bl.last_published_commit_hash.present? && bl.last_published_commit_hash != bl.commit_hash
    "#{shortest_hash_id bl.last_published_commit_hash, hash_size}...#{shortest_hash_id bl.commit_hash, hash_size}"
    Severity: Minor
    Found in app/helpers/build_lists_helper.rb - About 25 mins to fix

    Method build_list_version_link has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
    Open

    def build_list_version_link(bl)
    hash_size=5
    if bl.commit_hash.present?
    if bl.last_published_commit_hash.present? && bl.last_published_commit_hash != bl.commit_hash
    link_to "#{shortest_hash_id bl.last_published_commit_hash, hash_size}...#{shortest_hash_id bl.commit_hash, hash_size}",
    Severity: Minor
    Found in app/helpers/build_lists_helper.rb - About 25 mins to fix

    Method get_build_list_version_path has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
    Open

    def get_build_list_version_path(bl)
    if bl.commit_hash.present?
    if bl.last_published_commit_hash.present? && bl.last_published_commit_hash != bl.commit_hash
    diff_path(bl.project, bl.last_published_commit_hash) + "...#{bl.commit_hash}"
    else
    Severity: Minor
    Found in app/helpers/build_lists_helper.rb - About 25 mins to fix

    Method build_list_item_version_link has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
    Open

    def build_list_item_version_link(item, str_version = false)
    hash_size=5
    if item.version =~ /^[\da-z]+$/ && item.name == item.build_list.project.name
    bl = item.build_list
    {
    Severity: Minor
    Found in app/helpers/build_lists_helper.rb - About 25 mins to fix

    Method save_to_repositories has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
    Open

    def save_to_repositories(project, params)
    project.repositories.map do |r|
    # Show only main platforms which user used as default.
    next if r.platform.main? && current_user_platforms.present? && current_user_platforms.exclude?(r.platform.id)
    {
    Severity: Minor
    Found in app/helpers/build_lists_helper.rb - About 25 mins to fix
    Category
    Status