Please wait. This can take some minutes ...
Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance.
Project price only 1 $
You can buy this project and download/modify it how often you want.
scripts.views.sonar-violations-view-min.js Maven / Gradle / Ivy
AJS.$.namespace("AJS.sonar.views.violations");AJS.sonar.views.violations.VIEW_NAME="violations";AJS.sonar.views.violations.METRICS="violations_density,efficiency,maintainability,portability,reliability,usability,violations,blocker_violations,critical_violations,major_violations,minor_violations,info_violations";AJS.sonar.views.violations.VIOLATIONS_PRIORITIES={blocker:{name:"blocker_violations",priority:"BLOCKER",image:"/images/priority/BLOCKER.gif"},critical:{name:"critical_violations",priority:"CRITICAL",image:"/images/priority/CRITICAL.gif"},major:{name:"major_violations",priority:"MAJOR",image:"/images/priority/MAJOR.gif"},minor:{name:"minor_violations",priority:"MINOR",image:"/images/priority/MINOR.gif"},info:{name:"info_violations",priority:"INFO",image:"/images/priority/INFO.gif"}};AJS.sonar.views.violations.generateView=function(f,d,k,e){AJS.sonar.text.load(f);var j=AJS.sonar.views.createViewContainer();var g=AJS.sonar.views.createColumn(true);g.append(AJS.sonar.views.createHeader("sonar.views.violations.rules.compliance"));AJS.sonar.views.createMeasureRow(d.host,AJS.sonar.views.VIOLATIONS_VIEW,k.id,AJS.sonar.utils.getMeasureFromResource(k,"violations_density"),AJS.sonar.utils.getMetricFromMetricsArray(e,"violations_density"),true).appendTo(g);var h=AJS.sonar.utils.getMeasureFromResource(k,"efficiency");var a=AJS.sonar.utils.getMeasureFromResource(k,"maintainability");var l=AJS.sonar.utils.getMeasureFromResource(k,"portability");var i=AJS.sonar.utils.getMeasureFromResource(k,"reliability");var c=AJS.sonar.utils.getMeasureFromResource(k,"usability");AJS.$(" ").attr({href:d.host+"/drilldown/violations/"+k.id+"?filter=category",target:"_parent"}).append(AJS.$(" ").attr({src:d.host+"/chart?ck=xradar&w=140&h=110&c=777777|F8A036&m=100&g=0.25&l=Eff.,Mai.,Por.,Rel.,Usa.&v="+h.val+","+a.val+","+l.val+","+i.val+","+c.val,width:140,height:110})).appendTo(g);g.appendTo(j);var b=AJS.sonar.views.createColumn(false);b.append(AJS.sonar.views.createHeader("sonar.views.violations"));AJS.sonar.views.violations.createViolationMeasureRow(d.host,AJS.sonar.views.VIOLATIONS_VIEW,k.key,AJS.sonar.utils.getMeasureFromResource(k,"violations"),AJS.sonar.utils.getMetricFromMetricsArray(e,"violations"),true).appendTo(b);AJS.sonar.views.violations.createViolationPriorityRow(d.host,k,AJS.sonar.utils.getMeasureFromResource(k,"violations"),AJS.sonar.views.violations.VIOLATIONS_PRIORITIES.blocker).appendTo(b);AJS.sonar.views.violations.createViolationPriorityRow(d.host,k,AJS.sonar.utils.getMeasureFromResource(k,"violations"),AJS.sonar.views.violations.VIOLATIONS_PRIORITIES.critical).appendTo(b);AJS.sonar.views.violations.createViolationPriorityRow(d.host,k,AJS.sonar.utils.getMeasureFromResource(k,"violations"),AJS.sonar.views.violations.VIOLATIONS_PRIORITIES.major).appendTo(b);AJS.sonar.views.violations.createViolationPriorityRow(d.host,k,AJS.sonar.utils.getMeasureFromResource(k,"violations"),AJS.sonar.views.violations.VIOLATIONS_PRIORITIES.minor).appendTo(b);AJS.sonar.views.violations.createViolationPriorityRow(d.host,k,AJS.sonar.utils.getMeasureFromResource(k,"violations"),AJS.sonar.views.violations.VIOLATIONS_PRIORITIES.info).appendTo(b);b.appendTo(j);AJS.sonar.views.addViewFooter(j,d.host);return j};AJS.sonar.views.violations.createViolationPriorityRow=function(a,g,e,c){var f=AJS.$("
").addClass("violation-row");AJS.$(" ").attr({src:a+c.image}).appendTo(f);AJS.$("
").addClass("violation-name").append(AJS.$(" ").attr({href:a+"/drilldown/violations/"+g.key+"?priority="+c.priority,target:"_parent"}).text(AJS.sonar.text.getMsg("sonar.views.violations."+c.name))).appendTo(f);var d=AJS.sonar.utils.getMeasureFromResource(g,c.name);AJS.$("
").addClass("violations alert_"+d.alert).text(d.frmt_val).appendTo(f);if(d.val>0){var b=AJS.sonar.utils.getPercentage(d.val,e.val);AJS.$("
").addClass("barchart").css({width:b+"px"}).append(AJS.$("
").css({width:"100%","background-color":"#777"})).appendTo(f)}return f};AJS.sonar.views.violations.createViolationMeasureRow=function(d,i,j,b,f,e){var c="sonar.views."+i+".";var k=AJS.$("
");if(e){k.addClass("big-measure")}var g="metric="+f.key;if(AJS.sonar.views.ALTERNATE_METRIC_LINK_PARAMS[f.key]){g=AJS.sonar.views.ALTERNATE_METRIC_LINK_PARAMS[f.key]}var a=AJS.$(" ").attr({href:d+"/drilldown/violations/"+j,target:"_parent"});a.append(AJS.$(" ").addClass("alert_"+b.alert).text(b.frmt_val));if(AJS.sonar.text.getMsg(c+f.key)!==""&&AJS.sonar.text.getMsg(c+f.key)!==(c+f.key)){a.append(AJS.$(" ").text(" "+AJS.sonar.text.getMsg(c+f.key)))}var h=AJS.sonar.utils.getTrendImage(b,!e);if(h!==""){a.append(AJS.$(" ").attr({src:d+"/images"+h}))}a.appendTo(k);return k};