MCPcopy Create free account

hub / github.com/NVIDIA/SkillSpector / functions

Functions2,044 in github.com/NVIDIA/SkillSpector

↓ 95 callersMethodanalyze
Analyze graph state and return findings.
src/skillspector/models.py:120
↓ 67 callersFunction_finding
( rule_id: str, severity: str = "LOW", message: str = "test", confidence: float = 1.0, fil
tests/nodes/test_report.py:37
↓ 48 callersFunction_run
(code: str, filename: str = "script.py")
tests/nodes/analyzers/test_behavioral_ast.py:23
↓ 48 callersFunction_run
(code: str, filename: str = "script.py")
tests/nodes/analyzers/test_behavioral_taint_tracking.py:23
↓ 46 callersFunctionget_line_number
Return the 1-based line number for a character offset in *content*.
src/skillspector/nodes/analyzers/common.py:66
↓ 41 callersFunctionget_logger
Return a logger under the skillspector package namespace.
src/skillspector/logging_config.py:56
↓ 38 callersFunctiondeepseek_compat
Context manager that applies DeepSeek compatibility patches and restores original state on exit — even if an exception occurs. Usage::
contrib/multilingual/runner.py:554
↓ 37 callersFunction_finding
( rule_id: str = "TM1", file: str = "tool.py", matched_text: str = "subprocess.run(cmd, shell=True
tests/nodes/test_deduplicate.py:24
↓ 35 callersMethodresolve
Resolve input to a scannable directory. Args: input_path: Path or URL to resolve Returns: Tuple of
src/skillspector/input_handler.py:94
↓ 32 callersMethodinvoke
(self, prompt: str)
tests/unit/test_llm_utils.py:138
↓ 32 callersFunctionmutate
Inject *broken_fn* into *module.target*, run *test_specs*, restore.
contrib/multilingual/tests/tests-pro/mutation_max.py:33
↓ 31 callersMethodrelease
Release a slot on *key* back to the pool. Parameters ---------- key : The key previously obtained from :meth:`acq
contrib/multilingual/api_pool.py:260
↓ 30 callersFunctionnode
Discover quality/policy findings via LLM analysis.
src/skillspector/nodes/analyzers/semantic_quality_policy.py:130
↓ 29 callersFunction_finding
( rule_id: str = "SQP-1", file: str = "skill-a/SKILL.md", message: str = "Overly broad trigger phr
tests/unit/test_suppression.py:38
↓ 29 callersFunctionreport
Generate SARIF, compute risk score, and set report_body from output_format. A baseline (state["baseline"]) suppresses matching findings: they nev
src/skillspector/nodes/report.py:679
↓ 27 callersFunction_batch
(file_path: str = "test.md")
contrib/multilingual/tests/tests-pro/test_gap_fill.py:65
↓ 27 callersFunction_compute_risk_score
Compute risk score (0-100), severity band, and recommendation. Scoring uses per-rule diminishing returns: the first occurrence of a rule_id
src/skillspector/nodes/report.py:125
↓ 27 callersMethodparse_response
Parse raw LLM text into :class:`Finding` objects via manual JSON. Because ``response_schema`` is ``None``, *response* is a raw string
contrib/multilingual/gap_fill.py:206
↓ 27 callersMethodresolve_model
(self, slot: str = "default")
src/skillspector/providers/base.py:58
↓ 26 callersFunction_finding
( rule_id: str = "TM1", confidence: float = 0.8, severity: str = "HIGH", context: str | None =
tests/nodes/test_meta_analyzer_fallback.py:30
↓ 26 callersFunctionnode
Detect semantic intent and attack-phrasing risks using LLM analysis.
src/skillspector/nodes/analyzers/semantic_security_discovery.py:71
↓ 25 callersMethodapply_filter
Keep only LLM-confirmed findings, enriched with explanation / remediation. Uses granular ``(file, rule_id, start_line, end_line)`` keying whe
src/skillspector/nodes/meta_analyzer.py:364
↓ 24 callersMethodacquire
Acquire a slot on the least-loaded available key. Scheduling priority: 1. **Recovered keys** — rate-limited keys whose backoff has e
contrib/multilingual/api_pool.py:165
↓ 24 callersFunctionllm_call_record
Build one telemetry record for ``SkillspectorState['llm_call_log']``. LLM-backed nodes append a record on each run so the report can tell whether
src/skillspector/state.py:102
↓ 22 callersFunction_make_finding
(rule_id: str = "PE3", message: str = "Credential Access", **kwargs)
tests/nodes/test_sarif_rules_and_empty_findings.py:24
↓ 22 callersFunctionnode
Analyze skill for rug-pull risks (RP1–RP3).
src/skillspector/nodes/analyzers/mcp_rug_pull.py:363
↓ 21 callersMethodresolve_credentials
(self)
src/skillspector/providers/base.py:69
↓ 21 callersFunctionrun_agent_cli
Run an agent CLI and return the assistant response text. This is the single security-hardened entry point. All security invariants are enfor
src/skillspector/providers/_agent_cli.py:700
↓ 20 callersFunction_fallback_filtered
Heuristic fallback filter for --no-llm mode. Applies rule-based filtering when LLM analysis is unavailable: 1. Drop findings with confidence
src/skillspector/nodes/meta_analyzer.py:226
↓ 20 callersFunction_valid_finding
Return a fresh dict for a valid gap-fill finding. Each call returns a new copy — no shared mutable state across tests.
contrib/multilingual/tests/tests-pro/test_gap_fill.py:50
↓ 20 callersMethodcleanup
Clean up temporary files created during resolution.
src/skillspector/input_handler.py:128
↓ 20 callersFunctionget_context
Extract surrounding lines from *content* around the match at *match_start* (char offset).
src/skillspector/nodes/analyzers/common.py:71
↓ 20 callersFunctionnode
Discover developer-intent findings via LLM analysis.
src/skillspector/nodes/analyzers/semantic_developer_intent.py:157
↓ 19 callersFunction_make_ok_process
( stdout: bytes, returncode: int = 0, wait_exc: BaseException | None = None )
tests/unit/test_agent_cli.py:111
↓ 19 callersFunction_make_pool
(n: int = 3, max_concurrent: int = 2)
contrib/multilingual/tests/tests-pro/test_api_pool.py:49
↓ 19 callersFunction_verify_patch_targets
Verify that all patch targets have expected signatures / attributes. Raises :class:`RuntimeError` with a specific message if an upstream chan
contrib/multilingual/runner.py:303
↓ 19 callersMethodcreate_chat_model
( self, model: str, *, max_tokens: int, timeout: float | None = 120,
src/skillspector/providers/base.py:75
↓ 18 callersFunctiondeduplicate
Deduplicate a list of findings, returning a reduced list. Two-pass deduplication: 1. Same-file: identical (rule_id, file, matched_text) → kee
src/skillspector/nodes/deduplicate.py:48
↓ 17 callersFunction_write_rule
Write a minimal YARA rule file and return its path.
tests/nodes/analyzers/test_static_yara.py:42
↓ 16 callersMethodarun_batches
Execute LLM calls for all *batches* concurrently. Uses ``asyncio.gather`` with a semaphore to run up to *max_concurrency* LLM request
src/skillspector/llm_analyzer_base.py:397
↓ 16 callersFunctionget_metadata_provider
Return the active provider for token-budget + default-model lookups.
src/skillspector/providers/__init__.py:131
↓ 15 callersFunction_analyze_deps
Run ``_analyze_dependencies`` with a mocked OSV ``query_batch``. Patches both ``query_batch`` and ``was_osv_reachable`` to return ``True`` so
tests/unit/test_patterns_new.py:69
↓ 15 callersFunction_build_file_cache
Read a fixture skill directory into a file_cache dict (relative path -> content).
tests/nodes/test_semantic_quality_policy.py:312
↓ 15 callersMethod_make_finding
( self, file: str, rule_id: str, line: int = 1, end_line: int | None =
tests/nodes/test_llm_analyzer_base.py:1074
↓ 15 callersFunctionresolve_provider_credentials
Return ``(api_key, base_url)`` from the active provider. Returns ``None`` when the provider's credential env var is unset, so callers can fal
src/skillspector/providers/__init__.py:145
↓ 14 callersFunction_run
(content: str, filename: str, rules_dir: str)
tests/nodes/analyzers/test_static_yara.py:65
↓ 14 callersFunctionbuild_context
Build flat ScanContext fields from state skill_path (local directory). Resolves skill_path to a directory, walks files, builds file_cache and
src/skillspector/nodes/build_context.py:229
↓ 14 callersFunctiondetect_skills
Detect whether a directory contains multiple independent skills. A directory is considered multi-skill when: - It has NO root-level SKILL.md
src/skillspector/multi_skill.py:51
↓ 13 callersFunction_build_sarif
Build SARIF 2.1.0 log from findings. Filters out empty/malformed findings (missing rule_id or message) and builds the required tool.driver.ru
src/skillspector/nodes/report.py:199
↓ 13 callersFunction_is_binary_file
Detect binary files by extension or null-byte presence in the first 512 chars.
src/skillspector/nodes/analyzers/static_runner.py:117
↓ 13 callersMethodmatches
True when every field this rule specifies glob-matches *finding*.
src/skillspector/suppression.py:115
↓ 12 callersFunction_build_claude_argv
Build the argv list for a capability-stripped ``claude -p`` call. ``-p`` / ``--print`` Non-interactive single-shot mode. The prompt is re
src/skillspector/providers/_agent_cli.py:174
↓ 12 callersFunction_estimate_cvss_severity
Estimate severity from a CVSS v3 or v4 vector string. Counts how many base metrics are at their most-severe value. This avoids adding a CVSS
src/skillspector/nodes/analyzers/osv_client.py:138
↓ 12 callersFunction_is_env_file_reference_in_docs
Return True if a PE3 finding is a documentation reference to .env files, not actual access. SKILL.md is exempt: it is the agent's primary instruc
src/skillspector/nodes/analyzers/static_runner.py:131
↓ 12 callersFunction_make_finding
NB: annotate_findings reads the rule ID from the 'id' key, not 'rule_id'.
contrib/multilingual/tests/tests-pro/test_annotation.py:36
↓ 12 callersFunction_make_state
Build a minimal SkillspectorState from a fixture directory or a raw manifest. Mirrors what build_context.build_context() produces. When *man
tests/test_mcp_tool_poisoning.py:86
↓ 12 callersMethodget_batches
Create one :class:`Batch` per file, splitting oversized files into chunks.
src/skillspector/llm_analyzer_base.py:290
↓ 12 callersFunctionhas_cli_capability
Return ``True`` when *provider* implements the :class:`AgentCLICapable` interface. Uses duck-typing rather than ``isinstance`` so that providers
src/skillspector/providers/base.py:117
↓ 11 callersFunction_get_real_functions
Import the real (unpatched) module-level functions.
tests/unit/test_model_info.py:75
↓ 11 callersFunction_print
Print through Rich when available, falling back to plain text.
contrib/multilingual/batch_scan.py:206
↓ 11 callersFunction_reload_constants
Re-import constants to re-run module-level config resolution.
tests/unit/test_constants.py:55
↓ 11 callersFunctionentry_from_result
Convert a raw ``graph.invoke()`` result into a batch-report entry. Extracts findings, manifest metadata, component metadata, and builds the c
contrib/multilingual/runner.py:616
↓ 11 callersFunctionestimate_tokens
Approximate token count from character length.
src/skillspector/llm_analyzer_base.py:117
↓ 11 callersFunctionfinding_fingerprint
Return a stable short fingerprint for *finding*. Derived from rule id, file, line span, and message so the same finding hashes identically ac
src/skillspector/suppression.py:85
↓ 11 callersFunctionget_chat_model
Return a chat model for the active provider. For CLI providers (``claude_cli``, ``codex_cli``, ``gemini_cli``) this returns an :class:`AgentC
src/skillspector/llm_utils.py:236
↓ 11 callersMethodwalk
(node: object)
tests/nodes/test_llm_analyzer_base.py:875
↓ 10 callersFunction_check_signature
Raise :class:`RuntimeError` if *func* doesn't accept *expected_params*.
contrib/multilingual/runner.py:443
↓ 10 callersFunction_emit
( rule_id: str, lineno: int, end_lineno: int | None, msg_override: str | None
src/skillspector/nodes/analyzers/behavioral_ast.py:162
↓ 10 callersFunction_force_restore
Safety-net: restore all patches regardless of depth counter.
contrib/multilingual/tests/test_monkeypatch_fragility.py:74
↓ 10 callersFunctionnode
Run YARA rules against all skill artifacts and return findings.
src/skillspector/nodes/analyzers/static_yara.py:232
↓ 10 callersFunctionvalidate_base_url
Warn if *url* is not a well-formed http(s) URL. Raises nothing — misconfigured URLs will still fail at the HTTP layer, but an early warning h
src/skillspector/providers/chat_models.py:30
↓ 9 callersFunction_build_file_cache
(skill_dir: Path)
tests/nodes/analyzers/test_semantic_security_discovery.py:362
↓ 9 callersFunction_has_rule
Return True when a finding message references a specific YARA rule.
tests/nodes/analyzers/test_static_yara.py:83
↓ 9 callersFunction_is_private_ip
Return True if host resolves to a private/reserved IP address.
src/skillspector/input_handler.py:66
↓ 9 callersFunction_make_file_aware_ainvoke
Return an AsyncMock that returns different findings based on the file path in the prompt.
tests/nodes/test_semantic_quality_policy.py:374
↓ 9 callersFunction_make_finding
(**kwargs)
tests/nodes/test_analysis_completeness.py:29
↓ 9 callersMethod_make_finding
(self, file: str, line: int = 1, rule_id: str = "E1")
tests/nodes/test_llm_analyzer_base.py:918
↓ 9 callersFunction_make_pe3_finding
(context: str)
tests/nodes/analyzers/test_binary_and_pe3_filtering.py:30
↓ 9 callersFunction_make_state
Build a minimal SkillspectorState from a fixture directory. Parses SKILL.md YAML frontmatter, builds file_cache and component_metadata. Mirro
tests/test_mcp_least_privilege.py:84
↓ 9 callersFunction_run_builtin
Run only the built-in YARA rules against a single in-memory file.
tests/nodes/analyzers/test_static_yara.py:74
↓ 9 callersFunction_scan
(text: str, path: str = "SKILL.md")
tests/nodes/analyzers/test_static_patterns_anti_refusal.py:26
↓ 9 callersFunction_validate_model_label
Ensure *model* cannot be used as an argument injection vector. Model labels come from ``SKILLSPECTOR_MODEL`` (user-controlled) or the provide
src/skillspector/providers/_agent_cli.py:143
↓ 9 callersFunctionannotate_findings
Add a ``language_compatible`` field to each issue dict. Returns a new list — the input *issues* list is not mutated.
contrib/multilingual/annotation.py:86
↓ 9 callersFunctionquery_batch
Query OSV.dev for vulnerabilities across a batch of packages. Args: packages: List of (name, version_or_None) tuples. ecosystem:
src/skillspector/nodes/analyzers/osv_client.py:228
↓ 9 callersFunctionsetup_deepseek_compat
Apply DeepSeek compatibility patches permanently (convenience wrapper). Prefer :func:`deepseek_compat` context manager for scoped, reversible
contrib/multilingual/runner.py:293
↓ 9 callersMethodto_finding
Convert to a :class:`~skillspector.models.Finding` for the report.
contrib/multilingual/gap_fill.py:73
↓ 8 callersFunction_count_sev
(results: list[dict[str, object]], severity: str)
contrib/multilingual/reports.py:165
↓ 8 callersFunction_scrub_env
Return a copy of ``os.environ`` with secret variables removed. Any variable whose name starts with a prefix in ``_SECRET_ENV_PREFIXES`` is st
src/skillspector/providers/_agent_cli.py:113
↓ 8 callersFunction_state
( manifest: dict | None = None, file_cache: dict[str, str] | None = None )
tests/test_mcp_rug_pull.py:24
↓ 8 callersFunction_write_registry
(path: Path, models: dict)
tests/unit/test_model_info.py:71
↓ 8 callersFunctionmeta_analyzer
Filter and enrich findings via per-file LLM calls. When ``use_llm`` is *True* and an LLM API key is configured (see ``llm_utils._resolve_llm_
src/skillspector/nodes/meta_analyzer.py:497
↓ 7 callersFunction_assert_all_patched
Assert all 5 method references are patched (≠ originals).
contrib/multilingual/tests/test_monkeypatch_invasiveness.py:93
↓ 7 callersFunction_build_analysis_completeness
Build analysis_completeness section indicating scan coverage and limitations. Helps consumers understand what was NOT analyzed and whether findin
src/skillspector/nodes/report.py:492
↓ 7 callersFunction_build_codex_argv
Build the argv list for a capability-stripped ``codex exec`` call. Flags chosen (verified end-to-end against codex 0.139.0): ``exec``
src/skillspector/providers/_agent_cli.py:266
↓ 7 callersMethod_is_rate_limit
Detect rate-limit errors from common LLM provider SDKs.
contrib/multilingual/api_pool.py:530
↓ 7 callersFunction_make_file_aware_run_batches
Return a mock run_batches that dispatches based on file_path in each batch.
tests/nodes/analyzers/test_semantic_security_discovery.py:375
↓ 7 callersMethod_make_finding
( self, rule_id: str, severity: str, file: str = "skill.md", line: int
tests/nodes/test_llm_analyzer_base.py:1401
↓ 7 callersFunction_resolve_llm_credentials
Return ``(api_key, base_url)`` resolved from the environment. Tries the active SkillSpector provider first; falls back to ``OPENAI_API_KEY``
src/skillspector/llm_utils.py:56
↓ 7 callersFunction_severity_from_vuln
Extract the highest severity string from an OSV vulnerability object. Priority order: 1. database_specific.severity — GHSA sets this reliably
src/skillspector/nodes/analyzers/osv_client.py:163
↓ 7 callersFunction_strip_markdown_fences
Remove ```json ... ``` wrappers from LLM output.
contrib/multilingual/runner.py:582
next →1–100 of 2,044, ranked by callers