{"size": 3925, "ext": "js", "max_stars_repo_path": "sigpro/resources/sap/ui/core/rules/Misc.support.js", "max_stars_repo_name": "henriquemeira/openui5lab", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "sigpro/resources/sap/ui/core/rules/Misc.support.js", "max_issues_repo_name": "henriquemeira/openui5lab", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "sigpro/resources/sap/ui/core/rules/Misc.support.js", "max_forks_repo_name": "henriquemeira/openui5lab", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 654.1666666667, "max_line_length": 3774, "alphanum_fraction": 0.7521019108}
/*!
 * OpenUI5
 * (c) Copyright 2009-2019 SAP SE or an SAP affiliate company.
 * Licensed under the Apache License, Version 2.0 - see LICENSE.txt.
 */
sap.ui.define(["sap/ui/support/library","./CoreHelper.support"],function(e,t){"use strict";var s=sap.ui.require("sap/base/Log");if(!s){s=jQuery.sap.log}var o=e.Categories;var r=e.Severity;var i=e.Audiences;var n={id:"errorLogs",audiences:[i.Control,i.Internal],categories:[o.Performance],enabled:true,minversion:"1.32",title:"Error logs",description:"Checks for the amount of error logs in the console",resolution:"Error logs should be fixed",resolutionurls:[],check:function(e,t){var o=0,i="";var n=s.getLogEntries();n.forEach(function(e){if(e.level===s.Level.ERROR){o++;if(o<=20){i+="- "+e.message+"\n"}}});if(o>0){e.addIssue({severity:r.Low,details:"Total error logs: "+o+"\n"+i,context:{id:"WEBPAGE"}})}}};var a={id:"cssCheckCustomStyles",audiences:[i.Application],categories:[o.Consistency],enabled:true,minversion:"1.38",title:"CSS modifications - List of custom styles",description:"Checks and report for custom CSS files/styles that overwrite standard UI5 control's CSS values ",resolution:"Avoid CSS manipulations with custom CSS values as this could lead to rendering issues ",resolutionurls:[{text:"CSS Styling Issues",href:"https://openui5.hana.ondemand.com/#docs/guide/9d87f925dfbb4e99b9e2963693aa00ef.html"},{text:"General Guidelines",href:"https://openui5.hana.ondemand.com/#docs/guide/5e08ff90b7434990bcb459513d8c52c4.html"}],check:function(e,s,o){var r="Following stylesheet file(s) contain 'custom' CSS that could affects (overwrites) UI5 controls' own styles: \n",i=t.getExternalStyleSheets(),n=0;i.forEach(function(e){var s=false;Array.from(e.rules).forEach(function(e){var r=e.selectorText,i=document.querySelectorAll(r);i.forEach(function(e){var r=t.nodeHasUI5ParentControl(e,o);if(r){s=true}})});if(s){r+="- "+t.getStyleSheetName(e)+"\n";n++}});if(n>0){e.addIssue({severity:sap.ui.support.Severity.Medium,details:r,context:{id:"WEBPAGE"}})}}};var l={id:"cssCheckCustomStylesThatAffectControls",audiences:[i.Application],categories:[o.Consistency],enabled:true,minversion:"1.38",title:"CSS modifications - List of affected controls",description:"Checks and report all overwritten standard control's CSS values ",resolution:"Avoid CSS manipulations with custom CSS values as this could lead to rendering issues ",resolutionurls:[{text:"CSS Styling Issues",href:"https://openui5.hana.ondemand.com/#docs/guide/9d87f925dfbb4e99b9e2963693aa00ef.html"},{text:"General Guidelines",href:"https://openui5.hana.ondemand.com/#docs/guide/5e08ff90b7434990bcb459513d8c52c4.html"}],check:function(e,s,o){var r={},i=t.getExternalStyleSheets();i.forEach(function(e){Array.from(e.rules).forEach(function(s){var i=s.selectorText,n=document.querySelectorAll(i);n.forEach(function(s){var n=t.nodeHasUI5ParentControl(s,o);if(n){var a=jQuery(s).control()[0];if(!r.hasOwnProperty(a.getId())){r[a.getId()]=""}var l=t.getStyleSource(e);r[a.getId()]+="'"+i+"'"+" from "+l+",\n"}})})});Object.keys(r).forEach(function(t){e.addIssue({severity:sap.ui.support.Severity.Low,details:"The following selector(s) "+r[t]+" affects standard style setting for control",context:{id:t}})})}};var c={id:"eventBusSilentPublish",audiences:[i.Internal],categories:[o.Functionality],enabled:true,minversion:"1.32",title:"EventBus publish",description:"Checks the EventBus publications for missing listeners",resolution:"Calls to EventBus#publish should be removed or adapted such that associated listeners are found",resolutionurls:[],check:function(e,t){var o=s.getLogEntries();var i=[];o.forEach(function(e){if(e.component==="sap.ui.core.EventBus"){if(e.details&&e.details.indexOf("sap.")!==0){if(i.indexOf(e.message)===-1){i.push(e.message)}}}});i.forEach(function(t){e.addIssue({severity:r.Low,details:"EventBus publish without listeners "+t,context:{id:"WEBPAGE"}})})}};return[c,n,a,l]},true);