servicenowdevprogram / example-instancescan-checks Goto Github PK
View Code? Open in Web Editor NEWHome Page: https://github.com/ServiceNowDevProgram/Hacktoberfest
License: GNU General Public License v2.0
Home Page: https://github.com/ServiceNowDevProgram/Hacktoberfest
License: GNU General Public License v2.0
Improve the Script Only Check named "Update set should not have more than 1000 updates".
When using setValue() on a reference field, be sure to include the display value with the value (sys_id). If you set the value without the display value, ServiceNow does a synchronous Ajax call to retrieve the display value for the record you specified. This extra round trip to the server can leave you at risk of performance issues.
The glide.invalid_query.returns_no_rows prevents invalid queries from returning rows and would be a good practice to have in place. See: https://www.servicenow.com/community/developer-blog/protect-custom-scripts-from-unwanted-behavior-using-this-system/ba-p/2291471
The Readme file was updated incorrectly at some point. The heading and the description do not match. Heading should be fixed to match the description of the check. See the headings just above this one for similar check description.
Catalog UI policy should be used in either a Catalog Item or a Variable Set. Catalog UI Policies not in use should be deleted.
Similar to other hacktoberfest repositories, we should be consistent and have a banner at the top of each repo's readme.md file.
The file should be in a 4:1 aspect ratio. (eg. 1600px wide and 400 pixels height).
Sometimes when developing new Catalog Items, I find left over variables that are not used anywhere - not associated with a catalog item and also not associated with a variable set. These are unnecessary configuration that just create bloat in your system and it is likely best to not move these configurations to production.
An Instance Scan could flag them/find them so that you can remove them from your Update Set and clean them up.
Full example at: https://www.servicenow.com/community/developer-articles/instance-scan-orphaned-catalog-configurations-examples/ta-p/2302050
Three duplicates were found in the repo:
Name | Table | Delete sys_id | Keep sys_id | Note |
---|---|---|---|---|
Access controls on Tables | scan_table_check | d44f0a4097b29510dd0178300153af7e | 66f9f49ddb7f0010f85054c5dc96191e | Duplicate of baseline Global check |
Access controls on UI Pages | scan_table_check | e660164097b29510dd0178300153af2e | f8fab4dddb7f0010f85054c5dc9619ca | Duplicate of baseline Global check |
Don't use new Array() | scan_check | c2db61672f561110a1803e0ef699b64b | 2e2a8fc02f0730103307235df699b659 | Duplicate of previous commit from mark.roethof |
Sometimes when developing new Catalog Items, I find left over client scripts that are not used anywhere - not associated with a catalog item and also not associated with a variable set. These are unnecessary configurations that just create bloat in your system and it is likely best to not move these configurations to production.
An Instance Scan could flag them/find them so that you can remove them from your Update Set and clean them up.
See example at: https://www.servicenow.com/community/developer-articles/instance-scan-orphaned-catalog-configurations-examples/ta-p/2302050
I think the repo is hitting a tipping point where it's hard to see, browse, and maintain the list of checks in the repos README.
Would enabling the wiki be better from a usability perspective so you can have hierarchy for the categories and automatically alphabetized lists? ๐คทโโ๏ธ
getReference is considered against best practice since it can impact performance. See: https://docs.servicenow.com/bundle/vancouver-api-reference/page/script/client-scripts/concept/client-script-best-practices.html
Copied from link:
Note: GlideRecord and g_form.getReference() are also available for retrieving server information. However, these methods are no longer recommended due to their performance impact. Both methods retrieve all fields in the requested GlideRecord when most cases only require one field.
Sometimes, when developing new Catalog Items/Record Producers, I find left over Catalog UI Policies that are not used anywhere - not associated with a catalog item and also not associated with a variable set. These are unnecessary configurations that just create bloat in your system and it is likely best to not move these configurations to production.
An Instance Scan could flag them/find them so that you can remove them from your Update Set and clean them up.
Full example at: https://www.servicenow.com/community/developer-articles/instance-scan-orphaned-catalog-configurations-examples/ta-p/2302050
App scoping issue - warning in the logs:
java.lang.SecurityException: Method returned an object of type GlideRecord which is not allowed in scope x_appe_exa_checks
Caused by error in Linter Check: 'Linter check name here' at Line 4
Create new Linter Check type Instance Scan for use of GlideRecord Secure on Client Callable Script Includes
Note: there is already an existing Table Check for this. This issue is for a Linter type check.
Show an error/warning when a console.log, gs.log, gs.print, is left.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.