forked from menault/TD2_DEV51_Qualite_Algo
43 lines
1.0 KiB
Markdown
43 lines
1.0 KiB
Markdown
|
Auteurs : Aurélien Amary, Adrien Dick
|
||
|
|
||
|
# TP2 Conplexité cyclomatique
|
||
|
*Complexité cyclomatique as CC*
|
||
|
## Calcul du nombre de chemins pour chaque fonction
|
||
|
### daemon
|
||
|
- create_daemon ; CC = 4
|
||
|
- ping_request ; CC = 2
|
||
|
- send_check ; CC = 3
|
||
|
- check_keep_working ; CC = 4
|
||
|
- daemon_work ; CC = 3
|
||
|
|
||
|
### db-sqlite
|
||
|
- db_connect ; CC = 1
|
||
|
- db_disconnect ; CC = 1
|
||
|
- insert_hourly_report ; CC = 1
|
||
|
|
||
|
### ping-report
|
||
|
- main ; CC = 4
|
||
|
|
||
|
### stats
|
||
|
- get_ping_from_temp_log ; CC = 15 (voir graphe)
|
||
|
- write_ping_log ; CC = 4
|
||
|
- set_stats_ping ; CC = 25 (voir graphe)
|
||
|
|
||
|
### utils
|
||
|
- write_pid_file ; CC = 2
|
||
|
- remove_file ; C = 1
|
||
|
|
||
|
## Simplification du code
|
||
|
*Commentaire "Modif" aux endroits modifiés*
|
||
|
### get_ping_from_temp_lo
|
||
|
Factorisation du while en une sous fonction : sub_get_ping_from_temp_log \
|
||
|
Résultat :
|
||
|
- get_ping_from_temp_log ; CC = 7
|
||
|
- sub_get_ping_from_temp_log ; CC = 4
|
||
|
|
||
|
### set_stats_ping
|
||
|
Factorisation des trois derniers "if" du while en une sous fonction : sub_set_stats_ping \
|
||
|
Résultat :
|
||
|
- set_stats_ping ; CC = 9
|
||
|
- sub_set_stats_ping ; CC = 8
|