2016-06-21 16:50:45 +08:00
|
|
|
module QualityAnalysisHelper
|
2016-06-23 18:24:22 +08:00
|
|
|
|
|
|
|
def sqale_rating_status val
|
|
|
|
if val.to_i > 0 && val.to_i < 5
|
|
|
|
"henhao"
|
|
|
|
elsif val.to_i > 5 && val.to_i < 10
|
|
|
|
|
|
|
|
elsif val.to_i > 10 && val.to_i < 20
|
|
|
|
elsif val.to_i > 20 && val.to_i < 50
|
|
|
|
"yiban"
|
|
|
|
elsif val.to_i > 20
|
|
|
|
"cha"
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
def complexity_status val
|
|
|
|
if val.to_i < 10
|
|
|
|
"zhengchang"
|
|
|
|
elsif val.to_i > 10 && val.to_i < 15
|
|
|
|
"yiban"
|
|
|
|
elsif val.to_i > 15
|
|
|
|
"cha"
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
def duplicated_lines_density_status val
|
|
|
|
if val.to_i < 30
|
|
|
|
"zhengchang"
|
|
|
|
elsif val.to_i > 30 && val.to_i < 50
|
|
|
|
"jiaogao"
|
|
|
|
elsif val.to_i > 50
|
|
|
|
"gao"
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
def comment_lines_density_status val
|
|
|
|
if val.to_i < 20
|
|
|
|
"paindi"
|
|
|
|
elsif val.to_i > 20 && val.to_i < 50
|
|
|
|
"jiaohao"
|
|
|
|
elsif val.to_i > 50
|
|
|
|
"hao"
|
|
|
|
end
|
|
|
|
end
|
2016-06-21 16:50:45 +08:00
|
|
|
end
|