Script map
Read the code of the scripts without running it to draw who calls whom (execute, include, call, stack) and what each script does: its connections, SQL tables read and written, mails, hosts, files, transfers, jobs and flows. script impact gives every caller up to the entry points, script orphans the scripts nothing calls, and computed names, missing scripts and cycles are shown. Typical uses: check what a change of a library script affects, find dead scripts, document an application.
script graphscript graphscript graph_allscript graph_allscript orphansscript orphansscript impactscript impact

script graph <script>


Description

    The map of a script: the scripts it calls, down to depth 4. {analysis, script, direction, depth, nodes_count, edges_count, missing, not_granted, dynamic, cycles, truncated, timed_out, nodes: [{id, name, kind (script, missing, not_granted, dynamic), level (calls from the script, negative for the callers), method, params, desc, lines, calls_out, in_cycle, expanded (false: not followed because of the depth), entry, badges, effects: {connections, sql_read, sql_written, sql_uncertain, mails, hosts, files_read, files_written, transfers, jobs, flows, generates_scripts, families...}}], edges: [{from, to, type (execute, include, call, stack), dynamic, expr, lines, cycle}]}

Parameters

    script:   The name of the script, with its method (as in the development tree, for example app.100.lib.guard.exe) - String - required
admin
script graph "zz_scgraph_test.root.exe"
mentdb
{"analysis": "static analysis of the code (nothing executed): computed names and SQL built at run time are not known", "script": "zz_scgraph_test.root.exe", "direction": "down", "depth": 4, "nodes_count": 5, "edges_count": 5, "missing": 0, "not_granted": 0, "dynamic": 0, "cycles": 0, "truncated": false, "timed_out": false, "nodes": [{"id": "zz_scgraph_test.root.exe", "name": "zz_scgraph_test.root.exe", "kind": "script", "level": 0, "method": "exe", "params": ["[run]"], "desc": "Script map test: root", "lines": 8, "calls_out": 2, "in_cycle": false, "expanded": true, "entry": [], "badges": ["stack"], "effects": {"connections": [], "computed_connection": false, "sql_read": [], "sql_written": [], "sql_uncertain": false, "mails": [], "hosts": [], "computed_host": false, "files_read": [], "files_written": [], "computed_file": false, "transfers": [], "jobs": [], "flows": [], "generates_scripts": [], "families": {"Date": 2, "Log": 2, "Server": 1, "Stack": 2}}}, {"id": "zz_scgraph_test.a.exe", "name": "zz_scgraph_test.a.exe", "kind": "script", "level": 1, "method": "exe", "params": ["[n]"], "desc": "Script map test: a", "lines": 6, "calls_out": 1, "in_cycle": false, "expanded": true, "entry": [], "badges": ["stack"], "effects": {"connections": [], "computed_connection": false, "sql_read": [], "sql_written": [], "sql_uncertain": false, "mails": [], "hosts": [], "computed_host": false, "files_read": [], "files_written": [], "computed_file": false, "transfers": [], "jobs": [], "flows": [], "generates_scripts": [], "families": {"Date": 1, "Log": 1, "Server": 1, "Stack": 1}}}, {"id": "zz_scgraph_test.b.exe", "name": "zz_scgraph_test.b.exe", "kind": "script", "level": 1, "method": "exe", "params": [], "desc": "Script map test: b", "lines": 6, "calls_out": 2, "in_cycle": false, "expanded": true, "entry": [], "badges": ["stack"], "effects": {"connections": [], "computed_connection": false, "sql_read": [], "sql_written": [], "sql_uncertain": false, "mails": [], "hosts": [], "computed_host": false, "files_read": [], "files_written": [], "computed_file": false, "transfers": [], "jobs": [], "flows": [], "generates_scripts": [], "families": {"Date": 2, "Server": 1, "Stack": 2}}}, {"id": "zz_scgraph_test.c.exe", "name": "zz_scgraph_test.c.exe", "kind": "script", "level": 2, "method": "exe", "params": [], "desc": "Script map test: c", "lines": 5, "calls_out": 0, "in_cycle": false, "expanded": true, "entry": [], "badges": [], "effects": {"connections": [], "computed_connection": false, "sql_read": [], "sql_written": [], "sql_uncertain": false, "mails": [], "hosts": [], "computed_host": false, "files_read": [], "files_written": [], "computed_file": false, "transfers": [], "jobs": [], "flows": [], "generates_scripts": [], "families": {"Log": 1, "Server": 1}}}, {"id": "zz_scgraph_test.fail.exe", "name": "zz_scgraph_test.fail.exe", "kind": "script", "level": 2, "method": "exe", "params": [], "desc": "Script map test: fails", "lines": 4, "calls_out": 0, "in_cycle": false, "expanded": true, "entry": [], "badges": [], "effects": {"connections": [], "computed_connection": false, "sql_read": [], "sql_written": [], "sql_uncertain": false, "mails": [], "hosts": [], "computed_host": false, "files_read": [], "files_written": [], "computed_file": false, "transfers": [], "jobs": [], "flows": [], "generates_scripts": [], "families": {"Server": 1, "Statement": 1}}}], "edges": [{"from": "zz_scgraph_test.root.exe", "to": "zz_scgraph_test.a.exe", "type": "stack", "dynamic": false, "lines": [3], "cycle": false}, {"from": "zz_scgraph_test.root.exe", "to": "zz_scgraph_test.b.exe", "type": "stack", "dynamic": false, "lines": [4], "cycle": false}, {"from": "zz_scgraph_test.a.exe", "to": "zz_scgraph_test.c.exe", "type": "stack", "dynamic": false, "lines": [4], "cycle": false}, {"from": "zz_scgraph_test.b.exe", "to": "zz_scgraph_test.fail.exe", "type": "stack", "dynamic": false, "lines": [3], "cycle": false}, {"from": "zz_scgraph_test.b.exe", "to": "zz_scgraph_test.c.exe", "type": "stack", "dynamic": false, "lines": [4], "cycle": false}]}

script graph <script> <json_params>


Description

    The map of a script with parameters: depth (4, 0 to 20), direction (down: the scripts it calls, up: the scripts that call it, both), max_nodes (500, 1 to 5000), max_edges (2000, 1 to 20000), effects (true: the effects of each script), candidates (20, 0 to 200: the scripts listed for a dynamic call), timeout_ms (10000, 100 to 60000)

Parameters

    script:   The name of the script, with its method (as in the development tree, for example app.100.lib.guard.exe) - String - required
    json_params:   The parameters - String - required
admin
script graph "zz_scgraph_test.c.exe" "{\"direction\": \"up\", \"effects\": false}"
mentdb
{"analysis": "static analysis of the code (nothing executed): computed names and SQL built at run time are not known", "script": "zz_scgraph_test.c.exe", "direction": "up", "depth": 4, "nodes_count": 5, "edges_count": 5, "missing": 0, "not_granted": 0, "dynamic": 0, "cycles": 0, "truncated": false, "timed_out": false, "nodes": [{"id": "zz_scgraph_test.c.exe", "name": "zz_scgraph_test.c.exe", "kind": "script", "level": 0, "method": "exe", "params": [], "desc": "Script map test: c", "lines": 5, "calls_out": 0, "in_cycle": false, "entry": [], "badges": []}, {"id": "zz_scgraph_test.a.exe", "name": "zz_scgraph_test.a.exe", "kind": "script", "level": -1, "method": "exe", "params": ["[n]"], "desc": "Script map test: a", "lines": 6, "calls_out": 1, "in_cycle": false, "entry": [], "badges": ["stack"]}, {"id": "zz_scgraph_test.b.exe", "name": "zz_scgraph_test.b.exe", "kind": "script", "level": -1, "method": "exe", "params": [], "desc": "Script map test: b", "lines": 6, "calls_out": 2, "in_cycle": false, "entry": [], "badges": ["stack"]}, {"id": "zz_scgraph_test.slow.exe", "name": "zz_scgraph_test.slow.exe", "kind": "script", "level": -1, "method": "exe", "params": [], "desc": "Script map test: slow", "lines": 6, "calls_out": 1, "in_cycle": false, "entry": [], "badges": ["stack"]}, {"id": "zz_scgraph_test.root.exe", "name": "zz_scgraph_test.root.exe", "kind": "script", "level": -2, "method": "exe", "params": ["[run]"], "desc": "Script map test: root", "lines": 8, "calls_out": 2, "in_cycle": false, "entry": [], "badges": ["stack"]}], "edges": [{"from": "zz_scgraph_test.a.exe", "to": "zz_scgraph_test.c.exe", "type": "stack", "dynamic": false, "lines": [4], "cycle": false}, {"from": "zz_scgraph_test.b.exe", "to": "zz_scgraph_test.c.exe", "type": "stack", "dynamic": false, "lines": [4], "cycle": false}, {"from": "zz_scgraph_test.slow.exe", "to": "zz_scgraph_test.c.exe", "type": "stack", "dynamic": false, "lines": [3], "cycle": false}, {"from": "zz_scgraph_test.root.exe", "to": "zz_scgraph_test.a.exe", "type": "stack", "dynamic": false, "lines": [3], "cycle": false}, {"from": "zz_scgraph_test.root.exe", "to": "zz_scgraph_test.b.exe", "type": "stack", "dynamic": false, "lines": [4], "cycle": false}]}
A direction that does not exist
admin
script graph "zz_scgraph_test.c.exe" "{\"direction\": \"left\"}"
mentdb
ERROR: Sorry, an error appears (the parameter 'direction' must be down, up or both).
Used in use cases (1 recipe)

    Script developer › Know which scripts a change will affect before touching a library script
Often used with

    cm get  ·  execute  ·  include  ·  script create  ·  script delete  ·  script impact  ·  sql connect  ·  sql disconnect

script graph_all


Description

    The map of all the scripts the user can read: {analysis, prefix, scripts, nodes_count, edges_count, calls, dynamic_calls, missing, orphans, cycles, truncated, timed_out, dynamic_capped, nodes: [{id, name, kind, method, lines, calls_out, in_cycle, in, out, dynamic_calls, entry, orphan, badges}], edges}

admin
script graph_all "{\"max_nodes\": 0}"
mentdb
ERROR: Sorry, an error appears (the parameter 'max_nodes' must be an integer from 1 to 20000).

script graph_all <json_params>


Description

    The map of all the scripts with parameters: prefix (only the scripts whose name starts with it, case insensitive; a called script outside the prefix is shown with outside_prefix true), effects (badges: short labels, full: the effects and the description, none), dynamic_edges (false: true adds an edge of type dynamic to each script a computed name may give, 50 at most by call), max_nodes (5000, 1 to 20000), timeout_ms (20000, 100 to 60000)

Parameters

    json_params:   The parameters - String - required
admin
script graph_all "{\"prefix\": \"zz_scgraph_test.\"}"
mentdb
{"analysis": "static analysis of the code (nothing executed): computed names and SQL built at run time are not known", "prefix": "zz_scgraph_test.", "scripts": 6, "nodes_count": 6, "edges_count": 6, "calls": 6, "dynamic_calls": 0, "missing": 0, "orphans": 2, "cycles": 0, "truncated": false, "timed_out": false, "dynamic_capped": false, "nodes": [{"id": "zz_scgraph_test.a.exe", "name": "zz_scgraph_test.a.exe", "kind": "script", "method": "exe", "lines": 6, "calls_out": 1, "in_cycle": false, "in": 1, "out": 1, "dynamic_calls": 0, "entry": [], "orphan": false, "badges": ["stack"]}, {"id": "zz_scgraph_test.b.exe", "name": "zz_scgraph_test.b.exe", "kind": "script", "method": "exe", "lines": 6, "calls_out": 2, "in_cycle": false, "in": 1, "out": 2, "dynamic_calls": 0, "entry": [], "orphan": false, "badges": ["stack"]}, {"id": "zz_scgraph_test.c.exe", "name": "zz_scgraph_test.c.exe", "kind": "script", "method": "exe", "lines": 5, "calls_out": 0, "in_cycle": false, "in": 3, "out": 0, "dynamic_calls": 0, "entry": [], "orphan": false, "badges": []}, {"id": "zz_scgraph_test.fail.exe", "name": "zz_scgraph_test.fail.exe", "kind": "script", "method": "exe", "lines": 4, "calls_out": 0, "in_cycle": false, "in": 1, "out": 0, "dynamic_calls": 0, "entry": [], "orphan": false, "badges": []}, {"id": "zz_scgraph_test.root.exe", "name": "zz_scgraph_test.root.exe", "kind": "script", "method": "exe", "lines": 8, "calls_out": 2, "in_cycle": false, "in": 0, "out": 2, "dynamic_calls": 0, "entry": [], "orphan": true, "badges": ["stack"]}, {"id": "zz_scgraph_test.slow.exe", "name": "zz_scgraph_test.slow.exe", "kind": "script", "method": "exe", "lines": 6, "calls_out": 1, "in_cycle": false, "in": 0, "out": 1, "dynamic_calls": 0, "entry": [], "orphan": true, "badges": ["stack"]}], "edges": [{"from": "zz_scgraph_test.a.exe", "to": "zz_scgraph_test.c.exe", "type": "stack", "dynamic": false, "lines": [4], "cycle": false}, {"from": "zz_scgraph_test.b.exe", "to": "zz_scgraph_test.fail.exe", "type": "stack", "dynamic": false, "lines": [3], "cycle": false}, {"from": "zz_scgraph_test.b.exe", "to": "zz_scgraph_test.c.exe", "type": "stack", "dynamic": false, "lines": [4], "cycle": false}, {"from": "zz_scgraph_test.root.exe", "to": "zz_scgraph_test.a.exe", "type": "stack", "dynamic": false, "lines": [3], "cycle": false}, {"from": "zz_scgraph_test.root.exe", "to": "zz_scgraph_test.b.exe", "type": "stack", "dynamic": false, "lines": [4], "cycle": false}, {"from": "zz_scgraph_test.slow.exe", "to": "zz_scgraph_test.c.exe", "type": "stack", "dynamic": false, "lines": [3], "cycle": false}]}

script orphans


Description

    The scripts called by no other script: {analysis, prefix, scripts, orphans, with_entry_point, without_entry_point, returned, truncated, timed_out, dynamic_capped, rows: [{script, method, calls_out, lines, entry}]}; entry tells why an orphan is still used (web_service, job, job_in_code, dynamic_target), an orphan without entry point may be dead code

admin
script orphans "{\"max_results\": 0}"
mentdb
ERROR: Sorry, an error appears (the parameter 'max_results' must be an integer from 1 to 20000).

script orphans <json_params>


Description

    The orphan scripts with parameters: prefix (the callers are searched in all the scripts, the orphans only among the prefix), max_results (1000, 1 to 20000), timeout_ms (20000, 100 to 60000)

Parameters

    json_params:   The parameters - String - required
admin
script orphans "{\"prefix\": \"zz_scgraph_test.\"}"
mentdb
{"analysis": "static analysis of the code (nothing executed): computed names and SQL built at run time are not known", "prefix": "zz_scgraph_test.", "scripts": 938, "orphans": 2, "with_entry_point": 0, "without_entry_point": 2, "returned": 2, "truncated": false, "timed_out": false, "dynamic_capped": false, "rows": [{"script": "zz_scgraph_test.root.exe", "method": "exe", "calls_out": 2, "lines": 8, "entry": []}, {"script": "zz_scgraph_test.slow.exe", "method": "exe", "calls_out": 1, "lines": 6, "entry": []}]}

script impact <script>


Description

    All the scripts that call a script, directly or not, up to the scripts that nothing calls: {analysis, script, scripts, callers, max_distance, tops (the callers that nothing calls), truncated, timed_out, dynamic_capped, rows: [{script, distance (number of calls to the script), calls (the types of calls), via (the scripts at distance - 1 that it calls, the script itself for a direct caller), entry, top}], maybe_dynamic: [{script, type, line, expr}] (the computed calls that may reach the script, not followed)}

Parameters

    script:   The name of the script, with its method (as in the development tree, for example app.100.lib.guard.exe) - String - required
admin
script impact "zz_scgraph_test.c.exe"
mentdb
{"analysis": "static analysis of the code (nothing executed): computed names and SQL built at run time are not known", "script": "zz_scgraph_test.c.exe", "scripts": 938, "callers": 4, "max_distance": 2, "tops": ["zz_scgraph_test.slow.exe", "zz_scgraph_test.root.exe"], "truncated": false, "timed_out": false, "dynamic_capped": false, "rows": [{"script": "zz_scgraph_test.a.exe", "distance": 1, "calls": ["stack"], "via": ["zz_scgraph_test.c.exe"], "entry": [], "top": false}, {"script": "zz_scgraph_test.b.exe", "distance": 1, "calls": ["stack"], "via": ["zz_scgraph_test.c.exe"], "entry": [], "top": false}, {"script": "zz_scgraph_test.slow.exe", "distance": 1, "calls": ["stack"], "via": ["zz_scgraph_test.c.exe"], "entry": [], "top": true}, {"script": "zz_scgraph_test.root.exe", "distance": 2, "calls": ["stack"], "via": ["zz_scgraph_test.a.exe", "zz_scgraph_test.b.exe"], "entry": [], "top": true}], "maybe_dynamic": []}

script impact <script> <json_params>


Description

    The callers with parameters: max_depth (20, 1 to 50), max_results (5000, 1 to 20000), timeout_ms (20000, 100 to 60000)

Parameters

    script:   The name of the script, with its method (as in the development tree, for example app.100.lib.guard.exe) - String - required
    json_params:   The parameters - String - required
admin
script impact "zz_scgraph_test.c.exe" "{\"depth\": 3}"
mentdb
ERROR: Sorry, an error appears (the parameter 'depth' is unknown).
Used in use cases (1 recipe)

    Script developer › Know which scripts a change will affect before touching a library script
Often used with

    cm get  ·  execute  ·  include  ·  script create  ·  script delete  ·  script graph  ·  sql connect  ·  sql disconnect