Project

General

Profile

Actions

Bug #802

closed

Analyse Logiscope LFR_3.1.0.4 : rule Tr_Accolades Severity is High

Added by William Recart over 7 years ago. Updated over 5 years ago.

Status:
Closed
Priority:
Low
Assignee:
Category:
-
Target version:
-
Start date:
19/10/2016
Due date:
% Done:

0%

Estimated time:
revision:
r0

Description

Rappel de la règle :
Tr_Accolades
Definition:
-----------
Block statements shall always be used in control statements (if , for , while , do).

Justification:
--------------
Removes ambiguity about the scope of instructions and makes the code easier to read
and to modify.

Example:
--------

// do not write
if (x 0) return;
else
while (x > min)
x--;

// write
if (x 0) {
return;
} else {
while (x > min) {
x--;
}
}

La règle n'est pas respectée dans 38 cas d'après Logiscope:
Fichier avf0_prc0.c : lignes 119, 132, 225, 234, 391, 396
Fichier avf1_prc1.c : lignes 120, 133, 226, 381
Fichier fsw_init.c : lignes 788, 792, 796
Fichier fsw_processing.c : ligne 565
Fichier fsw_processing.h : lignes 222, 227, 251, 256
Fichier fsw_spacewire.c : lignes 274, 278, 282, 286, 290, 294, 303, 975
Fichier lfr_cpu_usage_report.c : ligne 53
Fichier tc_acceptance.c : ligne 463
Fichier tc_handler.c : ligne 1585
Fichier tc_load_dump_parameters.c : lignes 1028, 1330, 1337
Fichier wf_handler.c : lignes 127, 199, 223, 248, 475, 1277

Actions #1

Updated by William Recart over 7 years ago

  • Subject changed from Analyse Logiscope LFR_3.1.0.4 : rule Tr_Accolades to Analyse Logiscope LFR_3.1.0.4 : rule Tr_Accolades Severity is High
Actions #2

Updated by William Recart over 7 years ago

After analysis, it appears that a lot violation are due to use of syntax “else if” instead of “elesif”. Brace are correctly used:
else if {

}

1 error remains on file:
lfr_cpu_usage_report.c line 53

Actions #3

Updated by paul leroy about 7 years ago

  • Status changed from New to Resolved
  • Priority changed from Normal to Low

D'accord avec ton analyse, j'ai regardé les premières erreurs levées et effectivement, ça correspond à des "else if".
J'ai ajouté les brackets pour la ligne 53 dans lfr_cpu_usage_report

Actions #4

Updated by William Recart about 7 years ago

  • Status changed from Resolved to Closed

Vérification effectuée sur le tag 322 (c0603702c8c8) , il reste en erreur uniquement des faux positifs dues à la syntaxe "else if" :
avf0_prc0.c : lignes 119, 132, 233, 242, 400, 405
avf1_prc1.c : lignes 120, 133, 234, 390
fsw_init.c : lignes 793, 797, 801
fsw_processing.c : ligne 574
fsw_processing.h : lignes 226, 231, 255, 260
fsw_spacewire.c : lignes 284, 288, 292, 296, 300, 304, 313, 1007
tc_acceptance.c : lignes 470
tc_handler.c : lignes 1606
tc_load_dump_parameters.c : lignes 1355, 1362
wf_handler.c : lignes 127, 198, 222, 247, 483, 1306

Tout le reste est clos sur la version tag 322 (c0603702c8c8)

Actions #5

Updated by William Recart almost 7 years ago

Satus on FSW V3.2.0.15 : 36 wrong positives raised by Logiscope :
- avf0_prc0.c : lines119, 132, 233, 242, 400, 405;
- avf1_prc1.c : lines 120, 133, 234, 390
- fsw_init.c : lines 822, 826, 830
- fsw_processing.c : line 574
- fsw_processing.h : lines 228, 233, 257, 262
- fsw_spacewire.c : lines 284, 288, 292, 296, 300, 304, 313, 1009
- tc_acceptance.c : line 470
- tc_handler.c : line 1616
- tc_load_dump_parameters.c : lines 1730, 1737
- wf_handler.c : lines 127, 198, 222, 247, 483, 1306
=> all wrong positives due to use of syntax "else if"

Actions #6

Updated by William Recart over 5 years ago

Satus on FSW V3.2.0.21: 37 wrong positives raised by Logiscope :
- avf0_prc0.c : lines 143, 156, 257, 266, 424, 429;
- avf1_prc1.c : lines 144, 157, 258, 414:
- fsw_init.c : lines 858, 862, 866
- fsw_processing.c : line 598
- fsw_processing.h : lines 219, 224, 248, 253
- fsw_spacewire.c : lines 308, 312, 316, 320, 324, 328, 337, 999
- lfr_cpu_usage_report.c : line 54
- tc_acceptance.c : line 493
- tc_handler.c : line 1639
- tc_load_dump_parameters.c : lines 1750, 1757
- wf_handler.c : lines 151, 222, 247, 272, 508, 1328
=> all wrong positives due to use of syntax "else if"

Actions

Also available in: Atom PDF