MCPcopy Create free account

hub / github.com/anthropics/claude-code-security-review / functions

Functions226 in github.com/anthropics/claude-code-security-review

↓ 35 callersMethodlog
Log a message if verbose mode is enabled.
claudecode/evals/eval_engine.py:96
↓ 29 callersMethodget_exclusion_reason
Check if a finding should be excluded based on hard rules. Args: finding: Security finding to check
claudecode/findings_filter.py:82
↓ 25 callersFunctionparse_json_with_fallbacks
Parse JSON from text with multiple fallback strategies and error handling. Args: text: The text to parse error_context:
claudecode/json_parser.py:61
↓ 23 callersFunctionmain
Main execution function for GitHub Action.
claudecode/github_action_audit.py:521
↓ 16 callersFunctioncreate_simple_filter
Create a filter that only uses hard exclusions.
claudecode/test_findings_conversion.py:13
↓ 16 callersFunctionextract_json_from_text
Extract JSON object from text, looking in various formats and locations. Args: text: The text that may contain JSON
claudecode/json_parser.py:12
↓ 16 callersFunctionfilter_findings_simple
Helper to get simple kept/excluded tuple from FindingsFilter.
claudecode/test_findings_conversion.py:18
↓ 13 callersMethodrun_security_audit
Run Claude Code security audit. Args: repo_dir: Path to repository directory prompt: Security audit prompt
claudecode/github_action_audit.py:203
↓ 11 callersFunctionget_security_audit_prompt
Generate security audit prompt for Claude Code. Args: pr_data: PR data dictionary from GitHub API pr_diff: Optional complete
claudecode/prompts.py:3
↓ 8 callersMethodvalidate_claude_available
Validate that Claude Code is available.
claudecode/github_action_audit.py:315
↓ 6 callersMethodget_pr_data
Get PR metadata and files from GitHub API. Args: repo_name: Repository name in format "owner/repo" pr_number:
claudecode/github_action_audit.py:61
↓ 6 callersFunctionghApi
(endpoint, method = 'GET', data = null)
scripts/comment-pr-findings.js:25
↓ 5 callersMethod_extract_security_findings
Extract security findings from Claude's JSON response.
claudecode/github_action_audit.py:289
↓ 5 callersFunctionget_environment_config
Get and validate environment configuration. Returns: Tuple of (repo_name, pr_number) Raises: ConfigurationError:
claudecode/github_action_audit.py:349
↓ 4 callersMethod_filter_generated_files
Filter out generated files and excluded directories from diff content.
claudecode/github_action_audit.py:159
↓ 4 callersFunctionapply_findings_filter
Apply findings filter to reduce false positives. Args: findings_filter: Filter instance original_findings: Original findings
claudecode/github_action_audit.py:457
↓ 4 callersFunctioninitialize_clients
Initialize GitHub and Claude clients. Returns: Tuple of (github_client, claude_runner) Raises: ConfigurationErro
claudecode/github_action_audit.py:375
↓ 4 callersFunctioninitialize_findings_filter
Initialize findings filter based on environment configuration. Args: custom_filtering_instructions: Optional custom filtering instruc
claudecode/github_action_audit.py:397
↓ 3 callersMethod_is_excluded
Check if a file should be excluded based on directory patterns.
claudecode/github_action_audit.py:138
↓ 3 callersMethod_run_sast_audit
Run the SAST audit script on a repository. Args: test_case: Test case being evaluated repo_path: Path to the
claudecode/evals/eval_engine.py:396
↓ 3 callersMethod_setup_repository
Set up repository worktree for PR evaluation. Args: test_case: Test case containing repo and PR info
claudecode/evals/eval_engine.py:212
↓ 3 callersMethodfilter_findings
Filter security findings to remove false positives. Args: findings: List of security findings from Claude Code audit
claudecode/findings_filter.py:197
↓ 3 callersFunctionget_logger
Get a configured logger that outputs to stderr. Args: name: The name of the logger (usually __name__) Returns: C
claudecode/logger.py:8
↓ 3 callersMethodget_pr_diff
Get complete PR diff in unified format. Args: repo_name: Repository name in format "owner/repo" pr_number: Pu
claudecode/github_action_audit.py:119
↓ 3 callersMethodrun_evaluation
Run security evaluation on a single PR. Args: test_case: Test case to evaluate Returns:
claudecode/evals/eval_engine.py:317
↓ 2 callersMethod_clean_worktrees
Clean up locked or stale worktrees and remove untracked branches. Args: repo_path: Path to the main repository
claudecode/evals/eval_engine.py:116
↓ 2 callersMethod_get_eval_branch_name
Generate a branch name for evaluation. Args: test_case: Test case being evaluated Returns:
claudecode/evals/eval_engine.py:198
↓ 2 callersMethod_get_repo_lock
Get or create a lock for a repository. Args: repo_name: Repository name Returns: Lock fo
claudecode/evals/eval_engine.py:102
↓ 2 callersFunctionaddReactionsToComment
(commentId, isReviewComment = true)
scripts/comment-pr-findings.js:57
↓ 2 callersFunctionrun_security_audit
Run the security audit with Claude Code. Args: claude_runner: Claude runner instance prompt: The security audit prompt
claudecode/github_action_audit.py:433
↓ 2 callersFunctionrun_single_evaluation
Convenience function to run a single evaluation. Args: test_case: Test case to evaluate verbose: Enable verbose logging
claudecode/evals/eval_engine.py:468
↓ 2 callersMethodto_dict
Convert to dictionary for JSON serialization.
claudecode/evals/run_eval.py:41
↓ 1 callersMethod_cleanup_worktree
Clean up a worktree after evaluation. Args: test_case: Test case that was evaluated worktree_path: Path to th
claudecode/evals/eval_engine.py:286
↓ 1 callersMethod_generate_single_finding_prompt
Generate prompt for analyzing a single security finding. Args: finding: Single security finding pr_context: O
claudecode/claude_api_client.py:196
↓ 1 callersMethod_generate_system_prompt
Generate system prompt for security analysis.
claudecode/claude_api_client.py:187
↓ 1 callersFunction_is_finding_in_excluded_directory
Check if a finding references a file in an excluded directory. Args: finding: Security finding dictionary github_client: GitH
claudecode/github_action_audit.py:504
↓ 1 callersMethod_read_file
Read a file and format it with line numbers. Args: file_path: Path to the file to read Returns:
claudecode/claude_api_client.py:313
↓ 1 callersFunctionaddReactionsToReview
(reviewId)
scripts/comment-pr-findings.js:74
↓ 1 callersMethodanalyze_single_finding
Analyze a single security finding to filter false positives using Claude API. Args: finding: Single security finding to a
claudecode/claude_api_client.py:145
↓ 1 callersMethodcall_with_retry
Make Claude API call with retry logic. Args: prompt: User prompt system_prompt: Optional system prompt
claudecode/claude_api_client.py:74
↓ 1 callersFunctionmain
Main entry point for single PR SAST evaluation.
claudecode/evals/run_eval.py:46
↓ 1 callersFunctionrun
()
scripts/comment-pr-findings.js:91
↓ 1 callersFunctionsetupTestEnvironment
()
scripts/comment-pr-findings.bun.test.js:64
↓ 1 callersMethodvalidate_api_access
Validate that API access is working. Returns: Tuple of (success, error_message)
claudecode/claude_api_client.py:53
Method__init__
Initialize findings filter. Args: use_hard_exclusions: Whether to apply hard exclusion rules use_claude_filte
claudecode/findings_filter.py:160
Method__init__
Initialize Claude API client. Args: model: Claude model to use api_key: Anthropic API key (if None, reads fro
claudecode/claude_api_client.py:24
Method__init__
Initialize GitHub client using environment variables.
claudecode/github_action_audit.py:43
Method__init__
Initialize Claude runner. Args: timeout_minutes: Timeout for Claude execution (defaults to SUBPROCESS_TIMEOUT)
claudecode/github_action_audit.py:192
Method__init__
Initialize evaluation engine. Args: work_dir: Directory for cloning repositories verbose: Enable verbose logg
claudecode/evals/eval_engine.py:59
Functionget_claude_api_client
Convenience function to get Claude API client. Args: model: Claude model identifier api_key: Optional API key (reads from env
claudecode/claude_api_client.py:357
FunctionmockSpawnSyncResponse
(endpoint, method = 'GET', captureData = null)
scripts/comment-pr-findings.bun.test.js:18
Methodmock_env
Set up mock environment variables.
claudecode/test_integration.py:13
Methodtest_actual_secrets_not_excluded
Test that actual exposed secrets are not excluded.
claudecode/test_hard_exclusion_rules.py:123
Methodtest_anthropic_api_key_handling
Test handling of Anthropic API key.
claudecode/test_integration.py:62
Methodtest_apply_findings_filter_failure
Test handling of filter failure.
claudecode/test_helper_functions.py:234
Methodtest_apply_findings_filter_with_findings_filter
Test applying FindingsFilter to findings.
claudecode/test_helper_functions.py:174
Methodtest_apply_findings_filter_with_simple_filter
Test applying FindingsFilter to findings.
claudecode/test_helper_functions.py:204
Methodtest_audit_failure
Test when security audit fails.
claudecode/test_main_function.py:523
Methodtest_case_sensitivity_in_exclusions
Test case sensitivity in exclusion rules.
claudecode/test_findings_conversion.py:139
Methodtest_claude_output_formats
Test various Claude output formats.
claudecode/test_claude_runner.py:373
Methodtest_clean_worktrees
Test worktree cleanup.
claudecode/test_eval_engine.py:141
Methodtest_combined_patterns
Test findings that match multiple patterns.
claudecode/test_hard_exclusion_rules.py:288
Methodtest_component_imports
Test that all component modules can be imported.
claudecode/test_github_action_audit.py:18
Methodtest_create_findings_from_text
Test that _create_findings_from_text was removed.
claudecode/test_claude_runner.py:354
Methodtest_create_findings_from_text_no_issues
Test that _create_findings_from_text was removed.
claudecode/test_claude_runner.py:361
Methodtest_deployment_pr_patterns
Test that deployment PR titles are correctly identified.
claudecode/test_github_action_audit.py:216
Methodtest_dos_pattern_exclusion
Test exclusion of DOS-related findings.
claudecode/test_hard_exclusion_rules.py:9
Methodtest_dos_pattern_not_excluded_with_exploit
Test that stack overflow with exploit mention is not excluded.
claudecode/test_hard_exclusion_rules.py:35
Methodtest_dos_patterns
Test DOS pattern exclusions.
claudecode/test_github_action_audit.py:32
Methodtest_duplicate_findings
Test handling of duplicate findings.
claudecode/test_findings_conversion.py:391
Methodtest_empty_finding_handling
Test handling of empty or malformed findings.
claudecode/test_hard_exclusion_rules.py:274
Methodtest_empty_findings_list
Test filtering empty findings list.
claudecode/test_findings_conversion.py:36
Methodtest_engine_initialization
Test engine initialization with API key.
claudecode/test_eval_engine.py:114
Methodtest_engine_initialization_no_api_key
Test engine initialization without API key.
claudecode/test_eval_engine.py:122
Methodtest_eval_case_creation
Test creating an EvalCase instance.
claudecode/test_eval_engine.py:98
Methodtest_eval_result_creation
Test creating an EvalResult instance.
claudecode/test_eval_engine.py:16
Methodtest_eval_result_to_dict
Test converting EvalResult to dictionary.
claudecode/test_eval_engine.py:77
Methodtest_eval_result_with_error
Test creating an EvalResult with error.
claudecode/test_eval_engine.py:38
Methodtest_eval_result_with_findings
Test creating an EvalResult with findings.
claudecode/test_eval_engine.py:55
Methodtest_exception_handling
Test general exception handling.
claudecode/test_claude_runner.py:426
Methodtest_extract_json_array_from_text
Test extracting JSON array from text (currently not supported).
claudecode/test_json_parser.py:102
Methodtest_extract_json_from_nested_code_blocks
Test extracting JSON from nested code blocks.
claudecode/test_json_parser.py:224
Methodtest_extract_json_from_text
Test extracting JSON from mixed text.
claudecode/test_github_action_audit.py:153
Methodtest_extract_json_from_text_edge_cases
Test JSON extraction from various text formats.
claudecode/test_findings_conversion.py:243
Methodtest_extract_json_from_text_no_json
Test extracting JSON from text with no JSON returns None.
claudecode/test_json_parser.py:145
Methodtest_extract_json_from_text_no_json
Test extracting JSON when none exists.
claudecode/test_github_action_audit.py:162
Methodtest_extract_json_from_text_with_backticks
Test extracting JSON from markdown code blocks.
claudecode/test_json_parser.py:76
Methodtest_extract_json_from_text_without_backticks
Test extracting JSON from plain text.
claudecode/test_json_parser.py:91
Methodtest_extract_json_with_multiple_blocks
Test extracting JSON when multiple JSON blocks exist.
claudecode/test_json_parser.py:115
Methodtest_extract_json_with_syntax_errors_in_text
Test extracting JSON when there are syntax errors in surrounding text.
claudecode/test_json_parser.py:170
Methodtest_extract_json_with_unicode
Test JSON extraction with unicode.
claudecode/test_findings_conversion.py:272
Methodtest_extract_security_findings_claude_wrapper
Test extraction from Claude Code wrapper format.
claudecode/test_claude_runner.py:291
Methodtest_extract_security_findings_direct_format
Test that direct findings format was removed - only wrapped format is supported.
claudecode/test_claude_runner.py:308
Methodtest_extract_security_findings_empty
Test extraction with no findings.
claudecode/test_claude_runner.py:344
Methodtest_extract_security_findings_text_fallback
Test that text fallback was removed - only JSON is supported.
claudecode/test_claude_runner.py:330
Methodtest_filter_generated_files_edge_cases
Test edge cases in generated file filtering.
claudecode/test_github_client.py:243
Methodtest_finding_with_extra_fields
Test findings with extra/unexpected fields.
claudecode/test_findings_conversion.py:68
Methodtest_full_filter_with_llm_disabled
Test FindingsFilter with LLM filtering disabled.
claudecode/test_integration.py:86
Methodtest_full_workflow_with_real_pr_structure
Test complete workflow with realistic PR data.
claudecode/test_workflow_integration.py:21
Methodtest_generic_validation_pattern_exclusion
Test that generic validation findings are NOT excluded anymore.
claudecode/test_hard_exclusion_rules.py:46
next →1–100 of 226, ranked by callers