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};