Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/anthropics/claude-code-security-review
/ functions
Functions
226 in github.com/anthropics/claude-code-security-review
⨍
Functions
226
◇
Types & classes
41
↳
Endpoints
50
↓ 35 callers
Method
log
Log a message if verbose mode is enabled.
claudecode/evals/eval_engine.py:96
↓ 29 callers
Method
get_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 callers
Function
parse_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 callers
Function
main
Main execution function for GitHub Action.
claudecode/github_action_audit.py:521
↓ 16 callers
Function
create_simple_filter
Create a filter that only uses hard exclusions.
claudecode/test_findings_conversion.py:13
↓ 16 callers
Function
extract_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 callers
Function
filter_findings_simple
Helper to get simple kept/excluded tuple from FindingsFilter.
claudecode/test_findings_conversion.py:18
↓ 13 callers
Method
run_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 callers
Function
get_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 callers
Method
validate_claude_available
Validate that Claude Code is available.
claudecode/github_action_audit.py:315
↓ 6 callers
Method
get_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 callers
Function
ghApi
(endpoint, method = 'GET', data = null)
scripts/comment-pr-findings.js:25
↓ 5 callers
Method
_extract_security_findings
Extract security findings from Claude's JSON response.
claudecode/github_action_audit.py:289
↓ 5 callers
Function
get_environment_config
Get and validate environment configuration. Returns: Tuple of (repo_name, pr_number) Raises: ConfigurationError:
claudecode/github_action_audit.py:349
↓ 4 callers
Method
_filter_generated_files
Filter out generated files and excluded directories from diff content.
claudecode/github_action_audit.py:159
↓ 4 callers
Function
apply_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 callers
Function
initialize_clients
Initialize GitHub and Claude clients. Returns: Tuple of (github_client, claude_runner) Raises: ConfigurationErro
claudecode/github_action_audit.py:375
↓ 4 callers
Function
initialize_findings_filter
Initialize findings filter based on environment configuration. Args: custom_filtering_instructions: Optional custom filtering instruc
claudecode/github_action_audit.py:397
↓ 3 callers
Method
_is_excluded
Check if a file should be excluded based on directory patterns.
claudecode/github_action_audit.py:138
↓ 3 callers
Method
_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 callers
Method
_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 callers
Method
filter_findings
Filter security findings to remove false positives. Args: findings: List of security findings from Claude Code audit
claudecode/findings_filter.py:197
↓ 3 callers
Function
get_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 callers
Method
get_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 callers
Method
run_evaluation
Run security evaluation on a single PR. Args: test_case: Test case to evaluate Returns:
claudecode/evals/eval_engine.py:317
↓ 2 callers
Method
_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 callers
Method
_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 callers
Method
_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 callers
Function
addReactionsToComment
(commentId, isReviewComment = true)
scripts/comment-pr-findings.js:57
↓ 2 callers
Function
run_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 callers
Function
run_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 callers
Method
to_dict
Convert to dictionary for JSON serialization.
claudecode/evals/run_eval.py:41
↓ 1 callers
Method
_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 callers
Method
_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 callers
Method
_generate_system_prompt
Generate system prompt for security analysis.
claudecode/claude_api_client.py:187
↓ 1 callers
Function
_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 callers
Method
_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 callers
Function
addReactionsToReview
(reviewId)
scripts/comment-pr-findings.js:74
↓ 1 callers
Method
analyze_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 callers
Method
call_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 callers
Function
main
Main entry point for single PR SAST evaluation.
claudecode/evals/run_eval.py:46
↓ 1 callers
Function
run
()
scripts/comment-pr-findings.js:91
↓ 1 callers
Function
setupTestEnvironment
()
scripts/comment-pr-findings.bun.test.js:64
↓ 1 callers
Method
validate_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
Function
get_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
Function
mockSpawnSyncResponse
(endpoint, method = 'GET', captureData = null)
scripts/comment-pr-findings.bun.test.js:18
Method
mock_env
Set up mock environment variables.
claudecode/test_integration.py:13
Method
test_actual_secrets_not_excluded
Test that actual exposed secrets are not excluded.
claudecode/test_hard_exclusion_rules.py:123
Method
test_anthropic_api_key_handling
Test handling of Anthropic API key.
claudecode/test_integration.py:62
Method
test_apply_findings_filter_failure
Test handling of filter failure.
claudecode/test_helper_functions.py:234
Method
test_apply_findings_filter_with_findings_filter
Test applying FindingsFilter to findings.
claudecode/test_helper_functions.py:174
Method
test_apply_findings_filter_with_simple_filter
Test applying FindingsFilter to findings.
claudecode/test_helper_functions.py:204
Method
test_audit_failure
Test when security audit fails.
claudecode/test_main_function.py:523
Method
test_case_sensitivity_in_exclusions
Test case sensitivity in exclusion rules.
claudecode/test_findings_conversion.py:139
Method
test_claude_output_formats
Test various Claude output formats.
claudecode/test_claude_runner.py:373
Method
test_clean_worktrees
Test worktree cleanup.
claudecode/test_eval_engine.py:141
Method
test_combined_patterns
Test findings that match multiple patterns.
claudecode/test_hard_exclusion_rules.py:288
Method
test_component_imports
Test that all component modules can be imported.
claudecode/test_github_action_audit.py:18
Method
test_create_findings_from_text
Test that _create_findings_from_text was removed.
claudecode/test_claude_runner.py:354
Method
test_create_findings_from_text_no_issues
Test that _create_findings_from_text was removed.
claudecode/test_claude_runner.py:361
Method
test_deployment_pr_patterns
Test that deployment PR titles are correctly identified.
claudecode/test_github_action_audit.py:216
Method
test_dos_pattern_exclusion
Test exclusion of DOS-related findings.
claudecode/test_hard_exclusion_rules.py:9
Method
test_dos_pattern_not_excluded_with_exploit
Test that stack overflow with exploit mention is not excluded.
claudecode/test_hard_exclusion_rules.py:35
Method
test_dos_patterns
Test DOS pattern exclusions.
claudecode/test_github_action_audit.py:32
Method
test_duplicate_findings
Test handling of duplicate findings.
claudecode/test_findings_conversion.py:391
Method
test_empty_finding_handling
Test handling of empty or malformed findings.
claudecode/test_hard_exclusion_rules.py:274
Method
test_empty_findings_list
Test filtering empty findings list.
claudecode/test_findings_conversion.py:36
Method
test_engine_initialization
Test engine initialization with API key.
claudecode/test_eval_engine.py:114
Method
test_engine_initialization_no_api_key
Test engine initialization without API key.
claudecode/test_eval_engine.py:122
Method
test_eval_case_creation
Test creating an EvalCase instance.
claudecode/test_eval_engine.py:98
Method
test_eval_result_creation
Test creating an EvalResult instance.
claudecode/test_eval_engine.py:16
Method
test_eval_result_to_dict
Test converting EvalResult to dictionary.
claudecode/test_eval_engine.py:77
Method
test_eval_result_with_error
Test creating an EvalResult with error.
claudecode/test_eval_engine.py:38
Method
test_eval_result_with_findings
Test creating an EvalResult with findings.
claudecode/test_eval_engine.py:55
Method
test_exception_handling
Test general exception handling.
claudecode/test_claude_runner.py:426
Method
test_extract_json_array_from_text
Test extracting JSON array from text (currently not supported).
claudecode/test_json_parser.py:102
Method
test_extract_json_from_nested_code_blocks
Test extracting JSON from nested code blocks.
claudecode/test_json_parser.py:224
Method
test_extract_json_from_text
Test extracting JSON from mixed text.
claudecode/test_github_action_audit.py:153
Method
test_extract_json_from_text_edge_cases
Test JSON extraction from various text formats.
claudecode/test_findings_conversion.py:243
Method
test_extract_json_from_text_no_json
Test extracting JSON from text with no JSON returns None.
claudecode/test_json_parser.py:145
Method
test_extract_json_from_text_no_json
Test extracting JSON when none exists.
claudecode/test_github_action_audit.py:162
Method
test_extract_json_from_text_with_backticks
Test extracting JSON from markdown code blocks.
claudecode/test_json_parser.py:76
Method
test_extract_json_from_text_without_backticks
Test extracting JSON from plain text.
claudecode/test_json_parser.py:91
Method
test_extract_json_with_multiple_blocks
Test extracting JSON when multiple JSON blocks exist.
claudecode/test_json_parser.py:115
Method
test_extract_json_with_syntax_errors_in_text
Test extracting JSON when there are syntax errors in surrounding text.
claudecode/test_json_parser.py:170
Method
test_extract_json_with_unicode
Test JSON extraction with unicode.
claudecode/test_findings_conversion.py:272
Method
test_extract_security_findings_claude_wrapper
Test extraction from Claude Code wrapper format.
claudecode/test_claude_runner.py:291
Method
test_extract_security_findings_direct_format
Test that direct findings format was removed - only wrapped format is supported.
claudecode/test_claude_runner.py:308
Method
test_extract_security_findings_empty
Test extraction with no findings.
claudecode/test_claude_runner.py:344
Method
test_extract_security_findings_text_fallback
Test that text fallback was removed - only JSON is supported.
claudecode/test_claude_runner.py:330
Method
test_filter_generated_files_edge_cases
Test edge cases in generated file filtering.
claudecode/test_github_client.py:243
Method
test_finding_with_extra_fields
Test findings with extra/unexpected fields.
claudecode/test_findings_conversion.py:68
Method
test_full_filter_with_llm_disabled
Test FindingsFilter with LLM filtering disabled.
claudecode/test_integration.py:86
Method
test_full_workflow_with_real_pr_structure
Test complete workflow with realistic PR data.
claudecode/test_workflow_integration.py:21
Method
test_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