All Downloads are FREE. Search and download functionalities are using the official Maven repository.

scripts.sonar-utils-min.js Maven / Gradle / Ivy

AJS.$.namespace("AJS.sonar.utils");AJS.sonar.utils.getTrendImage=function(a,c){if(a.trend===undefined||a["var"]===undefined){return""}else{if(a.trend===0&&a["var"]===0){return""}else{var b="/tendency/"+a["var"]+"-";if(a.trend===1){b=b+"green"}else{b=b+"black"}if(c){b=b+"-small"}return b+".png"}}};AJS.sonar.utils.getMeasureFromResource=function(b,c){for(var a in b.msr){if(b.msr[a].key===c){return b.msr[a]}}return{}};AJS.sonar.utils.getMetricFromMetricsArray=function(b,c){for(var a in b){if(b[a].key===c){return b[a]}}return{}};AJS.sonar.utils.isValidMetric=function(a){return !(a!=null&&a!==undefined&&a.key!==undefined)};AJS.sonar.utils.isValidMeasure=function(a){return !(a!=null&&a!==undefined&&a.key!==undefined)};AJS.sonar.utils.getColorMetrics=function(c){var a=new Array();for(var b in c){if(c[b].val_type==="LEVEL"||c[b].val_type==="PERCENT"){a.push(c[b])}}a.sort(function(e,d){return(e.name>d.name)-(d.name>e.name)});return a};AJS.sonar.utils.getSizeMetrics=function(b){var c=new Array();for(var a in b){if((b[a].val_type==="INT"||b[a].val_type==="FLOAT"||b[a].val_type==="MILLISEC")&&b[a].val_type!=="PERCENT"&&b[a].domain!=undefined&&b[a].domain!=null&&b[a].domain!==""){c.push(b[a])}}c.sort(function(e,d){return(e.name>d.name)-(d.name>e.name)});return c};AJS.sonar.utils.createMetricSelectElement=function(d,f,c,e,b){var a=AJS.$("