MCPcopy Create free account

hub / github.com/ParzivalHack/PySpector / functions

Functions455 in github.com/ParzivalHack/PySpector

↓ 45 callersMethodis_empty
(&self)
src/pyspector/_rust_core/src/analysis/taint_analysis.rs:1747
↓ 32 callersMethodget_ast_json
Return the AST JSON string for *file_path*. Raises ------ SyntaxError If the file cannot be parsed, so c
src/pyspector/ast_cache.py:275
↓ 32 callersFunctionnot_fires
(code, rule_id)
tests/unit/test_a_sink_rules.py:32
↓ 28 callersFunctionfires
(code, rule_id, **kw)
tests/unit/test_missing_rules.py:46
↓ 25 callersFunctionfindings_for_rule
(code: str, rule_id: str, **kwargs)
tests/unit/test_false_positive_reductions.py:70
↓ 24 callersFunction_make_cache
(tmp: Path, max_l1: int = MAX_L1_ENTRIES)
tests/unit/ast_cache_test.py:33
↓ 24 callersMethod_write
(self, name: str, content: str)
tests/unit/ast_cache_test.py:220
↓ 23 callersFunction_make_issue
( rule_id="PY001", description="Use of 'eval()' is highly dangerous.", file_path="path/to/file.py"
tests/unit/reporting_test.py:9
↓ 22 callersFunction_row
(label: str, value: str)
src/pyspector/stats.py:39
↓ 22 callersFunctionfires
(code, rule_id, **kw)
tests/unit/test_group_a_rules.py:50
↓ 20 callersFunctionnot_fires
(code, rule_id, **kw)
tests/unit/test_missing_rules.py:50
↓ 19 callersFunctionfindings_for
(code, rule_id, **kw)
tests/unit/test_taint_engine_extension.py:58
↓ 17 callersFunction_parse_json
(ast_json: str)
tests/unit/ast_cache_test.py:29
↓ 15 callersFunctionextract_all_names
(node: &AstNode)
src/pyspector/_rust_core/src/analysis/taint_analysis.rs:1649
↓ 13 callersFunctionget_default_rules
Loads the built-in TOML rules file from package resources. Substitutes the `__SHARED_PLACEHOLDERS__` sentinel inside any rule's exclude_patte
src/pyspector/config.py:55
↓ 12 callersFunction_dbg
Emit *msg* via click.echo only when --debug is enabled. Used to gate progress/info chatter so the default output stays focused on findings, w
src/pyspector/cli.py:53
↓ 11 callersFunction_sep
Internal two-column divider.
src/pyspector/stats.py:22
↓ 11 callersFunctiontaint_fires
Use taint engine — wraps code in a function for CFG analysis.
tests/unit/test_semantic_provenance.py:37
↓ 10 callersMethodto_json
(self)
src/pyspector/reporting.py:125
↓ 9 callersMethod_disk_path
(self, file_path: Path)
src/pyspector/ast_cache.py:400
↓ 8 callersMethodadd_edge
(&mut self, from: BlockId, to: BlockId, edge_type: EdgeType)
src/pyspector/_rust_core/src/graph/representation.rs:49
↓ 7 callersFunction_assemble_module_json
Build the Module JSON wrapper around pre-serialized body/type_ignore fragments. Pre-conditions (caller must ensure): Every string in b
src/pyspector/ast_cache.py:89
↓ 7 callersFunctioncheck_sink_and_report
( call_node: &AstNode, state: &TaintState, ruleset: &RuleSet, file_path: &str, content: &s
src/pyspector/_rust_core/src/analysis/taint_analysis.rs:1369
↓ 7 callersFunctionfires
(code, rule_id, filename="app.py")
tests/unit/test_semantic_provenance.py:27
↓ 7 callersFunctionget_cache
Return the process-level cache instance. The disk cache is rooted at *<scan_path>/.pyspector_cache/ast* when *scan_path* is supplied on
src/pyspector/ast_cache.py:452
↓ 7 callersMethodto_console
(self)
src/pyspector/reporting.py:84
↓ 6 callersFunction_ai_rule
(rule_id: str)
tests/unit/test_ai_rules.py:28
↓ 6 callersMethod_ids
(self, source: str)
tests/unit/ast_cache_test.py:41
↓ 6 callersFunction_section_title
Two-column section header row (title on left, blank right).
src/pyspector/stats.py:33
↓ 6 callersMethodadd_block
(&mut self)
src/pyspector/_rust_core/src/graph/representation.rs:42
↓ 6 callersFunctionfind_call_sites
(node: &'a AstNode, sites: &mut Vec<&'a AstNode>)
src/pyspector/_rust_core/src/analysis/taint_analysis.rs:1664
↓ 6 callersFunctionfires
(code: str, rule_id: str)
tests/unit/test_ai_rules.py:107
↓ 6 callersFunctionget_direct_taint_names
(node: &AstNode)
src/pyspector/_rust_core/src/analysis/taint_analysis.rs:1344
↓ 6 callersMethodget_fingerprint
Creates a unique, stable fingerprint for an issue.
src/pyspector/_rust_core/src/issues.rs:69
↓ 6 callersFunctionget_full_call_name
(call_node: &AstNode)
src/pyspector/_rust_core/src/analysis/taint_analysis.rs:1683
↓ 6 callersMethodis_attacker_controlled
True if this origin is attacker-controlled and should trigger sink findings. HtmlSanitized and SqlSanitized are NOT attacker-controlled for general s
src/pyspector/_rust_core/src/analysis/taint_analysis.rs:62
↓ 6 callersFunctionload_config
Loads configuration from a TOML file or returns defaults.
src/pyspector/config.py:42
↓ 5 callersMethod_build
(self, source: str, old: dict | None = None)
tests/unit/ast_cache_test.py:71
↓ 5 callersFunction_build_ast_json_and_chunks
Serialise *tree* to AST JSON, reusing encoded subtrees from *old_chunks* for any chunk whose content hash AND start_line are both unchanged.
src/pyspector/ast_cache.py:129
↓ 5 callersFunction_reset_cache_singleton
Reset the process-level singleton. Use only in tests.
src/pyspector/ast_cache.py:470
↓ 5 callersMethodstop
Stop timing and resource monitoring.
src/pyspector/stats.py:90
↓ 4 callersMethod_dispatch
(self, event)
src/pyspector/cli.py:1099
↓ 4 callersFunction_execute_scan
Core scan orchestrator. When *show_stats* is True a StatsCollector is attached to the run. It samples resource usage in a background thr
src/pyspector/cli.py:666
↓ 4 callersMethod_l1_key
Return the L1 dict key for a path (always the resolved form).
tests/unit/ast_cache_test.py:225
↓ 4 callersFunctionbuild_cfg
Main function to build a CFG from a function's AST node
src/pyspector/_rust_core/src/graph/cfg_builder.rs:6
↓ 4 callersMethodgenerate
(self)
src/pyspector/reporting.py:74
↓ 4 callersFunctionget_name_from_node
(node: &AstNode)
src/pyspector/_rust_core/src/analysis/taint_analysis.rs:1675
↓ 4 callersFunctionget_python_file_asts
Recursively finds Python files and returns their content and AST. Args: path: File or directory to scan. enable_syntax_warni
src/pyspector/cli.py:181
↓ 4 callersFunctionis_attacker_tainted
Returns only the DIRECT variable name(s) of an AST node for taint checking. Unlike `extract_all_names`, this does NOT recurse into attribute receivers
src/pyspector/_rust_core/src/analysis/taint_analysis.rs:1313
↓ 4 callersMethodis_excluded
Full exclusion check: path patterns + optional file content regex. Pass file content when available for the most accurate result. Glob patterns are m
src/pyspector/_rust_core/src/rules.rs:83
↓ 4 callersFunctionrun_pyspector
Write code to a temp file, run pyspector, return findings as list of dicts.
tests/unit/test_false_positive_reductions.py:23
↓ 4 callersMethodstart
Begin timing and background resource monitoring.
src/pyspector/stats.py:85
↓ 4 callersMethodto_html
(self)
src/pyspector/reporting.py:250
↓ 3 callersFunction_deserialize_entry
Deserialize a FileCacheEntry from JSON. Raises on malformed data.
src/pyspector/ast_cache.py:207
↓ 3 callersMethod_l1_put
(self, key: str, entry: FileCacheEntry)
src/pyspector/ast_cache.py:332
↓ 3 callersFunction_make_chunk_id
Produce a stable chunk ID for a top-level AST statement.
src/pyspector/ast_cache.py:70
↓ 3 callersFunction_serialize_entry
Serialize a FileCacheEntry to a JSON string. No code-execution paths.
src/pyspector/ast_cache.py:186
↓ 3 callersFunction_severity_key
Normalize enum-like severity values.
src/pyspector/reporting.py:42
↓ 3 callersFunction_silence_fd1
Redirect file descriptor 1 (stdout) to /dev/null when *active* is True. Used to swallow ``println!`` output emitted by the Rust core during a sca
src/pyspector/cli.py:93
↓ 3 callersFunctionanalyze_function_taint
Return type: (summary, call_site_taints, class_attr_taints, issues) - call_site_taints: Map<callee_name, Vec<taint_per_param>> — collected at each cal
src/pyspector/_rust_core/src/analysis/taint_analysis.rs:390
↓ 3 callersFunctioncreate_fingerprint
(issue: Dict[str, Any])
src/pyspector/triage.py:12
↓ 3 callersFunctionencode_node
Serialize a single AST node to JSON.
src/pyspector/_ast_encode.py:53
↓ 3 callersFunctionextract_cli_tainted_params
(func_node: &AstNode)
src/pyspector/_rust_core/src/analysis/taint_analysis.rs:1750
↓ 3 callersMethodget_changed_chunks
Return the IDs of top-level chunks that differ between two versions of a file, without updating the cache. Useful for incremental
src/pyspector/ast_cache.py:295
↓ 3 callersFunctionget_name_from_node
(node: &AstNode)
src/pyspector/_rust_core/src/graph/call_graph_builder.rs:162
↓ 2 callersFunction_fmt_watch_issue
Format one issue as a compact single-line string for watch-mode diffs.
src/pyspector/cli.py:354
↓ 2 callersMethod_make_entry
(self)
tests/unit/ast_cache_test.py:170
↓ 2 callersFunction_matches_ai206
(code: str)
tests/unit/test_ai_rules.py:71
↓ 2 callersFunction_print_banner
Print the name banner, version, credits and the startup joke. Shown at the start of every scan. The verbose ``[*]`` progress lines that follo
src/pyspector/cli.py:124
↓ 2 callersFunction_scan_to_issues
Run a scan and return the filtered issue list. Used by watch mode.
src/pyspector/cli.py:300
↓ 2 callersFunction_source_slice
(lines: List[str], node: ast.stmt)
src/pyspector/ast_cache.py:80
↓ 2 callersFunction_wrap
(code)
tests/unit/test_semantic_provenance.py:31
↓ 2 callersFunctioncheck_fstring_taint
Check if an f-string (JoinedStr) contains a directly tainted variable and report FSTRING867. Uses get_direct_taint_names (not extract_all_names) so o
src/pyspector/_rust_core/src/analysis/taint_analysis.rs:1552
↓ 2 callersFunctioncompute_entry_state
( block: &BasicBlock, exit_states: &HashMap<BlockId, TaintState>, )
src/pyspector/_rust_core/src/analysis/taint_analysis.rs:688
↓ 2 callersFunctionextract_fixed_version
(vuln: &OsvVulnerability)
src/pyspector/_rust_core/src/supply_chain.rs:633
↓ 2 callersMethodfinalize
Precompiles every glob exclusion/file pattern into a `WildMatch` once. Must be called exactly once, right after the ruleset is parsed from TOML and b
src/pyspector/_rust_core/src/rules.rs:192
↓ 2 callersFunctionis_excluded
(path: &Path, exclusions: &[ExclusionPattern])
src/pyspector/_rust_core/src/analysis/mod.rs:180
↓ 2 callersMethodis_shell_injectable
True only for HttpRequest/External — not ShellSanitized. Used by shell injection sinks (PY102, SHELL*): shlex.quote is a valid mitigation.
src/pyspector/_rust_core/src/analysis/taint_analysis.rs:72
↓ 2 callersFunctionis_tainted_for_sink
Check taint considering the sink's triggers_on policy. "all" (default) — fires for all attacker-controlled origins. "shell_injectable" — f
src/pyspector/_rust_core/src/analysis/taint_analysis.rs:1330
↓ 2 callersFunctionmerge_states
(target: &mut TaintState, source: &TaintState)
src/pyspector/_rust_core/src/analysis/taint_analysis.rs:703
↓ 2 callersFunctionraw_query_osv
(client: &reqwest::blocking::Client, name: &str, version: &str, ecosystem: &str)
src/pyspector/_rust_core/src/supply_chain.rs:458
↓ 2 callersFunctionreport_issue
(ruleset: &RuleSet, vuln_id: &str, file_path: &str, stmt: &AstNode, content: &str, issues: &mut Vec<Issue>)
src/pyspector/_rust_core/src/analysis/taint_analysis.rs:1902
↓ 2 callersFunctionresolve_severity
(vuln: &OsvVulnerability)
src/pyspector/_rust_core/src/supply_chain.rs:490
↓ 2 callersFunctionseverity_rank
Numeric ordering of severities so we can pick the "worse" of two findings that fire at the same code location. Critical > High > Medium > Low.
src/pyspector/_rust_core/src/analysis/mod.rs:13
↓ 2 callersMethodto_sarif
(self)
src/pyspector/reporting.py:149
↓ 2 callersFunctiontransfer_function
( block: &BasicBlock, mut state: TaintState, ruleset: &RuleSet, file_path: &str, content:
src/pyspector/_rust_core/src/analysis/taint_analysis.rs:711
↓ 2 callersMethodupdate_table
(self)
src/pyspector/triage.py:96
↓ 1 callersFunction_ast_node
(node: ast.AST)
tests/unit/test_ai_rules.py:38
↓ 1 callersFunction_banner
Full-width centred title row (single column).
src/pyspector/stats.py:29
↓ 1 callersFunction_bot
()
src/pyspector/stats.py:26
↓ 1 callersMethod_build
( self, file_path: Path, content: str, file_hash: str, mtime: float,
src/pyspector/ast_cache.py:377
↓ 1 callersFunction_clean
(obj)
src/pyspector/reporting.py:47
↓ 1 callersMethod_disk_load
(self, file_path: Path, file_hash: str)
src/pyspector/ast_cache.py:406
↓ 1 callersMethod_disk_save
(self, entry: FileCacheEntry)
src/pyspector/ast_cache.py:421
↓ 1 callersMethod_get_entry
(self, file_path: Path, content: str)
src/pyspector/ast_cache.py:338
↓ 1 callersMethod_get_severity_color
(self, severity: str)
src/pyspector/triage.py:209
↓ 1 callersFunction_get_version
()
src/pyspector/cli.py:117
↓ 1 callersFunction_get_version
Return installed PySpector version dynamically.
src/pyspector/reporting.py:31
↓ 1 callersFunction_has_property
(node: dict, path: list[str], expected: str)
tests/unit/test_ai_rules.py:54
↓ 1 callersFunction_is_path_excluded
Return True if *file_path* matches any of the *patterns* (fnmatch-style). Patterns are matched against the path relative to *root*, against the
src/pyspector/cli.py:157
next →1–100 of 455, ranked by callers