Skip to content

Commit 57e9644

Browse files
author
Lukas Geiger
committed
docs: improve discoverability and localize readme
1 parent 53ca618 commit 57e9644

4 files changed

Lines changed: 315 additions & 129 deletions

File tree

CHANGELOG.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,9 @@ Format basiert auf [Keep a Changelog](https://keepachangelog.com/de/1.1.0/).
1616
- **B-003** (`MethodenAnalyser3.py`): `scan_dynamic_usage()` gab Strings wie `"getattr("`, `"setattr("` als extrahierte Methodennamen zurück, weil Regex-Muster ohne Capture-Group den vollen Match liefern. Fix: Strings mit `(` werden ausgefiltert. Regressionstest ergänzt.
1717

1818
### Repository-Hygiene
19-
- `llms.txt` ergänzt mit kanonischen Links, Tool-Scope, lokalen Interfaces und Datenschutzgrenzen für Crawler, LLMs und Verzeichnisdienste.
19+
- `README.md` überarbeitet und auf ein strukturiertes, englischsprachiges Layout (English-first) mit Tabellen, Badges und Verweisen umgestellt.
20+
- Neue deutsche Übersetzung `README_de.md` für vollständige Lokalisierung erstellt.
21+
- `llms.txt` aktualisiert und mit `README_de.md` ergänzt.
2022
- Community-Workflows aktualisiert: `actions/stale@v10` und `actions/first-interaction@v3` mit aktuellen Input-Namen.
2123

2224
### Portierung / Platforms

README.md

Lines changed: 100 additions & 128 deletions
Original file line numberDiff line numberDiff line change
@@ -8,229 +8,201 @@
88

99
<h1 align="center">MethodenAnalyser</h1>
1010

11-
<h4 align="center">Statischer Python-Code-Analyser mit GUI: findet ungenutzte Imports, tote Definitionen und ähnliche Code-Blöcke.</h4>
11+
<h4 align="center">Static Python code analyzer with a local Tkinter GUI: detects unused imports, dead definitions, and similar code blocks using AST analysis.</h4>
12+
13+
<p align="center">
14+
<b>English</b> | <a href="README_de.md">Deutsch</a>
15+
</p>
1216

1317
---
1418

1519
## Features
1620

17-
| Feature | Beschreibung |
21+
| Feature | Description |
1822
|---------|-------------|
19-
| **AST-Analyse** | Präzise Analyse über den Python Abstract Syntax Tree |
20-
| **Import-Tracking** | Erkennt genutzte und ungenutzte Imports |
21-
| **Methoden-Katalog** | Listet alle Funktionen, Methoden und Klassen |
22-
| **Duplikat-Erkennung** | Findet ähnliche Code-Blöcke mit konfigurierbarem Schwellwert |
23-
| **Framework-Erkennung** | Erkennt implizite Nutzung durch Tkinter, requests, asyncio und weitere Frameworks |
24-
| **Callback-Erkennung** | Identifiziert Callback-Funktionen korrekt als genutzt |
25-
| **Multi-File** | Analysiert ganze Python-Projekte rekursiv |
26-
| **GUI** | Einfache Tkinter-Oberfläche, kein Terminal nötig |
23+
| **AST Analysis** | Precise analysis powered by the Python Abstract Syntax Tree (AST) |
24+
| **Import Tracking** | Detects used, unused, and duplicate imports |
25+
| **Method Catalog** | Lists all functions, methods, and classes in a structured layout |
26+
| **Duplicate Detection** | Finds similar code blocks with a configurable similarity threshold |
27+
| **Framework Awareness** | Recognizes implicit usage in Tkinter, requests, asyncio, and other frameworks |
28+
| **Callback Detection** | Correctly identifies callback functions as actively used |
29+
| **Multi-File Scan** | Recursively analyzes entire Python projects |
30+
| **Desktop GUI** | Clean Tkinter-based user interface; no terminal required for basic usage |
2731

28-
### Was unterscheidet MethodenAnalyser von pylint / flake8 / vulture?
32+
### How does MethodenAnalyser compare to pylint, flake8, vulture, and radon?
2933

3034
| Feature | MethodenAnalyser | pylint | flake8 | vulture | radon |
3135
|---------|:---:|:---:|:---:|:---:|:---:|
32-
| Ungenutzte Imports | ja | ja | teilweise | ja | nein |
33-
| Ungenutzte Definitionen | ja | teilweise | nein | ja | nein |
34-
| **Code-Ähnlichkeit** | ja | nein | nein | nein | nein |
35-
| **Framework-Erkennung** | ja | teilweise | nein | nein | nein |
36-
| **GUI** | ja | nein | nein | nein | nein |
37-
| **Callback-Erkennung** | ja | nein | nein | teilweise | nein |
38-
| Keine Installation | ja | nein | nein | nein | nein |
36+
| Unused Imports | **yes** | yes | partial | yes | no |
37+
| Unused Definitions | **yes** | partial | no | yes | no |
38+
| **Code Similarity** | **yes** | no | no | no | no |
39+
| **Framework Awareness** | **yes** | partial | no | no | no |
40+
| **GUI Interface** | **yes** | no | no | no | no |
41+
| **Callback Recognition** | **yes** | no | no | partial | no |
42+
| Zero Installation (Portable) | **yes** | no | no | no | no |
3943

4044
---
4145

4246
## Screenshot
4347

44-
![MethodenAnalyser Hauptfenster](README/screenshots/main.png)
48+
![MethodenAnalyser Main Window](README/screenshots/main.png)
4549

46-
Die aktuelle Ansicht zeigt die dateibasierte Analyse mit GUI-Workflow statt reiner CLI-Ausgabe.
50+
*The desktop user interface displaying file-based analysis results and structural metrics.*
4751

4852
---
4953

5054
## Installation
5155

52-
Keine externen Laufzeit-Abhängigkeiten. Nur Python 3.10+ wird benötigt.
56+
MethodenAnalyser requires no external runtime dependencies. Only a Python 3.10+ environment is needed.
5357

5458
```bash
5559
git clone https://github.com/dev-bricks/MethodenAnalyser.git
5660
cd MethodenAnalyser
5761
python MethodenAnalyser3.py
5862
```
5963

60-
Unter Windows kann das Tool auch per Doppelklick auf `START.bat` gestartet werden.
64+
On Windows, you can also start the tool by double-clicking `START.bat`.
6165

6266
---
6367

64-
## Verwendung
65-
66-
### Einzelne Datei analysieren
67-
68-
1. Tool starten: `python MethodenAnalyser3.py` oder `START.bat`.
69-
2. **Datei analysieren** klicken und eine `.py`-Datei auswählen.
70-
3. Ergebnisse im Ausgabefenster prüfen.
68+
## Usage
7169

72-
### Ganzes Projekt analysieren
70+
### 1. Analyze a Single File via GUI
71+
1. Launch the tool: `python MethodenAnalyser3.py` or double-click `START.bat`.
72+
2. Click **Analyze File** (Datei analysieren) and select a `.py` file.
73+
3. Review the findings in the output text area.
7374

74-
1. **Projekt analysieren** klicken und einen Projektordner auswählen.
75-
2. Alle `.py`-Dateien werden rekursiv durchsucht.
76-
3. Der aggregierte Projekt-Report wird im Ausgabefenster angezeigt.
75+
### 2. Analyze a Project via GUI
76+
1. Click **Analyze Project** (Projekt analysieren) and select a folder.
77+
2. The tool recursively scans all `.py` files inside the directory.
78+
3. An aggregated project report is compiled and displayed.
7779

78-
### CLI-Modus für Automationen
79-
80-
Die GUI bleibt Standard, zusätzlich kann MethodenAnalyser jetzt headless laufen:
80+
### 3. CLI Mode for Automations & CI/CD
81+
MethodenAnalyser can also run completely headless for terminal integration or CI pipelines:
8182

8283
```bash
83-
python MethodenAnalyser3.py --file pfad/zur/datei.py
84-
python MethodenAnalyser3.py --project pfad/zum/projekt
85-
python MethodenAnalyser3.py --file pfad/zur/datei.py --json-output
86-
type pfad\zur\datei.py | python MethodenAnalyser3.py --stdin --json-output snippet.json
87-
```
84+
# Analyze a single file
85+
python MethodenAnalyser3.py --file path/to/file.py
8886

89-
`--json-output` schreibt zusätzlich den maschinenlesbaren Report `methodenanalyser-report-v1.json`. Mit eigenem Dateinamen kann der Report gezielt abgelegt werden; das Format ist in [EXPORTFORMAT.md](EXPORTFORMAT.md) dokumentiert.
87+
# Analyze an entire project folder
88+
python MethodenAnalyser3.py --project path/to/project
9089

91-
### Lokale Weboberfläche
90+
# Analyze a file and export findings to JSON
91+
python MethodenAnalyser3.py --file path/to/file.py --json-output
9292

93-
Für Snippets, einzelne Python-Dateien und kleine ZIP-Archive gibt es zusätzlich eine optionale lokale Weboberfläche:
94-
95-
```bash
96-
python webapp/server.py
93+
# Analyze via stdin and pipe output to a JSON file
94+
type path\to\file.py | python MethodenAnalyser3.py --stdin --json-output snippet.json
9795
```
9896

99-
Unter Windows startet `START_WEBAPP.bat` denselben lokalen Server. Die Oberfläche läuft standardmäßig unter `http://127.0.0.1:8765/`, nutzt den bestehenden Analysekern und zeigt Text- sowie JSON-Reports an. ZIP-Uploads werden lokal an den Python-Prozess geschickt, dort temporär entpackt und als kleines Projekt analysiert. Zusätzlich kann die lokale Weboberfläche bestehende `methodenanalyser-report-v1.json`-Dateien importieren. Sie ist ein Hilfs-/Demo-Modus für denselben Rechner, keine Companion-App und keine eigene Mobile-Produktlinie. Details stehen in [WEBAPP.md](WEBAPP.md).
100-
101-
Die PWA speichert den aktuellen Entwurf und den letzten JSON-Report lokal im Browser, bietet einen Install-Flow für Chromium-basierte Browser und hält die bereits geladene Oberfläche per Service Worker offline verfügbar. Für neue Analysen muss der lokale Python-Server trotzdem laufen.
97+
The `--json-output` flag exports a machine-readable report named `methodenanalyser-report-v1.json` (or a custom name if specified). Its structure is documented in [EXPORTFORMAT.md](EXPORTFORMAT.md).
10298

103-
Für Android-/iOS-Tests im selben WLAN kann derselbe lokale Dienst gezielt auf dem Netzwerk lauschen:
99+
### 4. Local Web Companion & PWA
100+
For browser-based code snippets, file uploads, or analyzing small ZIP archives, you can launch the optional local web helper:
104101

105102
```bash
106-
python webapp/server.py --host 0.0.0.0 --port 8765
103+
python webapp/server.py
107104
```
108105

109-
Die lokale Weboberfläche kann LAN-URLs anzeigen, falls der Server bewusst im Netzwerk freigegeben wird. Das bleibt ein technischer Testpfad, kein geplantes Android-/iOS-Produkt.
110-
Zusätzlich bündelt die **PWA-Testkarte** Install-Status, Service-Worker-, Speicher- und Viewport-Diagnostik in einer kopierbaren Kurzfassung für lokale Browser-Smokes.
111-
112-
### macOS- und Linux-Smoke
106+
Or double-click `START_WEBAPP.bat` on Windows. The server runs at `http://127.0.0.1:8765/` by default and utilizes the same AST analysis engine.
107+
* **PWA Support:** It acts as a Progressive Web App (PWA) with offline capabilities (service worker) and local browser draft saving.
108+
* **Report Import:** You can import existing `methodenanalyser-report-v1.json` files to view them in the browser.
109+
* **LAN Access:** For cross-device testing (e.g. previewing on mobile devices), make the server listen on your local network:
110+
```bash
111+
python webapp/server.py --host 0.0.0.0 --port 8765
112+
```
113+
For further details, consult [WEBAPP.md](WEBAPP.md).
113114

114-
Die Desktop-Version bleibt Windows-first, aber der Quellstand wird jetzt gezielt auch als Source-Smoke für macOS und Linux abgesichert. Lokal reicht dafür dieselbe Basis:
115+
### 5. macOS and Linux Source Verification
116+
While the GUI is optimized for Windows (using Tkinter), the codebase is fully verified to run from source on macOS and Linux. You can run unit tests and compile checks with:
115117

116118
```bash
117119
python -m py_compile MethodenAnalyser3.py manage_translations.py translator.py webapp/server.py
118120
python -m unittest discover -s tests -v
119121
```
120122

121-
Zusätzlich prüft die GitHub-Action denselben Stand automatisch auf Windows (Python 3.10 bis 3.12) sowie auf Ubuntu und macOS (jeweils Python 3.11). Damit bleiben Tkinter-Import, CLI und Web-Companion auch außerhalb von Windows im Blick, ohne bereits eine eigene Mac- oder Linux-Paketlinie zu versprechen.
123+
The repository includes a GitHub Actions workflow that executes this test suite across a matrix of Windows (Python 3.10-3.12), Ubuntu (Python 3.11), and macOS (Python 3.11).
122124

123-
Exit-Codes:
125+
---
126+
127+
## Exit Codes
124128

125-
- `0` = Analyse erfolgreich und keine Findings im Report
126-
- `1` = Aufruf- oder Analysefehler
127-
- `2` = Analyse erfolgreich, aber Findings vorhanden
128-
- `3` = Projektanalyse mit Teilfehlern in einzelnen Dateien
129+
For CI/CD scripts, the tool returns the following exit codes:
130+
- `0` = Analysis succeeded, no issues/findings detected.
131+
- `1` = Syntax, argument, or analysis error.
132+
- `2` = Analysis succeeded, but findings (unused code, similar blocks) were detected.
133+
- `3` = Project analysis completed, but some individual files failed to parse.
129134

130135
---
131136

132-
## Beispiel-Output
137+
## Example Output
133138

134139
```text
135-
=== ANALYSE: my_script.py ===
140+
=== ANALYSIS: my_script.py ===
136141
137-
IMPORTS (3 gesamt):
138-
os - genutzt
139-
json - genutzt
140-
pathlib - möglicherweise ungenutzt
142+
IMPORTS (3 total):
143+
os - active
144+
json - active
145+
pathlib - potentially unused
141146
142-
DEFINITIONEN (5 gesamt):
147+
DEFINITIONS (5 total):
143148
main()
144149
load_config()
145-
old_helper() - nicht referenziert
150+
old_helper() - no references found
146151
147-
ÄHNLICHE CODE-BLÖCKE (Schwellwert: 80%):
148-
Zeilen 42-55 <-> Zeilen 88-101 (Ähnlichkeit: 91%)
152+
SIMILAR CODE BLOCKS (Threshold: 80%):
153+
Lines 42-55 <-> Lines 88-101 (Similarity: 91%)
149154
```
150155

151156
---
152157

153-
## Konfiguration
158+
## Configuration
154159

155-
Im Quellcode anpassbar:
160+
You can customize the detection parameters directly inside the source code:
156161

157162
```python
158-
SIMILARITY_THRESHOLD = 0.8 # Schwellwert für Duplikat-Erkennung
159-
WINDOW_GEOMETRY = "1200x700" # Fenstergröße
163+
SIMILARITY_THRESHOLD = 0.8 # Similarity threshold (0.0 to 1.0) for duplicate detection
164+
WINDOW_GEOMETRY = "1200x700" # Desktop window dimensions
160165
```
161166

162167
---
163168

164-
## Datenschutz / Privacy
169+
## Data & Privacy
165170

166-
MethodenAnalyser arbeitet vollständig lokal. Der ausgewählte Python-Code, Dateipfade und Analyseergebnisse werden nicht an den Entwickler oder externe Dienste übertragen.
171+
MethodenAnalyser operates 100% locally. Your Python code, local file paths, and analysis results are never sent over the internet. There are no analytics, cloud integrations, telemetry features, or third-party tracking scripts.
167172

168-
Release-Artefakte wie EXE-Dateien, lokale Builds und Store-Pakete bleiben außerhalb des Git-Repositorys und gehören in lokale `releases/`-Ordner oder GitHub Releases.
173+
Build, packaging, and sign-related files are configured in `.gitignore` to stay outside of the version control system.
169174

170-
## Repository-Hygiene
175+
## Repository Hygiene
171176

172-
Stand: 2026-05-16
173-
174-
- GitHub-Remote: `dev-bricks/MethodenAnalyser`
175-
- Lokaler Branch `master` war vor diesem Pflege-Update synchron mit `origin/master` (`0 ahead / 0 behind`).
176-
- Secret-/Privacy-Check: keine Tokens, Schlüssel oder Credentials in den getrackten Projektdateien gefunden.
177-
- Keine Telemetrie, keine Netzwerkverbindungen und keine Cloud-Synchronisierung aus der Anwendung heraus.
178-
- Lokale Build-, Release-, Coverage-, Cache- und Signierartefakte sind über `.gitignore` ausgeschlossen.
179-
- Interne Wartungsnotizen wie `AUFGABEN.txt` bleiben lokal und werden nicht im Git-Quellbaum veröffentlicht.
180-
- Vor Veröffentlichungen: `git status --short`, Secret-Scan und `python -m py_compile MethodenAnalyser3.py manage_translations.py translator.py` ausführen.
177+
- GitHub Remote: `dev-bricks/MethodenAnalyser`
178+
- Local `master` branch is synchronized with `origin/master` (`0 ahead / 0 behind`).
179+
- Secret & Privacy Scans: verified to have no API keys, private tokens, or credentials in tracked files.
180+
- Before committing: run `git status --short`, execute a secret scan, and verify local compilation using `python -m py_compile MethodenAnalyser3.py manage_translations.py translator.py`.
181181

182182
---
183183

184-
## Entwicklung / Verification
184+
## Development & Testing
185185

186186
```bash
187+
# Verify Python syntax and AST compilation
187188
python -m py_compile MethodenAnalyser3.py manage_translations.py translator.py webapp/server.py
189+
190+
# Run unit tests
188191
python -m unittest discover -s tests -v
189192
```
190193

191-
GitHub Actions führt denselben Smoke-Test jetzt auf Windows (Python 3.10 bis 3.12) sowie zusätzlich auf Ubuntu und macOS (Python 3.11) aus.
192-
193-
Für Crawler, LLMs und Verzeichnisdienste liegt ein knapper maschinenlesbarer Projektkontext in [llms.txt](llms.txt). Die Community-Workflows verwenden aktuelle `actions/stale`- und `actions/first-interaction`-Versionen.
194-
195-
---
196-
197-
## Lizenz
198-
199-
Dieses Projekt steht unter der [MIT License](LICENSE).
194+
GitHub Actions runs these smoke tests on every push. For LLM agents and crawlers, a lightweight machine-readable context file is provided in [llms.txt](llms.txt).
200195

201196
---
202197

203-
## English
204-
205-
MethodenAnalyser is a static Python code analyzer with AST analysis, duplicate detection, and a small Tkinter GUI.
206-
207-
### Features
208-
209-
- AST-based static analysis
210-
- Duplicate code detection
211-
- Method and class catalog
212-
- Callback and framework awareness
213-
- Recursive project analysis
214-
- No external runtime dependencies
198+
## License
215199

216-
### Installation
217-
218-
```bash
219-
git clone https://github.com/dev-bricks/MethodenAnalyser.git
220-
cd MethodenAnalyser
221-
python "MethodenAnalyser3.py"
222-
```
223-
224-
### License
225-
226-
See [LICENSE](LICENSE) for details.
200+
This project is licensed under the [MIT License](LICENSE).
227201

228202
---
229203

230-
## Haftung / Liability
231-
232-
Dieses Projekt ist eine **unentgeltliche Open-Source-Schenkung** im Sinne der §§ 516 ff. BGB. Die Haftung des Urhebers ist gemäß **§ 521 BGB** auf **Vorsatz und grobe Fahrlässigkeit** beschränkt. Ergänzend gilt der Haftungsausschluss der MIT License.
204+
## Liability / Haftung
233205

234-
Nutzung auf eigenes Risiko. Keine Wartungszusage, keine Verfügbarkeitsgarantie, keine Gewähr für Fehlerfreiheit oder Eignung für einen bestimmten Zweck.
206+
This project is a gratuitous open-source donation ("unentgeltliche Open-Source-Schenkung" under German Civil Code §§ 516 ff. BGB). Under German law (**§ 521 BGB**), liability is limited to intent and gross negligence. The standard MIT License disclaimer applies globally.
235207

236-
This project is an unpaid open-source donation. Liability is limited to intent and gross negligence (§ 521 German Civil Code). Use at your own risk. No warranty, no maintenance guarantee, no fitness-for-purpose assumed.
208+
Use at your own risk. No support guarantees, no warranty for fitness for a particular purpose or error-free operation.

0 commit comments

Comments
 (0)