adryserage-aetheris 1.0.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- adryserage_aetheris-1.0.0/CHANGELOG.md +79 -0
- adryserage_aetheris-1.0.0/LICENSE +96 -0
- adryserage_aetheris-1.0.0/MANIFEST.in +11 -0
- adryserage_aetheris-1.0.0/PKG-INFO +503 -0
- adryserage_aetheris-1.0.0/README.md +470 -0
- adryserage_aetheris-1.0.0/adryserage_aetheris.egg-info/PKG-INFO +503 -0
- adryserage_aetheris-1.0.0/adryserage_aetheris.egg-info/SOURCES.txt +38 -0
- adryserage_aetheris-1.0.0/adryserage_aetheris.egg-info/dependency_links.txt +1 -0
- adryserage_aetheris-1.0.0/adryserage_aetheris.egg-info/entry_points.txt +2 -0
- adryserage_aetheris-1.0.0/adryserage_aetheris.egg-info/requires.txt +7 -0
- adryserage_aetheris-1.0.0/adryserage_aetheris.egg-info/top_level.txt +1 -0
- adryserage_aetheris-1.0.0/docs/analyses/README.md.md +62 -0
- adryserage_aetheris-1.0.0/docs/analyses/main.py.md +67 -0
- adryserage_aetheris-1.0.0/docs/analyses/quality_assurance_report.md +120 -0
- adryserage_aetheris-1.0.0/docs/analyses/vulnerabilities_report.md +21 -0
- adryserage_aetheris-1.0.0/docs/architecture_overview.md +146 -0
- adryserage_aetheris-1.0.0/pyproject.toml +56 -0
- adryserage_aetheris-1.0.0/requirements.txt +12 -0
- adryserage_aetheris-1.0.0/scripts/analyze_changes.py +154 -0
- adryserage_aetheris-1.0.0/setup.cfg +4 -0
- adryserage_aetheris-1.0.0/src/__init__.py +6 -0
- adryserage_aetheris-1.0.0/src/agents/__init__.py +4 -0
- adryserage_aetheris-1.0.0/src/agents/architect_analysis_agent.py +180 -0
- adryserage_aetheris-1.0.0/src/agents/base_agent.py +56 -0
- adryserage_aetheris-1.0.0/src/agents/code_analysis_expert.py +312 -0
- adryserage_aetheris-1.0.0/src/agents/code_metrics_agent.py +170 -0
- adryserage_aetheris-1.0.0/src/agents/dependency_vulnerability_agent.py +361 -0
- adryserage_aetheris-1.0.0/src/agents/quality_assurance_agent.py +229 -0
- adryserage_aetheris-1.0.0/src/agents/security_analysis_agent.py +187 -0
- adryserage_aetheris-1.0.0/src/cli.py +249 -0
- adryserage_aetheris-1.0.0/src/core/__init__.py +4 -0
- adryserage_aetheris-1.0.0/src/core/analyzer.py +645 -0
- adryserage_aetheris-1.0.0/src/core/config.py +56 -0
- adryserage_aetheris-1.0.0/src/core/logger.py +27 -0
- adryserage_aetheris-1.0.0/src/models/__init__.py +4 -0
- adryserage_aetheris-1.0.0/src/models/data_models.py +73 -0
- adryserage_aetheris-1.0.0/src/services/__init__.py +4 -0
- adryserage_aetheris-1.0.0/src/services/code_generator.py +95 -0
- adryserage_aetheris-1.0.0/src/services/dependency_analyzer.py +306 -0
- adryserage_aetheris-1.0.0/src/services/documentation_searcher.py +132 -0
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
Tous les changements notables de ce projet seront documentés dans ce fichier.
|
|
4
|
+
|
|
5
|
+
Le format est basé sur [Keep a Changelog](https://keepachangelog.com/fr/1.0.0/),
|
|
6
|
+
et ce projet adhère à [Semantic Versioning](https://semver.org/lang/fr/).
|
|
7
|
+
|
|
8
|
+
## [1.0.3] - 2025-01-XX
|
|
9
|
+
|
|
10
|
+
### 🚀 Publication
|
|
11
|
+
|
|
12
|
+
- Renommage du package Python en `adryserage-aetheris` pour publication sur GitHub Packages
|
|
13
|
+
- Configuration complète du package avec `pyproject.toml`
|
|
14
|
+
- Ajout de la commande CLI `aetheris` avec sous-commandes (`aetheris analysis`)
|
|
15
|
+
- Workflow GitHub Actions pour publication automatique sur GitHub Packages lors des tags de version
|
|
16
|
+
- Documentation mise à jour avec instructions d'installation depuis GitHub Packages
|
|
17
|
+
|
|
18
|
+
### 📦 Package
|
|
19
|
+
|
|
20
|
+
- Nom du package : `adryserage-aetheris`
|
|
21
|
+
- Commande CLI : `aetheris` (inchangée)
|
|
22
|
+
- Installation : `pip install --extra-index-url ... adryserage-aetheris`
|
|
23
|
+
|
|
24
|
+
## [1.0.2] - 2025-11-21
|
|
25
|
+
|
|
26
|
+
### 🔧 Corrections
|
|
27
|
+
|
|
28
|
+
- Correction de la commande `gh pr diff` qui utilisait des flags invalides (`--json` et `--jq` non supportés)
|
|
29
|
+
- Remplacement par `gh pr view` avec filtrage approprié pour exclure les fichiers supprimés
|
|
30
|
+
- Alignement du comportement entre les modes PR et commit pour exclure les fichiers supprimés (cohérence avec `git diff --diff-filter=ACMR`)
|
|
31
|
+
|
|
32
|
+
## [1.0.1] - 2025-11-21
|
|
33
|
+
|
|
34
|
+
### 🔧 Corrections
|
|
35
|
+
|
|
36
|
+
- Correction du workflow GitHub Actions pour utiliser `gh pr view` au lieu de `gh pr diff` pour récupérer les fichiers modifiés dans les pull requests
|
|
37
|
+
|
|
38
|
+
## [1.0.0] - 2025-11-21
|
|
39
|
+
|
|
40
|
+
### ✨ Fonctionnalités
|
|
41
|
+
|
|
42
|
+
- Ajout du support pour analyser uniquement les fichiers modifiés dans le Code Analyzer
|
|
43
|
+
- Support des analyses ciblées pour les Pull Requests et commits
|
|
44
|
+
- Mode `--changed-files-only` avec support des fichiers spécifiés via arguments ou variables d'environnement
|
|
45
|
+
- Support du numéro de PR pour enrichir les rapports d'analyse
|
|
46
|
+
|
|
47
|
+
### 📚 Documentation
|
|
48
|
+
|
|
49
|
+
- Documentation complète du système dans le README.md
|
|
50
|
+
- Instructions d'installation et de configuration détaillées
|
|
51
|
+
- Guide d'utilisation avec exemples
|
|
52
|
+
- Documentation des agents d'analyse et de leurs fonctionnalités
|
|
53
|
+
|
|
54
|
+
### 🏗️ Infrastructure
|
|
55
|
+
|
|
56
|
+
- Workflow GitHub Actions pour l'analyse automatique de code
|
|
57
|
+
- Support des analyses complètes et ciblées
|
|
58
|
+
- Génération automatique de rapports en tant qu'artifacts GitHub
|
|
59
|
+
|
|
60
|
+
### 🎉 Version initiale
|
|
61
|
+
|
|
62
|
+
- Système d'analyse de code multi-agents avec 6 agents spécialisés :
|
|
63
|
+
- Code Analysis Expert (CAE)
|
|
64
|
+
- Architect Analysis Agent (AAA)
|
|
65
|
+
- Security Analysis Agent (SSA)
|
|
66
|
+
- Code Metrics Agent (CMA)
|
|
67
|
+
- Dependency Vulnerability Agent (DVA)
|
|
68
|
+
- Quality Assurance Agent (QAA)
|
|
69
|
+
- Support de multiples langages de programmation
|
|
70
|
+
- Analyse des vulnérabilités via l'API OSV
|
|
71
|
+
- Génération de rapports détaillés en Markdown
|
|
72
|
+
- Configuration flexible via variables d'environnement
|
|
73
|
+
|
|
74
|
+
|
|
75
|
+
|
|
76
|
+
[1.0.3]: https://github.com/adryserage/code_reviewer/compare/v1.0.2...v1.0.3
|
|
77
|
+
[1.0.2]: https://github.com/adryserage/code_reviewer/compare/v1.0.1...v1.0.2
|
|
78
|
+
[1.0.1]: https://github.com/adryserage/code_reviewer/compare/v1.0.0...v1.0.1
|
|
79
|
+
[1.0.0]: https://github.com/adryserage/code_reviewer/releases/tag/v1.0.0
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
PROPRIETARY LICENSE WITH GPL ELEMENTS
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 [Votre Nom/Organisation]
|
|
4
|
+
All rights reserved.
|
|
5
|
+
|
|
6
|
+
This software and associated documentation files (the "Software") are the
|
|
7
|
+
proprietary and confidential property of the copyright holder.
|
|
8
|
+
|
|
9
|
+
RESTRICTIONS:
|
|
10
|
+
|
|
11
|
+
1. PROPRIETARY USE:
|
|
12
|
+
- This Software is provided for use by authorized users only.
|
|
13
|
+
- You may NOT copy, modify, distribute, or create derivative works of
|
|
14
|
+
this Software without explicit written permission from the copyright holder.
|
|
15
|
+
|
|
16
|
+
2. NO REDISTRIBUTION:
|
|
17
|
+
- You may NOT redistribute this Software in any form, including but not
|
|
18
|
+
limited to source code, compiled binaries, or modified versions.
|
|
19
|
+
- You may NOT publish, share, or make available this Software to any
|
|
20
|
+
third party without prior written consent.
|
|
21
|
+
|
|
22
|
+
3. NO COMMERCIAL USE:
|
|
23
|
+
- Commercial use, including but not limited to selling, licensing, or
|
|
24
|
+
incorporating this Software into commercial products, is strictly
|
|
25
|
+
prohibited without a separate commercial license agreement.
|
|
26
|
+
|
|
27
|
+
4. REVERSE ENGINEERING:
|
|
28
|
+
- Reverse engineering, decompilation, or disassembly of this Software
|
|
29
|
+
is prohibited.
|
|
30
|
+
|
|
31
|
+
5. GPL COMPONENTS:
|
|
32
|
+
- Portions of this Software may incorporate or be derived from works
|
|
33
|
+
licensed under the GNU General Public License (GPL).
|
|
34
|
+
- For any GPL-licensed components:
|
|
35
|
+
a) You may use, modify, and distribute those specific components
|
|
36
|
+
under the terms of the GPL version 3.0 or later.
|
|
37
|
+
b) Any modifications to GPL components must be released under the
|
|
38
|
+
same GPL license.
|
|
39
|
+
c) The GPL components remain subject to the GPL's copyleft provisions.
|
|
40
|
+
- The GPL components are clearly identified in the source code and
|
|
41
|
+
documentation.
|
|
42
|
+
|
|
43
|
+
6. TERMINATION:
|
|
44
|
+
- Any violation of these terms will result in immediate termination of
|
|
45
|
+
your right to use this Software.
|
|
46
|
+
- Upon termination, you must destroy all copies of the Software in your
|
|
47
|
+
possession.
|
|
48
|
+
|
|
49
|
+
7. NO WARRANTY:
|
|
50
|
+
- THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
|
51
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
52
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
|
53
|
+
- IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
|
54
|
+
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
|
55
|
+
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
|
56
|
+
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
57
|
+
|
|
58
|
+
8. CONTACT:
|
|
59
|
+
- For licensing inquiries, permissions, or questions regarding this
|
|
60
|
+
Software, please contact the copyright holder.
|
|
61
|
+
|
|
62
|
+
PERMISSIONS:
|
|
63
|
+
|
|
64
|
+
The following uses are explicitly permitted:
|
|
65
|
+
|
|
66
|
+
- Personal or internal use by authorized individuals or organizations.
|
|
67
|
+
- Educational use for learning and research purposes (non-commercial).
|
|
68
|
+
- Use within the scope of a valid license agreement with the copyright holder.
|
|
69
|
+
|
|
70
|
+
This license does not grant you any rights to use the copyright holder's
|
|
71
|
+
trademarks, service marks, or other intellectual property.
|
|
72
|
+
|
|
73
|
+
---
|
|
74
|
+
|
|
75
|
+
GPL COMPONENTS NOTICE:
|
|
76
|
+
|
|
77
|
+
This Software includes components licensed under the GNU General Public
|
|
78
|
+
License (GPL) version 3.0 or later. The GPL is a copyleft license that
|
|
79
|
+
requires derivative works to be licensed under the same terms.
|
|
80
|
+
|
|
81
|
+
For the GPL-licensed components:
|
|
82
|
+
- You have the right to use, modify, and distribute those components
|
|
83
|
+
under the GPL.
|
|
84
|
+
- If you distribute GPL components, you must make the source code
|
|
85
|
+
available under the GPL.
|
|
86
|
+
- Any modifications to GPL components must be released under the GPL.
|
|
87
|
+
|
|
88
|
+
The full text of the GPL version 3.0 can be found at:
|
|
89
|
+
https://www.gnu.org/licenses/gpl-3.0.html
|
|
90
|
+
|
|
91
|
+
---
|
|
92
|
+
|
|
93
|
+
By using this Software, you acknowledge that you have read this license,
|
|
94
|
+
understand it, and agree to be bound by its terms. If you do not agree
|
|
95
|
+
to these terms, you must not use this Software.
|
|
96
|
+
|
|
@@ -0,0 +1,503 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: adryserage-aetheris
|
|
3
|
+
Version: 1.0.0
|
|
4
|
+
Summary: Aetheris by Allowebs - Système d'analyse de code multi-agents avec plusieurs agents coopérants
|
|
5
|
+
Author: Allowebs
|
|
6
|
+
License: MIT
|
|
7
|
+
Project-URL: Homepage, https://github.com/Allowebs/code_reviewer
|
|
8
|
+
Project-URL: Repository, https://github.com/Allowebs/code_reviewer
|
|
9
|
+
Project-URL: Issues, https://github.com/Allowebs/code_reviewer/issues
|
|
10
|
+
Keywords: code-analysis,code-review,static-analysis,security,quality-assurance
|
|
11
|
+
Classifier: Development Status :: 4 - Beta
|
|
12
|
+
Classifier: Intended Audience :: Developers
|
|
13
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
14
|
+
Classifier: Programming Language :: Python :: 3
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.8
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
20
|
+
Classifier: Topic :: Software Development :: Quality Assurance
|
|
21
|
+
Classifier: Topic :: Software Development :: Testing
|
|
22
|
+
Classifier: Topic :: Security
|
|
23
|
+
Requires-Python: >=3.8
|
|
24
|
+
Description-Content-Type: text/markdown
|
|
25
|
+
License-File: LICENSE
|
|
26
|
+
Requires-Dist: google-generativeai>=0.8.0
|
|
27
|
+
Requires-Dist: pathspec>=0.12.0
|
|
28
|
+
Requires-Dist: requests>=2.32.0
|
|
29
|
+
Requires-Dist: pyyaml>=6.0
|
|
30
|
+
Provides-Extra: web-search
|
|
31
|
+
Requires-Dist: duckduckgo-search>=6.0.0; extra == "web-search"
|
|
32
|
+
Dynamic: license-file
|
|
33
|
+
|
|
34
|
+
# Aetheris by Allowebs - Système d'Analyse de Code Multi-Agents
|
|
35
|
+
|
|
36
|
+
Système d'analyse de code automatisé utilisant plusieurs agents coopérants pour fournir une analyse complète de la qualité, de la sécurité et de l'architecture de votre codebase.
|
|
37
|
+
|
|
38
|
+
## 🎯 Fonctionnalités
|
|
39
|
+
|
|
40
|
+
Le système utilise **6 agents spécialisés** qui travaillent ensemble pour analyser votre code :
|
|
41
|
+
|
|
42
|
+
### Agents d'Analyse
|
|
43
|
+
|
|
44
|
+
1. **Code Analysis Expert (CAE)**
|
|
45
|
+
- Analyse chaque fichier individuellement
|
|
46
|
+
- Identifie les objectifs et fonctions principales
|
|
47
|
+
- Détecte les points forts et bonnes pratiques
|
|
48
|
+
- Signale les risques et dettes techniques
|
|
49
|
+
- Propose des suggestions d'amélioration
|
|
50
|
+
- Analyse les dépendances entre fichiers
|
|
51
|
+
|
|
52
|
+
2. **Architect Analysis Agent (AAA)**
|
|
53
|
+
- Produit une vue d'ensemble de l'architecture
|
|
54
|
+
- Identifie les patterns architecturaux
|
|
55
|
+
- Évalue la cohérence inter-modules
|
|
56
|
+
- Détecte les redondances et couplages excessifs
|
|
57
|
+
- Propose un plan de refactoring
|
|
58
|
+
|
|
59
|
+
3. **Security Analysis Agent (SSA)**
|
|
60
|
+
- Détecte les vulnérabilités de sécurité
|
|
61
|
+
- Identifie les injections (SQL, XSS, etc.)
|
|
62
|
+
- Signale les secrets codés en dur
|
|
63
|
+
- Vérifie la cryptographie faible
|
|
64
|
+
- Analyse les problèmes d'authentification
|
|
65
|
+
|
|
66
|
+
4. **Code Metrics Agent (CMA)**
|
|
67
|
+
- Calcule les métriques de code (complexité cyclomatique, etc.)
|
|
68
|
+
- Détecte le code dupliqué
|
|
69
|
+
- Mesure la profondeur d'imbrication
|
|
70
|
+
- Calcule l'indice de maintenabilité
|
|
71
|
+
|
|
72
|
+
5. **Dependency Vulnerability Agent (DVA)**
|
|
73
|
+
- Analyse les vulnérabilités des dépendances via l'API OSV
|
|
74
|
+
- Supporte npm, PyPI, Pub (Dart)
|
|
75
|
+
- Identifie les CVE et vulnérabilités connues
|
|
76
|
+
- Propose les versions corrigées
|
|
77
|
+
|
|
78
|
+
6. **Quality Assurance Agent (QAA)**
|
|
79
|
+
- Synthétise toutes les analyses
|
|
80
|
+
- Génère un score de qualité global
|
|
81
|
+
- Crée un plan d'action priorisé
|
|
82
|
+
- Propose une roadmap d'amélioration
|
|
83
|
+
|
|
84
|
+
## 🚀 Installation
|
|
85
|
+
|
|
86
|
+
### Prérequis
|
|
87
|
+
|
|
88
|
+
- Python 3.8 ou supérieur
|
|
89
|
+
- Clé API Google Gemini ([Obtenir une clé](https://makersuite.google.com/app/apikey))
|
|
90
|
+
|
|
91
|
+
### Installation depuis GitHub Packages (Recommandé)
|
|
92
|
+
|
|
93
|
+
Aetheris est disponible en tant que package Python sur GitHub Packages sous le nom `adryserage-aetheris`. Pour l'installer :
|
|
94
|
+
|
|
95
|
+
1. **Créer un Personal Access Token (PAT)** :
|
|
96
|
+
- Allez dans GitHub → Settings → Developer settings → Personal access tokens → Tokens (classic)
|
|
97
|
+
- Créez un nouveau token avec le scope `read:packages`
|
|
98
|
+
- Copiez le token
|
|
99
|
+
|
|
100
|
+
2. **Installer le package** :
|
|
101
|
+
|
|
102
|
+
```bash
|
|
103
|
+
# Linux/Mac
|
|
104
|
+
pip install --extra-index-url https://USERNAME:TOKEN@pypi.github.com/Allowebs/code_reviewer/simple/ adryserage-aetheris
|
|
105
|
+
|
|
106
|
+
# Windows (PowerShell)
|
|
107
|
+
pip install --extra-index-url https://USERNAME:TOKEN@pypi.github.com/Allowebs/code_reviewer/simple/ adryserage-aetheris
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
Remplacez `USERNAME` par votre nom d'utilisateur GitHub et `TOKEN` par votre Personal Access Token.
|
|
111
|
+
|
|
112
|
+
**Alternative avec variable d'environnement** :
|
|
113
|
+
|
|
114
|
+
```bash
|
|
115
|
+
export PIP_EXTRA_INDEX_URL="https://USERNAME:TOKEN@pypi.github.com/Allowebs/code_reviewer/simple/"
|
|
116
|
+
pip install adryserage-aetheris
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
**Note** : Après l'installation, la commande CLI reste `aetheris` (définie dans le package).
|
|
120
|
+
|
|
121
|
+
### Installation depuis les sources
|
|
122
|
+
|
|
123
|
+
Si vous préférez installer depuis les sources :
|
|
124
|
+
|
|
125
|
+
```bash
|
|
126
|
+
git clone https://github.com/Allowebs/code_reviewer.git
|
|
127
|
+
cd code_reviewer
|
|
128
|
+
pip install -r requirements.txt
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
### Dépendances
|
|
132
|
+
|
|
133
|
+
- `google-generativeai` - API Gemini pour l'analyse de code
|
|
134
|
+
- `pathspec` - Gestion des patterns .gitignore
|
|
135
|
+
- `requests` - Requêtes HTTP pour l'API OSV (version >=2.32.0 pour corriger les vulnérabilités CVE-2024-47081 et CVE-2024-35195)
|
|
136
|
+
- `pyyaml` - Parsing des fichiers YAML (pubspec.yaml pour Dart/Flutter)
|
|
137
|
+
- `duckduckgo-search` - Recherche web pour enrichir les analyses (optionnel)
|
|
138
|
+
|
|
139
|
+
## 🏗️ Structure du Projet
|
|
140
|
+
|
|
141
|
+
Le projet est organisé en modules pour une meilleure maintenabilité :
|
|
142
|
+
|
|
143
|
+
```
|
|
144
|
+
aetheris/
|
|
145
|
+
├── src/
|
|
146
|
+
│ ├── core/ # Modules principaux
|
|
147
|
+
│ │ ├── config.py # Configuration (AnalysisConfig, load_env_file)
|
|
148
|
+
│ │ ├── logger.py # Logging et encodage UTF-8
|
|
149
|
+
│ │ └── analyzer.py # Orchestrateur principal (CodeAnalyzer)
|
|
150
|
+
│ ├── models/ # Modèles de données
|
|
151
|
+
│ │ └── data_models.py # Dataclasses (FileAnalysis, SecurityIssue, etc.)
|
|
152
|
+
│ ├── agents/ # Agents d'analyse
|
|
153
|
+
│ │ ├── base_agent.py # Classe de base pour tous les agents
|
|
154
|
+
│ │ ├── code_analysis_expert.py
|
|
155
|
+
│ │ ├── architect_analysis_agent.py
|
|
156
|
+
│ │ ├── security_analysis_agent.py
|
|
157
|
+
│ │ ├── code_metrics_agent.py
|
|
158
|
+
│ │ ├── dependency_vulnerability_agent.py
|
|
159
|
+
│ │ └── quality_assurance_agent.py
|
|
160
|
+
│ └── services/ # Services utilitaires
|
|
161
|
+
│ ├── code_generator.py
|
|
162
|
+
│ ├── documentation_searcher.py
|
|
163
|
+
│ └── dependency_analyzer.py
|
|
164
|
+
├── main.py # Point d'entrée principal
|
|
165
|
+
├── requirements.txt # Dépendances Python
|
|
166
|
+
└── README.md # Documentation
|
|
167
|
+
```
|
|
168
|
+
|
|
169
|
+
### Architecture Modulaire
|
|
170
|
+
|
|
171
|
+
- **`src/core/`** : Contient l'orchestrateur principal (`CodeAnalyzer`) et les utilitaires de configuration et logging
|
|
172
|
+
- **`src/models/`** : Définit les structures de données utilisées pour échanger des informations entre les composants
|
|
173
|
+
- **`src/agents/`** : Chaque agent est un module indépendant héritant de `BaseAgent` pour la logique commune
|
|
174
|
+
- **`src/services/`** : Services utilitaires réutilisables (génération de code, recherche web, analyse de dépendances)
|
|
175
|
+
|
|
176
|
+
Cette structure modulaire facilite :
|
|
177
|
+
|
|
178
|
+
- La maintenance et l'extension du code
|
|
179
|
+
- La réutilisation des composants
|
|
180
|
+
- Les tests unitaires
|
|
181
|
+
- La compréhension de l'architecture
|
|
182
|
+
|
|
183
|
+
## ⚙️ Configuration
|
|
184
|
+
|
|
185
|
+
### Configuration de la clé API Gemini
|
|
186
|
+
|
|
187
|
+
Créez un fichier `.env` à la racine du projet (vous pouvez utiliser `.env.example` comme modèle) :
|
|
188
|
+
|
|
189
|
+
```env
|
|
190
|
+
GEMINI_API_KEY=votre_cle_api_ici
|
|
191
|
+
```
|
|
192
|
+
|
|
193
|
+
Ou définissez la variable d'environnement :
|
|
194
|
+
|
|
195
|
+
**Windows (PowerShell):**
|
|
196
|
+
|
|
197
|
+
```powershell
|
|
198
|
+
$env:GEMINI_API_KEY='votre_cle_api_ici'
|
|
199
|
+
```
|
|
200
|
+
|
|
201
|
+
**Linux/Mac:**
|
|
202
|
+
|
|
203
|
+
```bash
|
|
204
|
+
export GEMINI_API_KEY=votre_cle_api_ici
|
|
205
|
+
```
|
|
206
|
+
|
|
207
|
+
### Options de configuration
|
|
208
|
+
|
|
209
|
+
Vous pouvez personnaliser le comportement via des variables d'environnement ou le fichier `.env` :
|
|
210
|
+
|
|
211
|
+
| Variable | Description | Défaut |
|
|
212
|
+
| --------------------------------- | ----------------------------------------- | ------------------------------- |
|
|
213
|
+
| `GEMINI_MODEL` | Modèle Gemini à utiliser | `gemini-3-pro-preview` |
|
|
214
|
+
| `BATCH_SIZE` | Nombre de fichiers analysés en parallèle | `10` |
|
|
215
|
+
| `MAX_RETRIES` | Nombre de tentatives en cas d'erreur | `3` |
|
|
216
|
+
| `TIMEOUT_SECONDS` | Timeout pour chaque requête (secondes) | `60` |
|
|
217
|
+
| `OUTPUT_DIR` | Répertoire de sortie des analyses | `docs/analyses` |
|
|
218
|
+
| `ARCHITECTURE_REPORT` | Chemin du rapport d'architecture | `docs/architecture_overview.md` |
|
|
219
|
+
| `ROOT_DIR` | Répertoire racine à analyser | `.` |
|
|
220
|
+
| `ENABLE_WEB_SEARCH` | Activer la recherche web | `true` |
|
|
221
|
+
| `MAX_WEB_RESULTS` | Nombre max de résultats de recherche | `3` |
|
|
222
|
+
| `ENABLE_SECURITY_ANALYSIS` | Activer l'analyse de sécurité | `true` |
|
|
223
|
+
| `ENABLE_METRICS_ANALYSIS` | Activer l'analyse de métriques | `true` |
|
|
224
|
+
| `ENABLE_DEPENDENCY_VULNERABILITY` | Activer l'analyse des vulnérabilités | `true` |
|
|
225
|
+
| `ENABLE_CODE_GENERATION` | Permettre la génération de code d'analyse | `true` |
|
|
226
|
+
|
|
227
|
+
## 📖 Utilisation
|
|
228
|
+
|
|
229
|
+
### Commande principale
|
|
230
|
+
|
|
231
|
+
Une fois installé, utilisez la commande `aetheris` :
|
|
232
|
+
|
|
233
|
+
```bash
|
|
234
|
+
# Afficher l'aide
|
|
235
|
+
aetheris --help
|
|
236
|
+
|
|
237
|
+
# Afficher l'aide pour la sous-commande analysis
|
|
238
|
+
aetheris analysis --help
|
|
239
|
+
```
|
|
240
|
+
|
|
241
|
+
### Analyse de base
|
|
242
|
+
|
|
243
|
+
```bash
|
|
244
|
+
aetheris analysis
|
|
245
|
+
```
|
|
246
|
+
|
|
247
|
+
La commande va :
|
|
248
|
+
|
|
249
|
+
1. Scanner tous les fichiers du répertoire courant
|
|
250
|
+
2. Analyser chaque fichier avec les agents appropriés
|
|
251
|
+
3. Générer des rapports détaillés dans `docs/analyses/`
|
|
252
|
+
4. Créer un rapport d'architecture global
|
|
253
|
+
5. Générer un rapport d'assurance qualité
|
|
254
|
+
|
|
255
|
+
### Analyse d'un répertoire spécifique
|
|
256
|
+
|
|
257
|
+
```bash
|
|
258
|
+
ROOT_DIR=./mon_projet aetheris analysis
|
|
259
|
+
```
|
|
260
|
+
|
|
261
|
+
### Analyse des fichiers modifiés uniquement
|
|
262
|
+
|
|
263
|
+
Pour analyser uniquement les fichiers modifiés (utile pour les PR/commits) :
|
|
264
|
+
|
|
265
|
+
```bash
|
|
266
|
+
# Avec une liste de fichiers (séparés par virgules)
|
|
267
|
+
aetheris analysis --changed-files-only --files src/file1.py,src/file2.py
|
|
268
|
+
|
|
269
|
+
# Avec une liste JSON (depuis GitHub Actions)
|
|
270
|
+
aetheris analysis --changed-files-only --files '["src/file1.py", "src/file2.py"]'
|
|
271
|
+
|
|
272
|
+
# Avec un numéro de PR (pour information)
|
|
273
|
+
aetheris analysis --changed-files-only --files src/file1.py --pr-number 123
|
|
274
|
+
```
|
|
275
|
+
|
|
276
|
+
### Utilisation depuis les sources (sans installation)
|
|
277
|
+
|
|
278
|
+
Si vous avez cloné le repository et installé les dépendances :
|
|
279
|
+
|
|
280
|
+
```bash
|
|
281
|
+
# Utiliser directement main.py
|
|
282
|
+
python main.py
|
|
283
|
+
|
|
284
|
+
# Ou utiliser le module CLI
|
|
285
|
+
python -m src.cli analysis
|
|
286
|
+
```
|
|
287
|
+
|
|
288
|
+
## 🔄 GitHub Actions
|
|
289
|
+
|
|
290
|
+
Le projet inclut un workflow GitHub Actions pour automatiser l'analyse de code directement dans votre repository.
|
|
291
|
+
|
|
292
|
+
### Configuration
|
|
293
|
+
|
|
294
|
+
1. **Ajouter le secret GitHub** :
|
|
295
|
+
- Allez dans votre repository → Settings → Secrets and variables → Actions
|
|
296
|
+
- Cliquez sur "New repository secret"
|
|
297
|
+
- Nom : `GEMINI_API_KEY`
|
|
298
|
+
- Valeur : Votre clé API Gemini
|
|
299
|
+
- Cliquez sur "Add secret"
|
|
300
|
+
|
|
301
|
+
2. **Le workflow est déjà configuré** dans `.github/workflows/code-review.yml`
|
|
302
|
+
|
|
303
|
+
### Déclencheurs disponibles
|
|
304
|
+
|
|
305
|
+
Le workflow s'exécute automatiquement dans les cas suivants :
|
|
306
|
+
|
|
307
|
+
- **Push vers main/master** : Analyse complète de la codebase
|
|
308
|
+
- **Pull Request** : Analyse uniquement des fichiers modifiés dans la PR
|
|
309
|
+
- **Exécution manuelle** : Via l'onglet Actions de GitHub avec options :
|
|
310
|
+
- Mode `full` : Analyse complète
|
|
311
|
+
- Mode `changed` : Analyse des fichiers modifiés (peut spécifier un numéro de PR)
|
|
312
|
+
|
|
313
|
+
### Résultats
|
|
314
|
+
|
|
315
|
+
Les rapports d'analyse sont disponibles en tant qu'**artifacts GitHub** :
|
|
316
|
+
|
|
317
|
+
- Allez dans l'onglet Actions
|
|
318
|
+
- Sélectionnez l'exécution du workflow
|
|
319
|
+
- Téléchargez l'artifact "code-analysis-reports"
|
|
320
|
+
- Les rapports incluent :
|
|
321
|
+
- Rapports individuels par fichier (`docs/analyses/*.md`)
|
|
322
|
+
- Rapport d'architecture (`docs/architecture_overview.md`)
|
|
323
|
+
- Rapport d'assurance qualité (`docs/analyses/quality_assurance_report.md`)
|
|
324
|
+
- Rapport de vulnérabilités (`docs/analyses/vulnerabilities_report.md`)
|
|
325
|
+
|
|
326
|
+
### Exemple d'utilisation
|
|
327
|
+
|
|
328
|
+
1. Créez ou modifiez une Pull Request
|
|
329
|
+
2. Le workflow s'exécute automatiquement
|
|
330
|
+
3. Consultez les résultats dans l'onglet Actions
|
|
331
|
+
4. Téléchargez les rapports depuis les artifacts
|
|
332
|
+
|
|
333
|
+
### Personnalisation
|
|
334
|
+
|
|
335
|
+
Vous pouvez personnaliser le workflow en modifiant `.github/workflows/code-review.yml` :
|
|
336
|
+
|
|
337
|
+
- Changer les branches déclencheuses
|
|
338
|
+
- Modifier les chemins exclus (`paths-ignore`)
|
|
339
|
+
- Ajuster les options d'analyse
|
|
340
|
+
- Ajouter des notifications (email, Slack, etc.)
|
|
341
|
+
|
|
342
|
+
## 📊 Rapports générés
|
|
343
|
+
|
|
344
|
+
### Rapports individuels
|
|
345
|
+
|
|
346
|
+
Chaque fichier analysé génère un rapport Markdown dans `docs/analyses/` avec :
|
|
347
|
+
|
|
348
|
+
- Objectif et fonction principale
|
|
349
|
+
- Points forts et bonnes pratiques
|
|
350
|
+
- Relations et dépendances
|
|
351
|
+
- Risques et dettes techniques
|
|
352
|
+
- Suggestions d'amélioration
|
|
353
|
+
- Problèmes de sécurité détectés
|
|
354
|
+
- Métriques de code
|
|
355
|
+
|
|
356
|
+
### Rapport d'architecture
|
|
357
|
+
|
|
358
|
+
`docs/architecture_overview.md` contient :
|
|
359
|
+
|
|
360
|
+
- Vue d'ensemble de l'architecture
|
|
361
|
+
- Patterns identifiés
|
|
362
|
+
- Cohérence inter-modules
|
|
363
|
+
- Redondances et dépendances
|
|
364
|
+
- Recommandations d'optimisation
|
|
365
|
+
- Plan de refactoring
|
|
366
|
+
- Gouvernance du code
|
|
367
|
+
|
|
368
|
+
### Rapport d'assurance qualité
|
|
369
|
+
|
|
370
|
+
`docs/analyses/quality_assurance_report.md` contient :
|
|
371
|
+
|
|
372
|
+
- Score de qualité global (sur 100)
|
|
373
|
+
- Analyse par dimension (Sécurité, Maintenabilité, Architecture, etc.)
|
|
374
|
+
- Plan d'action priorisé
|
|
375
|
+
- Roadmap d'amélioration
|
|
376
|
+
|
|
377
|
+
### Rapport des vulnérabilités
|
|
378
|
+
|
|
379
|
+
`docs/analyses/vulnerabilities_report.md` contient :
|
|
380
|
+
|
|
381
|
+
- Liste des vulnérabilités détectées dans les dépendances
|
|
382
|
+
- Répartition par sévérité (critical, high, medium, low)
|
|
383
|
+
- CVE et identifiants de vulnérabilités
|
|
384
|
+
- Versions corrigées disponibles
|
|
385
|
+
|
|
386
|
+
## 🔍 Langages supportés
|
|
387
|
+
|
|
388
|
+
Le système détecte automatiquement et analyse :
|
|
389
|
+
|
|
390
|
+
- **Dart/Flutter** (`.dart`)
|
|
391
|
+
- **TypeScript/JavaScript** (`.ts`, `.tsx`, `.js`, `.jsx`)
|
|
392
|
+
- **Python** (`.py`)
|
|
393
|
+
- **Java** (`.java`)
|
|
394
|
+
- **Kotlin** (`.kt`)
|
|
395
|
+
- **Swift** (`.swift`)
|
|
396
|
+
- **Go** (`.go`)
|
|
397
|
+
- **Rust** (`.rs`)
|
|
398
|
+
- **C/C++** (`.c`, `.cpp`, `.h`)
|
|
399
|
+
- **C#** (`.cs`)
|
|
400
|
+
- **PHP** (`.php`)
|
|
401
|
+
- **Ruby** (`.rb`)
|
|
402
|
+
- Et autres langages de programmation
|
|
403
|
+
|
|
404
|
+
## 🛡️ Fichiers exclus
|
|
405
|
+
|
|
406
|
+
Le système exclut automatiquement :
|
|
407
|
+
|
|
408
|
+
- Dossiers de build (`build/`, `dist/`, `node_modules/`, etc.)
|
|
409
|
+
- Fichiers générés (`.g.dart`, `.d.ts`, `.pyc`, etc.)
|
|
410
|
+
- Fichiers de lock (`package-lock.json`, `yarn.lock`, etc.)
|
|
411
|
+
- Fichiers binaires (> 1MB)
|
|
412
|
+
- Dossiers cachés (`.git/`, `.venv/`, etc.)
|
|
413
|
+
|
|
414
|
+
Les règles `.gitignore` sont respectées automatiquement.
|
|
415
|
+
|
|
416
|
+
## 📝 Exemple de sortie
|
|
417
|
+
|
|
418
|
+
```
|
|
419
|
+
============================================================
|
|
420
|
+
🚀 Démarrage de l'analyse de code
|
|
421
|
+
============================================================
|
|
422
|
+
|
|
423
|
+
📁 Répertoire racine: .
|
|
424
|
+
📂 Répertoire de sortie: docs/analyses
|
|
425
|
+
🤖 Modèle Gemini: gemini-3-pro-preview
|
|
426
|
+
|
|
427
|
+
🌐 Recherche web activée pour les documentations
|
|
428
|
+
|
|
429
|
+
🔍 Scan des fichiers...
|
|
430
|
+
✅ 25 fichiers trouvés à analyser
|
|
431
|
+
|
|
432
|
+
🔗 Initialisation de l'analyseur de dépendances...
|
|
433
|
+
✅ Analyseur de dépendances initialisé
|
|
434
|
+
|
|
435
|
+
📦 Batch 1/3 (10 fichiers)...
|
|
436
|
+
✅ src/main.py
|
|
437
|
+
✅ src/utils.py
|
|
438
|
+
...
|
|
439
|
+
|
|
440
|
+
✅ Analyse de 25 fichiers terminée
|
|
441
|
+
|
|
442
|
+
🔄 Analyse des dépendances et détection des cycles...
|
|
443
|
+
✅ Aucun cycle de dépendances détecté
|
|
444
|
+
|
|
445
|
+
🏗️ Génération du rapport d'architecture...
|
|
446
|
+
✅ Rapport d'architecture sauvegardé: docs/architecture_overview.md
|
|
447
|
+
|
|
448
|
+
🔒 Analyse des vulnérabilités des dépendances via OSV API...
|
|
449
|
+
✅ Analyse terminée: 15 package(s) vérifié(s), 2 vulnérabilité(s) trouvée(s)
|
|
450
|
+
|
|
451
|
+
📋 Génération du rapport d'assurance qualité...
|
|
452
|
+
✅ Rapport d'assurance qualité sauvegardé: docs/analyses/quality_assurance_report.md
|
|
453
|
+
|
|
454
|
+
📊 Statistiques:
|
|
455
|
+
- Fichiers analysés: 25
|
|
456
|
+
- Succès: 25
|
|
457
|
+
- Échecs: 0
|
|
458
|
+
|
|
459
|
+
Répartition par langage:
|
|
460
|
+
- Python: 15
|
|
461
|
+
- TypeScript: 8
|
|
462
|
+
- Markdown: 2
|
|
463
|
+
|
|
464
|
+
============================================================
|
|
465
|
+
✅ Analyse terminée avec succès!
|
|
466
|
+
============================================================
|
|
467
|
+
```
|
|
468
|
+
|
|
469
|
+
## 🐛 Dépannage
|
|
470
|
+
|
|
471
|
+
### Erreur: "Variable d'environnement GEMINI_API_KEY non définie"
|
|
472
|
+
|
|
473
|
+
Créez un fichier `.env` avec votre clé API ou définissez la variable d'environnement.
|
|
474
|
+
|
|
475
|
+
### Erreur: "ModuleNotFoundError"
|
|
476
|
+
|
|
477
|
+
Installez les dépendances :
|
|
478
|
+
|
|
479
|
+
```bash
|
|
480
|
+
pip install -r requirements.txt
|
|
481
|
+
```
|
|
482
|
+
|
|
483
|
+
### Les logs ne s'affichent pas
|
|
484
|
+
|
|
485
|
+
Le script utilise `log_print()` avec flush automatique. Si les logs ne s'affichent toujours pas, vérifiez que votre terminal supporte UTF-8.
|
|
486
|
+
|
|
487
|
+
### Analyse lente
|
|
488
|
+
|
|
489
|
+
Réduisez `BATCH_SIZE` ou augmentez `TIMEOUT_SECONDS` dans votre `.env`.
|
|
490
|
+
|
|
491
|
+
## 📄 Licence
|
|
492
|
+
|
|
493
|
+
Ce projet est fourni tel quel, sans garantie.
|
|
494
|
+
|
|
495
|
+
## 🤝 Contribution
|
|
496
|
+
|
|
497
|
+
Les contributions sont les bienvenues ! N'hésitez pas à ouvrir une issue ou une pull request.
|
|
498
|
+
|
|
499
|
+
## 📚 Ressources
|
|
500
|
+
|
|
501
|
+
- [Documentation Google Gemini](https://ai.google.dev/docs)
|
|
502
|
+
- [API OSV (Open Source Vulnerabilities)](https://osv.dev/)
|
|
503
|
+
- [Documentation pathspec](https://github.com/cpburnz/python-pathspec)
|