8 Commits

Author SHA1 Message Date
abraham 913044b0fd rapport 2026-10-14 12:24:14 +02:00
abraham 4058ac1bc4 rapport 2026-10-14 12:20:54 +02:00
abraham bdc37a5c99 rapport 2026-10-14 12:01:24 +02:00
abraham 31b561e386 rapport 2026-10-14 12:00:22 +02:00
abraham 885e1128bf rapport 2026-10-14 11:51:57 +02:00
abraham 6292426e52 rapport 2026-10-14 11:50:31 +02:00
abraham 47cca9c323 rapport 2026-10-14 11:47:19 +02:00
Karl Framery 72e7e687c7 ajout des graphes manquants exo 1 2026-10-14 11:44:16 +02:00
7 changed files with 213 additions and 0 deletions
BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 62 KiB

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 31 KiB

+213
View File
@@ -0,0 +1,213 @@
Groupe :
- FRAMERY Karl
- ABRAHAM Ozvann
## 1. Dessiner le graphe
### C2
![C2](./C2.png)
### C4
![C4](./C4.png)
### P2
![P2](./P2.png)
### P3
![P3](./P3.png)
### J2
![J2](./J2.png)
### J6
![J6](./J6.png)
## 2. Compter les décisions
### J1-J6
- [ ] J1 = 1
- [ ] J2 = 2 + 1 = 3
- [ ] J3 = 7 + 1 = 8
- [ ] J4 = 8 + 1 = 9
- [ ] J5 = 10 + 1 = 11
- [ ] J6 = 8 + 1 = 9
### C1-C6
- [ ] C1 = 1
- [ ] C2 = 2 + 1 = 3
- [ ] C3 = 2 + 1 = 3
- [ ] C4 = 7 + 1 = 8
- [ ] C5 = 7 + 1 = 8
- [ ] C6 = 10 + 1 = 11
### P1-P5
- [ ] P1 = 1
- [ ] P2 = 2 + 1 = 3
- [ ] P3 = 2 + 1 = 3
- [ ] P4 = 2 + 1 = 3
- [ ] P5 = 13 + 1 = 14
### Complexité max : P5 = 14
## 3. Classer
- [ ] C1 -> <span style="color:blue"> simple </span>
- [ ] C2 -> <span style="color:blue"> simple </span>
- [ ] C3 -> <span style="color:blue"> simple </span>
- [ ] C4 -> <span style="color:yellow"> moyen </span>
- [ ] C5 -> <span style="color:yellow"> moyen </span>
- [ ] C6 -> <span style="color:red"> complexe </span>
- [ ] J1 -> <span style="color:blue"> simple </span>
- [ ] J2 -> <span style="color:blue"> simple </span>
- [ ] J3 -> <span style="color:red"> complexe </span>
- [ ] J4 -> <span style="color:red"> complexe </span>
- [ ] J5 -> <span style="color:red"> complexe </span>
- [ ] J6 -> <span style="color:red"> complexe </span>
- [ ] P1 -> <span style="color:blue"> simple </span>
- [ ] P2 -> <span style="color:blue"> simple </span>
- [ ] P3 -> <span style="color:yellow"> moyen </span>
- [ ] P4 -> <span style="color:yellow"> moyen </span>
- [ ] P5 -> <span style="color:red"> complexe </span>
## 4. Justifier les cas particuliers
### C3
```
return (annee % 4 == 0 && annee % 100 != 0) || annee % 400 == 0;
```
L'utilisation des <&&> et <||> sont nécessaire pour une compréhention plus simple du code, sans leurs utilisation le code aurait nécéssité des if / else randant le code plus long et moins compréhensible / lisible.
## 5. Refactoriser
### P5
```
def analyser_mot_de_passe(mdp, login=None):
problemes = []
if len(mdp) < 12:
problemes.append("trop court")
majuscule = minuscule = chiffre = special = False
for c in mdp:
if c.isupper():
majuscule = True
elif c.islower():
minuscule = True
elif c.isdigit():
chiffre = True
else:
special = True
if not (majuscule and minuscule):
problemes.append("mélanger majuscules et minuscules")
if not chiffre:
problemes.append("ajouter un chiffre")
if not special:
problemes.append("ajouter un caractère spécial")
if login and login.lower() in mdp.lower():
problemes.append("ne pas contenir le login")
for i in range(len(mdp) - 2):
if mdp[i] == mdp[i + 1] == mdp[i + 2]:
problemes.append("éviter 3 caractères identiques")
break
if not problemes:
return "fort", []
return ("moyen" if len(problemes) <= 2 else "faible"), problemes
```
Devien une fois transformé :
```
def analyser_mot_de_passe(mdp, login=None):
problemes = []
taille_mdp(mdp, problemes)
majuscule = caractere_majuscule
minuscule = caractere_minuscule
chiffre = caractere_chiffre
special = caractere_special
problemes(majuscule, minuscule, chiffre, special, login, mdp, problemes)
for i in range(len(mdp) - 2):
if mdp[i] == mdp[i + 1] == mdp[i + 2]:
problemes.append("éviter 3 caractères identiques")
break
if not problemes:
return "fort", []
return ("moyen" if len(problemes) <= 2 else "faible"), problemes
def problemes(majuscule, minuscule, chiffre, special, login=none, mdp, problemes[]):
if not (majuscule and minuscule):
problemes.append("mélanger majuscules et minuscules")
if not chiffre:
problemes.append("ajouter un chiffre")
if not special:
problemes.append("ajouter un caractère spécial")
if login and login.lower() in mdp.lower():
problemes.append("ne pas contenir le login")
def taille_mdp(mdp, problemes[]):
if len(mdp) < 12:
return problemes.append("trop court")
def caractere_majuscule(mdp):
majuscule = False
for c in mdp:
if c.isupper():
majuscule = True
return majuscule
def caractere_minuscule(mdp):
minuscule = False
for c in mdp:
if c.isupper():
minuscule = True
return minuscule
def caractere_chiffre(mdp):
chiffre = False
for c in mdp:
if c.isupper():
chiffre = True
return chiffre
def caractere_special(mdp):
special = False
for c in mdp:
if c.isupper():
special = True
return special
```
### Complexité max de analyser_mot_de_passe : P5 = 5
BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 47 KiB

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 42 KiB

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 82 KiB

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB