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

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.$("




© 2015 - 2024 Weber Informatics LLC | Privacy Policy