File size: 2,031 Bytes
3d833be
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
---

title: Code Impact Analyzer
emoji: πŸ”
colorFrom: blue
colorTo: indigo
sdk: streamlit
sdk_version: 1.32.0
app_file: app.py
pinned: false
---


# Code Impact Analyzer

A powerful tool that analyzes code changes in Git repositories using AI to provide detailed impact analysis.

## Features

- πŸ” **Git Repository Analysis**: Clone and analyze any public Git repository
- πŸ€– **AI-Powered Analysis**: Uses GPT-4 and Claude Sonnet for intelligent code analysis
- πŸ“Š **Impact Assessment**: Provides detailed analysis of code changes and their impact
- πŸ”’ **Secure API Key Management**: Supports both environment variables and session-based API keys
- πŸ“ **Structured Output**: Returns analysis in a standardized JSON format
- πŸ“¦ **Large Codebase Support**: Handles large repositories through intelligent chunking

## Usage

1. Enter a Git repository URL
2. Select your preferred AI model (GPT-4 or Claude Sonnet)
3. Enter your code/configuration changes
4. Click "Analyze" to get detailed impact analysis

## API Key Setup

### Option 1: Environment Variables
Set your API keys in the `.env` file:
```

OPENAI_API_KEY=your_openai_key_here

ANTHROPIC_API_KEY=your_anthropic_key_here

```

### Option 2: In-App Input
Enter your OpenAI API key directly in the application interface.

## Analysis Output

The tool provides analysis in the following format:
```json

{

    "severity_level": "LOW/MEDIUM/HIGH",

    "number_of_files_impacted": <integer>,

    "files_impacted": [

        {

            "files_impacted": "file_path",

            "impact_details": "detailed_impact_description"

        }

    ]

}

```

## Severity Levels

- **LOW**: 1-3 files impacted
- **MEDIUM**: 4-8 files impacted
- **HIGH**: More than 8 files impacted

## Technical Details

- Built with Streamlit
- Uses OpenAI's GPT-4 and Anthropic's Claude Sonnet
- Supports multiple programming languages
- Handles large codebases through token-based chunking

## License

MIT License