[GRASS-QA] GRASS QA: markus | ./grass6/lib/external/shapelib/dbfopen.c |3 clones ( dbfopen.c )| 0 monsters | 1 warnings

grass-qa at proxy.soccerlab.polymtl.ca grass-qa at proxy.soccerlab.polymtl.ca
Wed Sep 5 08:00:52 EDT 2007



Hello markus,

here a report on your recent GRASS-CVS change:

ANALYSIS

your changes to files/functions:


lib/external/shapelib/dbfopen.c functions


cvsid_aw (Begins at: 114 Ends at: 126)
--------------+---------+-------+---------+
Complexity:   |       1 |       |      OK |
ParamNBR:     |       0 |       |      OK |
CalledNBR:    |       1 |       |      OK |
LOC:          |      13 |       |      OK |
--------------+---------+-------+---------+
metrics are OK

SfRealloc (Begins at: 128 Ends at: 144)
--------------+---------+-------+---------+
Complexity:   |       2 |       |      OK |
ParamNBR:     |       2 |       |      OK |
CalledNBR:    |       2 |       |      OK |
LOC:          |      17 |       |      OK |
--------------+---------+-------+---------+
metrics are OK

DBFWriteHeader (Begins at: 146 Ends at: 196)
--------------+---------+-------+---------+
Complexity:   |       3 |       |      OK |
ParamNBR:     |       1 |       |      OK |
CalledNBR:    |       4 |       |      OK |
LOC:          |      51 |       |      OK |
--------------+---------+-------+---------+
metrics are OK

DBFFlushRecord (Begins at: 204 Ends at: 233)
--------------+---------+-------+---------+
Complexity:   |       3 |       |      OK |
ParamNBR:     |       1 |       |      OK |
CalledNBR:    |       3 |       |      OK |
LOC:          |      30 |       |      OK |
--------------+---------+-------+---------+
metrics are OK

DBFLoadRecord (Begins at: 239 Ends at: 282)
--------------+---------+-------+---------+
Complexity:   |       5 |       |      OK |
ParamNBR:     |       2 |       |      OK |
CalledNBR:    |       5 |       |      OK |
LOC:          |      44 |       |      OK |
--------------+---------+-------+---------+
metrics are OK

DBFUpdateHeader (Begins at: 289 Ends at: 311)
--------------+---------+-------+---------+
Complexity:   |       2 |       |      OK |
ParamNBR:     |       1 |       |      OK |
CalledNBR:    |       7 |       |      OK |
LOC:          |      23 |       |      OK |
--------------+---------+-------+---------+
metrics are OK

DBFOpen (Begins at: 320 Ends at: 460)
--------------+---------+-------+---------+
Complexity:   |      11 |       |      OK |
ParamNBR:     |       2 |       |      OK |
CalledNBR:    |      38 |     * |         |
LOC:          |     141 |     * |         |
--------------+---------+-------+---------+
metrics are OK

DBFClose (Begins at: 467 Ends at: 504)
--------------+---------+-------+---------+
Complexity:   |       5 |       |      OK |
ParamNBR:     |       1 |       |      OK |
CalledNBR:    |      12 |       |      OK |
LOC:          |      38 |       |      OK |
--------------+---------+-------+---------+
metrics are OK

DBFCreate (Begins at: 513 Ends at: 586)
--------------+---------+-------+---------+
Complexity:   |       4 |       |      OK |
ParamNBR:     |       1 |       |      OK |
CalledNBR:    |      14 |       |      OK |
LOC:          |      74 |       |      OK |
--------------+---------+-------+---------+
metrics are OK

DBFAddField (Begins at: 589 Ends at: 611)
--------------+---------+-------+---------+
Complexity:   |       3 |       |      OK |
ParamNBR:     |       5 |     * |         |
CalledNBR:    |       1 |       |      OK |
LOC:          |      23 |       |      OK |
--------------+---------+-------+---------+
metrics are OK

DBFAddNativeFieldType (Begins at: 614 Ends at: 701)
--------------+---------+-------+---------+
Complexity:   |       7 |       |      OK |
ParamNBR:     |       5 |     * |         |
CalledNBR:    |      10 |       |      OK |
LOC:          |      88 |       |      OK |
--------------+---------+-------+---------+
metrics are OK

DBFReadAttribute (Begins at: 709 Ends at: 788)
--------------+---------+-------+---------+
Complexity:   |      10 |       |      OK |
ParamNBR:     |       4 |       |      OK |
CalledNBR:    |       5 |       |      OK |
LOC:          |      80 |       |      OK |
--------------+---------+-------+---------+
metrics are OK

DBFReadIntegerAttribute (Begins at: 797 Ends at: 808)
--------------+---------+-------+---------+
Complexity:   |       2 |       |      OK |
ParamNBR:     |       3 |       |      OK |
CalledNBR:    |       1 |       |      OK |
LOC:          |      12 |       |      OK |
--------------+---------+-------+---------+
metrics are OK

DBFReadDoubleAttribute (Begins at: 817 Ends at: 828)
--------------+---------+-------+---------+
Complexity:   |       2 |       |      OK |
ParamNBR:     |       3 |       |      OK |
CalledNBR:    |       1 |       |      OK |
LOC:          |      12 |       |      OK |
--------------+---------+-------+---------+
metrics are OK

DBFReadStringAttribute (Begins at: 837 Ends at: 841)
--------------+---------+-------+---------+
Complexity:   |       1 |       |      OK |
ParamNBR:     |       3 |       |      OK |
CalledNBR:    |       1 |       |      OK |
LOC:          |       5 |       |      OK |
--------------+---------+-------+---------+
metrics are OK

DBFReadLogicalAttribute (Begins at: 850 Ends at: 862)
--------------+---------+-------+---------+
Complexity:   |       1 |       |      OK |
ParamNBR:     |       3 |       |      OK |
CalledNBR:    |       1 |       |      OK |
LOC:          |      13 |       |      OK |
--------------+---------+-------+---------+
metrics are OK

DBFIsAttributeNULL (Begins at: 865 Ends at: 907)
--------------+---------+-------+---------+
Complexity:   |      10 |       |      OK |
ParamNBR:     |       3 |       |      OK |
CalledNBR:    |       3 |       |      OK |
LOC:          |      43 |       |      OK |
--------------+---------+-------+---------+
metrics are OK

DBFGetFieldCount (Begins at: 916 Ends at: 920)
--------------+---------+-------+---------+
Complexity:   |       1 |       |      OK |
ParamNBR:     |       1 |       |      OK |
CalledNBR:    |       0 |       |      OK |
LOC:          |       5 |       |      OK |
--------------+---------+-------+---------+
metrics are OK

DBFGetRecordCount (Begins at: 929 Ends at: 933)
--------------+---------+-------+---------+
Complexity:   |       1 |       |      OK |
ParamNBR:     |       1 |       |      OK |
CalledNBR:    |       0 |       |      OK |
LOC:          |       5 |       |      OK |
--------------+---------+-------+---------+
metrics are OK

DBFGetFieldInfo (Begins at: 942 Ends at: 981)
--------------+---------+-------+---------+
Complexity:   |       8 |       |      OK |
ParamNBR:     |       5 |     * |         |
CalledNBR:    |       1 |       |      OK |
LOC:          |      40 |       |      OK |
--------------+---------+-------+---------+
metrics are OK

DBFWriteAttribute (Begins at: 989 Ends at: 1149)
--------------+---------+-------+---------+
Complexity:   |      26 |    ** | Warning |
ParamNBR:     |       4 |       |      OK |
CalledNBR:    |      21 |       |      OK |
LOC:          |     161 |     * |         |
--------------+---------+-------+---------+
at least 1 values are close to an outlier please consider revising code

DBFWriteAttributeDirectly (Begins at: 1152 Ends at: 1211)
--------------+---------+-------+---------+
Complexity:   |       7 |       |      OK |
ParamNBR:     |       4 |       |      OK |
CalledNBR:    |       7 |       |      OK |
LOC:          |      60 |       |      OK |
--------------+---------+-------+---------+
metrics are OK

DBFWriteDoubleAttribute (Begins at: 1220 Ends at: 1225)
--------------+---------+-------+---------+
Complexity:   |       1 |       |      OK |
ParamNBR:     |       4 |       |      OK |
CalledNBR:    |       1 |       |      OK |
LOC:          |       6 |       |      OK |
--------------+---------+-------+---------+
metrics are OK

DBFWriteIntegerAttribute (Begins at: 1234 Ends at: 1241)
--------------+---------+-------+---------+
Complexity:   |       1 |       |      OK |
ParamNBR:     |       4 |       |      OK |
CalledNBR:    |       1 |       |      OK |
LOC:          |       8 |       |      OK |
--------------+---------+-------+---------+
metrics are OK

DBFWriteStringAttribute (Begins at: 1250 Ends at: 1255)
--------------+---------+-------+---------+
Complexity:   |       1 |       |      OK |
ParamNBR:     |       4 |       |      OK |
CalledNBR:    |       1 |       |      OK |
LOC:          |       6 |       |      OK |
--------------+---------+-------+---------+
metrics are OK

DBFWriteNULLAttribute (Begins at: 1264 Ends at: 1268)
--------------+---------+-------+---------+
Complexity:   |       1 |       |      OK |
ParamNBR:     |       3 |       |      OK |
CalledNBR:    |       1 |       |      OK |
LOC:          |       5 |       |      OK |
--------------+---------+-------+---------+
metrics are OK

DBFWriteLogicalAttribute (Begins at: 1277 Ends at: 1282)
--------------+---------+-------+---------+
Complexity:   |       1 |       |      OK |
ParamNBR:     |       4 |       |      OK |
CalledNBR:    |       1 |       |      OK |
LOC:          |       6 |       |      OK |
--------------+---------+-------+---------+
metrics are OK

DBFWriteTuple (Begins at: 1291 Ends at: 1343)
--------------+---------+-------+---------+
Complexity:   |       6 |       |      OK |
ParamNBR:     |       3 |       |      OK |
CalledNBR:    |       4 |       |      OK |
LOC:          |      53 |       |      OK |
--------------+---------+-------+---------+
metrics are OK

DBFReadTuple (Begins at: 1346 Ends at: 1356)
--------------+---------+-------+---------+
Complexity:   |       3 |       |      OK |
ParamNBR:     |       2 |       |      OK |
CalledNBR:    |       1 |       |      OK |
LOC:          |      11 |       |      OK |
--------------+---------+-------+---------+
metrics are OK

DBFCloneEmpty (Begins at: 1365 Ends at: 1408)
--------------+---------+-------+---------+
Complexity:   |       2 |       |      OK |
ParamNBR:     |       2 |       |      OK |
CalledNBR:    |      14 |       |      OK |
LOC:          |      44 |       |      OK |
--------------+---------+-------+---------+
metrics are OK

DBFGetNativeFieldType (Begins at: 1411 Ends at: 1418)
--------------+---------+-------+---------+
Complexity:   |       2 |       |      OK |
ParamNBR:     |       2 |       |      OK |
CalledNBR:    |       0 |       |      OK |
LOC:          |       8 |       |      OK |
--------------+---------+-------+---------+
metrics are OK

str_to_upper (Begins at: 1424 Ends at: 1442)
--------------+---------+-------+---------+
Complexity:   |       3 |       |      OK |
ParamNBR:     |       1 |       |      OK |
CalledNBR:    |       4 |       |      OK |
LOC:          |      19 |       |      OK |
--------------+---------+-------+---------+
metrics are OK

DBFGetFieldIndex (Begins at: 1445 Ends at: 1472)
--------------+---------+-------+---------+
Complexity:   |       2 |       |      OK |
ParamNBR:     |       2 |       |      OK |
CalledNBR:    |       7 |       |      OK |
LOC:          |      28 |       |      OK |
--------------+---------+-------+---------+
metrics are OK

DBFIsRecordDeleted (Begins at: 1474 Ends at: 1493)
--------------+---------+-------+---------+
Complexity:   |       3 |       |      OK |
ParamNBR:     |       2 |       |      OK |
CalledNBR:    |       1 |       |      OK |
LOC:          |      20 |       |      OK |
--------------+---------+-------+---------+
metrics are OK

DBFMarkRecordDeleted (Begins at: 1499 Ends at: 1534)
--------------+---------+-------+---------+
Complexity:   |       5 |       |      OK |
ParamNBR:     |       3 |       |      OK |
CalledNBR:    |       1 |       |      OK |
LOC:          |      36 |       |      OK |
--------------+---------+-------+---------+
metrics are OK

Clone analysis:

This file has 3 potentially cloned functions:
  DBFWriteIntegerAttribute  DBFReadDoubleAttribute  DBFReadIntegerAttribute

In lib/external/shapelib/dbfopen.c clones of  DBFReadDoubleAttribute are:
	lib/external/shapelib/dbfopen.c  DBFReadIntegerAttribute

In lib/external/shapelib/dbfopen.c clones of  DBFWriteIntegerAttribute are:
	lib/g3d/g3dwindow.c  G3d_getDouble

In lib/external/shapelib/dbfopen.c clones of  DBFReadIntegerAttribute are:
	lib/external/shapelib/dbfopen.c  DBFReadDoubleAttribute


__________________________________________

Threshold GRASS6 key metrics values at 2007-09-05 are:
---------------------------+-----------+---------+
                    median | upper     | outlier |
                           | quartile  | limit   |
---------------------------+-----------+---------+
Complexity (Cyclo):      5 |        25 |      37 |
ParamNBR:                2 |         6 |       9 |
CalledNBR:              10 |        60 |      88 |
LOC:                    43 |       195 |     273 |
---------------------------+-----------+---------+

Measures (see below Web page for details):
 Complexity (Cyclo): a complexity index
 ParamNBR: number of passed parameters
 CalledNBR: number of called functions
 LOC: Lines Of Code

Message interpretation:
 OK : Nothing to say at all
 *  : above 75 % of value warning
 ** : this is getting close to be out of range, consider revising the code
 ***: this is a monster, definitely you should revise this function


__________________________________________
Brought to you by:
SOftware Cost-effective Change and Evolution Research (SOCCER) laboratory
http://web.soccerlab.polymtl.ca/grass-evolution/grass-browsers/grass-index-en.html




More information about the grass-qa mailing list