[GRASS-QA] GRASS QA: mmetz |r.univar_main.c globals.h stats.c r3.univar_main.c | 4 clones | 1 monsters |4 warnings

soccerlab.info at gmail.com soccerlab.info at gmail.com
Tue Nov 2 22:52:54 EDT 2010


Hello mmetz,

here's a report on your recent grass-SVN change for the revision : 43812 

ANALYSIS 

your changes to files/class/methods/functions : 

*****************************************************************
          File :/raster/r.univar/r.univar_main.c
*****************************************************************

          Function
process_raster(Begins at: 245, Ends at:365)
--------------+---------+-------+--------------+-----------+
              |          New Metrics           |Old Metrics|
--------------+---------+-------+--------------+-----------+
Complexity:   |      22 |    ** | BABY-MONSTER |        22 |
ParamNBR:     |       4 |     * |      WARNING |         4 |
CalledNBR:    |      22 |     * |      WARNING |        22 |
LOC:          |     121 |     * |      WARNING |       121 |
--------------+---------+-------+--------------+-----------+
Conclusion:   | this function is a  BABY-MONSTER           |
-----------------------------------------------------------+
 metric are OUT OF RANGE!


univar_stat_with_percentiles(Begins at: 222, Ends at:243)
--------------+---------+-------+--------------+-----------+
              |          New Metrics           |Old Metrics|
--------------+---------+-------+--------------+-----------+
Complexity:   |       5 |       |           OK |         5 |
ParamNBR:     |       1 |       |           OK |         1 |
CalledNBR:    |       2 |       |           OK |         2 |
LOC:          |      22 |       |           OK |        22 |
--------------+---------+-------+--------------+-----------+
Conclusion:   | this function is a            OK           |
-----------------------------------------------------------+
metrics are OK


set_params(Begins at: 27, Ends at:69)
--------------+---------+-------+--------------+-----------+
              |          New Metrics           |Old Metrics|
--------------+---------+-------+--------------+-----------+
Complexity:   |       1 |       |           OK |         1 |
ParamNBR:     |       0 |       |           OK |         0 |
CalledNBR:    |      15 |       |           OK |        15 |
LOC:          |      43 |       |           OK |        43 |
--------------+---------+-------+--------------+-----------+
Conclusion:   | this function is a            OK           |
-----------------------------------------------------------+
metrics are OK


open_raster(Begins at: 207, Ends at:220)
--------------+---------+-------+--------------+-----------+
              |          New Metrics           |Old Metrics|
--------------+---------+-------+--------------+-----------+
Complexity:   |       2 |       |           OK |         2 |
ParamNBR:     |       1 |       |           OK |         1 |
CalledNBR:    |       4 |       |           OK |         4 |
LOC:          |      14 |       |           OK |        14 |
--------------+---------+-------+--------------+-----------+
Conclusion:   | this function is a            OK           |
-----------------------------------------------------------+
metrics are OK


main(Begins at: 79, Ends at:205)
--------------+---------+-------+--------------+-----------+
              |          New Metrics           |Old Metrics|
--------------+---------+-------+--------------+-----------+
Complexity:   |      19 |    ** | BABY-MONSTER |        19 |
ParamNBR:     |       2 |       |           OK |         2 |
CalledNBR:    |      43 |    ** | BABY-MONSTER |        43 |
LOC:          |     127 |     * |      WARNING |       127 |
--------------+---------+-------+--------------+-----------+
Conclusion:   | this function is a  BABY-MONSTER           |
-----------------------------------------------------------+
 metric are OUT OF RANGE!


Clone analysis:
This file has 2 potentially cloned functions:
  set_params

In /data/project-manager/grass/grassSVN/grass/trunk/raster/r.univar/r.univar_main.c clones of univar_stat_with_percentiles are:
          /data/project-manager/grass/grassSVN/grass-addons/raster/r.univar.zonal/r.univar_main.c  univar_stat_with_percentiles

In /data/project-manager/grass/grassSVN/grass/trunk/raster/r.univar/r.univar_main.c clones of set_params are:
          /data/project-manager/grass/grassSVN/grass/trunk/raster/r.univar/r3.univar_main.c  set_params

*****************************************************************
          File :/raster/r.univar/globals.h
*****************************************************************

The system don't find class, method and function
 in this file during analysis!
*****************************************************************
          File :/raster/r.univar/stats.c
*****************************************************************

          Function
print_stats_table(Begins at: 298, Ends at:494)
--------------+---------+-------+--------------+-----------+
              |          New Metrics           |Old Metrics|
--------------+---------+-------+--------------+-----------+
Complexity:   |      24 |    ** | BABY-MONSTER |        24 |
ParamNBR:     |       1 |       |           OK |         1 |
CalledNBR:    |      56 |    ** | BABY-MONSTER |        56 |
LOC:          |     197 |    ** | BABY-MONSTER |       197 |
--------------+---------+-------+--------------+-----------+
Conclusion:   | this function is a  BABY-MONSTER           |
-----------------------------------------------------------+
 metric are OUT OF RANGE!


free_univar_stat_struct(Begins at: 77, Ends at:99)
--------------+---------+-------+--------------+-----------+
              |          New Metrics           |Old Metrics|
--------------+---------+-------+--------------+-----------+
Complexity:   |       7 |       |           OK |         7 |
ParamNBR:     |       1 |       |           OK |         1 |
CalledNBR:    |       5 |       |           OK |         5 |
LOC:          |      23 |       |           OK |        23 |
--------------+---------+-------+--------------+-----------+
Conclusion:   | this function is a            OK           |
-----------------------------------------------------------+
metrics are OK


print_stats(Begins at: 105, Ends at:296)
--------------+---------+-------+--------------+-----------+
              |          New Metrics           |Old Metrics|
--------------+---------+-------+--------------+-----------+
Complexity:   |      29 |    ** | BABY-MONSTER |        29 |
ParamNBR:     |       1 |       |           OK |         1 |
CalledNBR:    |      54 |    ** | BABY-MONSTER |        54 |
LOC:          |     192 |    ** | BABY-MONSTER |       192 |
--------------+---------+-------+--------------+-----------+
Conclusion:   | this function is a  BABY-MONSTER           |
-----------------------------------------------------------+
 metric are OUT OF RANGE!


create_univar_stat_struct(Begins at: 19, Ends at:71)
--------------+---------+-------+--------------+-----------+
              |          New Metrics           |Old Metrics|
--------------+---------+-------+--------------+-----------+
Complexity:   |       4 |       |           OK |         4 |
ParamNBR:     |       2 |       |           OK |         2 |
CalledNBR:    |       4 |       |           OK |         4 |
LOC:          |      53 |       |           OK |        53 |
--------------+---------+-------+--------------+-----------+
Conclusion:   | this function is a            OK           |
-----------------------------------------------------------+
metrics are OK


Clone analysis:
This file has 1 potentially cloned functions:


In /data/project-manager/grass/grassSVN/grass/trunk/raster/r.univar/stats.c clones of free_univar_stat_struct are:
          /data/project-manager/grass/grassSVN/grass-addons/raster/r.univar.zonal/stats.c  free_univar_stat_struct

*****************************************************************
          File :/raster/r.univar/r3.univar_main.c
*****************************************************************

          Function
main(Begins at: 76, Ends at:307)
--------------+---------+-------+--------------+-----------+
              |          New Metrics           |Old Metrics|
--------------+---------+-------+--------------+-----------+
Complexity:   |      43 |   *** |      MONSTER |        43 |
ParamNBR:     |       2 |       |           OK |         2 |
CalledNBR:    |      64 |    ** | BABY-MONSTER |        64 |
LOC:          |     232 |    ** | BABY-MONSTER |       232 |
--------------+---------+-------+--------------+-----------+
Conclusion:   | this function is a       MONSTER           |
-----------------------------------------------------------+
 metric are OUT OF RANGE!


set_params(Begins at: 28, Ends at:70)
--------------+---------+-------+--------------+-----------+
              |          New Metrics           |Old Metrics|
--------------+---------+-------+--------------+-----------+
Complexity:   |       1 |       |           OK |         1 |
ParamNBR:     |       0 |       |           OK |         0 |
CalledNBR:    |      15 |       |           OK |        15 |
LOC:          |      43 |       |           OK |        43 |
--------------+---------+-------+--------------+-----------+
Conclusion:   | this function is a            OK           |
-----------------------------------------------------------+
metrics are OK


Clone analysis:
This file has 1 potentially cloned functions:


In /data/project-manager/grass/grassSVN/grass/trunk/raster/r.univar/r3.univar_main.c clones of set_params are:
          /data/project-manager/grass/grassSVN/grass/trunk/raster/r.univar/r.univar_main.c  set_params

____________________________________________


Threshold grass key metrics values at Tue Nov 02 22:52:41 EDT 2010 are:
----------------------+-----------+-----------+-----------+
                      | warning   | middle    | extrem    |
                      | limits    | limits    | limits    |
----------------------+-----------+-----------+-----------+
Complexity (Cyclo):   |         9 |        19 |        30 |
ParamNBR:             |         3 |         6 |         9 |
CalledNBR:            |        18 |        43 |        69 |
LOC:                  |        67 |       151 |       235 |
----------------------+-----------+-----------+-----------+



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 
    -Global analysis: based on 21 metrics(the fourth preceding include)

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

Conclusion interpretation :
    CORRECT     : if all metrics are situated before warning limits
    WARNING     : if 1 to more metrics are between warning and middle limits
    BABY_MONSTER: if 1 to more metrics are between middle and extreme limits
    MONSTERS    : if 1 to more metrics are in the extreme limits


_______________________________________________
Brought to you by :
	SOftware Cost-effective Change and Evolution Research (SOCCER) laboratory 

Please visite our web site on your project at :
    http://web.soccerlab.polymtl.ca/project-manager/grass-website/index.html


More information about the grass-qa mailing list