Browse Source

Improved export and info tools.

avkonst 11 years ago
parent
commit
f01017561a
32 changed files with 137 additions and 71 deletions
  1. 7 3
      mainline/metrixpp.py
  2. 2 2
      mainline/tests/general/test_basic/test_export_format_export_nest_per_file_stdout.gold.txt
  3. 2 2
      mainline/tests/general/test_basic/test_export_format_export_nest_stdout.gold.txt
  4. 1 1
      mainline/tests/general/test_basic/test_export_format_export_python_stdout.gold.txt
  5. 4 1
      mainline/tests/general/test_basic/test_export_format_export_txt_stdout.gold.txt
  6. 3 3
      mainline/tests/general/test_basic/test_export_format_export_xml_stdout.gold.txt
  7. 2 0
      mainline/tests/general/test_basic/test_help_collect_default_stdout.gold.txt
  8. 5 0
      mainline/tests/general/test_basic/test_help_limit_default_stdout.gold.txt
  9. 1 1
      mainline/tests/general/test_basic/test_workflow_collect_default_stderr.gold.txt
  10. 1 1
      mainline/tests/general/test_basic/test_workflow_collect_second_stderr.gold.txt
  11. 1 1
      mainline/tests/general/test_basic/test_workflow_export_default_stderr.gold.txt
  12. 3 3
      mainline/tests/general/test_basic/test_workflow_export_default_stdout.gold.txt
  13. 1 1
      mainline/tests/general/test_basic/test_workflow_export_second_per_file_stderr.gold.txt
  14. 2 2
      mainline/tests/general/test_basic/test_workflow_export_second_per_file_stdout.gold.txt
  15. 1 1
      mainline/tests/general/test_basic/test_workflow_export_second_stderr.gold.txt
  16. 2 2
      mainline/tests/general/test_basic/test_workflow_export_second_stdout.gold.txt
  17. 1 1
      mainline/tests/general/test_basic/test_workflow_info_default_stderr.gold.txt
  18. 4 4
      mainline/tests/general/test_basic/test_workflow_info_default_stdout.gold.txt
  19. 1 1
      mainline/tests/general/test_basic/test_workflow_info_second_stderr.gold.txt
  20. 4 4
      mainline/tests/general/test_basic/test_workflow_info_second_stdout.gold.txt
  21. 1 1
      mainline/tests/general/test_basic/test_workflow_limit_default_stderr.gold.txt
  22. 1 1
      mainline/tests/general/test_basic/test_workflow_limit_second_stderr.gold.txt
  23. 1 1
      mainline/tests/general/test_basic/test_workflow_limit_second_warn_all_stderr.gold.txt
  24. 1 1
      mainline/tests/general/test_basic/test_workflow_limit_second_warn_new_stderr.gold.txt
  25. 1 1
      mainline/tests/general/test_basic/test_workflow_limit_second_warn_touched_stderr.gold.txt
  26. 1 1
      mainline/tests/general/test_basic/test_workflow_limit_second_warn_trend_stderr.gold.txt
  27. 4 4
      mainline/tests/general/test_std_code_cpp/test_parser_export_default_stdout.gold.txt
  28. 23 5
      mainline/tests/general/test_std_code_cpp/test_parser_export_files_stdout.gold.txt
  29. 8 8
      mainline/tests/general/test_std_code_cs/test_parser_export_default_stdout.gold.txt
  30. 18 3
      mainline/tests/general/test_std_code_cs/test_parser_export_files_stdout.gold.txt
  31. 7 7
      mainline/tests/general/test_std_code_java/test_parser_export_default_stdout.gold.txt
  32. 23 4
      mainline/tests/general/test_std_code_java/test_parser_export_files_stdout.gold.txt

+ 7 - 3
mainline/metrixpp.py

@@ -53,8 +53,8 @@ def main():
         
     if command not in available_tools:
         logging.error("Unknown action: " + str(command))
-        print "Usage: %prog <action> --help"
-        print "   or: %prog <action> [options] -- [path 1] ... [path N]"
+        print "Usage: {prog} <action> --help".format(prog=__file__)
+        print "   or: {prog} <action> [options] -- [path 1] ... [path N]".format(prog=__file__)
         print "where: actions are:"
         for each in available_tools:
             print "\t" + each
@@ -71,5 +71,9 @@ if __name__ == '__main__':
     ts = time.time()
     core.log.set_default_format()
     exit_code = main()
-    logging.warning("Exit code: " + str(exit_code) + ". Time spent: " + str(round((time.time() - ts), 2)) + " seconds. Done")
+    time_spent = round((time.time() - ts), 2)
+    if 'METRIXPLUSPLUS_TEST_GENERATE_GOLDS' in os.environ.keys() and \
+        os.environ['METRIXPLUSPLUS_TEST_GENERATE_GOLDS'] == "True":
+        time_spent = 1 # Constant value if under tests
+    logging.warning("Exit code: " + str(exit_code) + ". Time spent: " + str(time_spent) + " seconds. Done")
     exit(exit_code)

+ 2 - 2
mainline/tests/general/test_basic/test_export_format_export_nest_per_file_stdout.gold.txt

@@ -92,14 +92,14 @@
         </subdirs>
         <aggregated-data>
             <std.code.complexity>
-                <cyclomatic total="8.0" max="3" avg="1.33333333333" min="0">
+                <cyclomatic count="6" max="3" avg="1.33333333333" total="8.0" min="0">
                     <distribution-bars>
                         <distribution-bar count="1" __diff__="0" metric="0" />
                         <distribution-bar count="3" __diff__="0" metric="1" />
                         <distribution-bar count="1" __diff__="0" metric="2" />
                         <distribution-bar count="1" __diff__="0" metric="3" />
                     </distribution-bars>
-                    <__diff__ max="0" total="2.0" avg="-0.166666666667" min="-1" />
+                    <__diff__ count="2" max="0" avg="-0.166666666667" total="2.0" min="-1" />
                 </cyclomatic>
             </std.code.complexity>
         </aggregated-data>

+ 2 - 2
mainline/tests/general/test_basic/test_export_format_export_nest_stdout.gold.txt

@@ -10,14 +10,14 @@
         </subdirs>
         <aggregated-data>
             <std.code.complexity>
-                <cyclomatic total="11.0" max="3" avg="1.57142857143" min="0">
+                <cyclomatic count="7" max="3" avg="1.57142857143" total="11.0" min="0">
                     <distribution-bars>
                         <distribution-bar count="1" __diff__="0" metric="0" />
                         <distribution-bar count="3" __diff__="0" metric="1" />
                         <distribution-bar count="1" __diff__="0" metric="2" />
                         <distribution-bar count="2" __diff__="1" metric="3" />
                     </distribution-bars>
-                    <__diff__ max="0" total="5.0" avg="0.0714285714286" min="-1" />
+                    <__diff__ count="3" max="0" avg="0.0714285714286" total="5.0" min="-1" />
                 </cyclomatic>
             </std.code.complexity>
         </aggregated-data>

+ 1 - 1
mainline/tests/general/test_basic/test_export_format_export_python_stdout.gold.txt

@@ -1 +1 @@
-{'export': [{'data: {'info': {'path': '', 'id': 1}, 'file-data': {}, 'subfiles': [], 'subdirs': [u'.'], 'aggregated-data': {'std.code.complexity': {'cyclomatic': {'total': 6.0, 'max': 3, 'avg': 1.5, 'distribution-bars': [{'count': 3, 'metric': 1}, {'count': 1, 'metric': 3}], 'min': 1}}}}}]}
+{'export': [{'data: {'info': {'path': '', 'id': 1}, 'file-data': {}, 'subfiles': [], 'subdirs': [u'.'], 'aggregated-data': {'std.code.complexity': {'cyclomatic': {'count': 4, 'distribution-bars': [{'count': 3, 'metric': 1, 'ratio': 0.75}, {'count': 1, 'metric': 3, 'ratio': 0.25}], 'avg': 1.5, 'min': 1, 'max': 3, 'total': 6.0}}}}}]}

+ 4 - 1
mainline/tests/general/test_basic/test_export_format_export_txt_stdout.gold.txt

@@ -14,19 +14,22 @@ data:
 .   aggregated-data:  
 .   .   std.code.complexity:  
 .   .   .   cyclomatic: 
+.   .   .   .   count="4"
 .   .   .   .   max="3"
-.   .   .   .   total="6.0"
 .   .   .   .   avg="1.5"
+.   .   .   .   total="6.0"
 .   .   .   .   min="1" 
 .   .   .   .   distribution-bars:
 .   .   .   .   
 .   .   .   .   .   distribution-bar: 
 .   .   .   .   .   .   count="3"
 .   .   .   .   .   .   metric="1"
+.   .   .   .   .   .   ratio="0.75"
 .   .   .   .   
 .   .   .   .   .   distribution-bar: 
 .   .   .   .   .   .   count="1"
 .   .   .   .   .   .   metric="3"
+.   .   .   .   .   .   ratio="0.25"
 ================================================================================
 
 

+ 3 - 3
mainline/tests/general/test_basic/test_export_format_export_xml_stdout.gold.txt

@@ -10,10 +10,10 @@
         </subdirs>
         <aggregated-data>
             <std.code.complexity>
-                <cyclomatic max="3" total="6.0" avg="1.5" min="1">
+                <cyclomatic count="4" max="3" avg="1.5" total="6.0" min="1">
                     <distribution-bars>
-                        <distribution-bar count="3" metric="1" />
-                        <distribution-bar count="1" metric="3" />
+                        <distribution-bar count="3" metric="1" ratio="0.75" />
+                        <distribution-bar count="1" metric="3" ratio="0.25" />
                     </distribution-bars>
                 </cyclomatic>
             </std.code.complexity>

+ 2 - 0
mainline/tests/general/test_basic/test_help_collect_default_stdout.gold.txt

@@ -24,6 +24,8 @@ Options:
   --general.procerrors-on
                         If the option is set (True), the tool counts number of
                         processing/parsing errors per file [default: False]
+  --general.size-on     If the option is set (True), the tool collects file
+                        size metric (in bytes) [default: False]
   --general.log-level=GENERAL.LOG_LEVEL
                         Defines log level. Possible values are
                         'DEBUG','INFO','WARNING' or 'ERROR'. Default value is

+ 5 - 0
mainline/tests/general/test_basic/test_help_limit_default_stdout.gold.txt

@@ -39,3 +39,8 @@ Options:
                         limits. Should be in the format: <namespace>:<field
                         >:<limit-value>, for example:
                         'std.code.complexity:cyclomatic:7'.
+  --general.hotspots=GENERAL.HOTSPOTS
+                        If not set (none), all exceeded limits are printed. If
+                        set, exceeded limits are sorted (the worst is the
+                        first) and only first GENERAL.HOTSPOTS limits are
+                        printed. [default: none]

+ 1 - 1
mainline/tests/general/test_basic/test_workflow_collect_default_stderr.gold.txt

@@ -2,4 +2,4 @@
 [LOG]: INFO:	Excluding: ./.unused.cpp
 [LOG]: INFO:	Skipping: ./dummy.txt
 [LOG]: INFO:	Processing: ./simple.cpp
-[LOG]: WARNING:	Exit code: 0. Time spent: 2.47 seconds. Done
+[LOG]: WARNING:	Exit code: 0. Time spent: 1 seconds. Done

+ 1 - 1
mainline/tests/general/test_basic/test_workflow_collect_second_stderr.gold.txt

@@ -2,4 +2,4 @@
 [LOG]: INFO:	Excluding: ./.unused.cpp
 [LOG]: INFO:	Processing: ./simple.cpp
 [LOG]: INFO:	Processing: ./simple2.cpp
-[LOG]: WARNING:	Exit code: 0. Time spent: 0.26 seconds. Done
+[LOG]: WARNING:	Exit code: 0. Time spent: 1 seconds. Done

+ 1 - 1
mainline/tests/general/test_basic/test_workflow_export_default_stderr.gold.txt

@@ -1,3 +1,3 @@
 [LOG]: WARNING:	Logging enabled with INFO level
 [LOG]: INFO:	Processing: 
-[LOG]: WARNING:	Exit code: 0. Time spent: 0.11 seconds. Done
+[LOG]: WARNING:	Exit code: 0. Time spent: 1 seconds. Done

+ 3 - 3
mainline/tests/general/test_basic/test_workflow_export_default_stdout.gold.txt

@@ -10,10 +10,10 @@
         </subdirs>
         <aggregated-data>
             <std.code.complexity>
-                <cyclomatic max="3" total="6.0" avg="1.5" min="1">
+                <cyclomatic count="4" max="3" avg="1.5" total="6.0" min="1">
                     <distribution-bars>
-                        <distribution-bar count="3" metric="1" />
-                        <distribution-bar count="1" metric="3" />
+                        <distribution-bar count="3" metric="1" ratio="0.75" />
+                        <distribution-bar count="1" metric="3" ratio="0.25" />
                     </distribution-bars>
                 </cyclomatic>
             </std.code.complexity>

+ 1 - 1
mainline/tests/general/test_basic/test_workflow_export_second_per_file_stderr.gold.txt

@@ -1,3 +1,3 @@
 [LOG]: WARNING:	Logging enabled with INFO level
 [LOG]: INFO:	Processing: ./simple.cpp
-[LOG]: WARNING:	Exit code: 0. Time spent: 0.14 seconds. Done
+[LOG]: WARNING:	Exit code: 0. Time spent: 1 seconds. Done

+ 2 - 2
mainline/tests/general/test_basic/test_workflow_export_second_per_file_stdout.gold.txt

@@ -72,14 +72,14 @@
         </subdirs>
         <aggregated-data>
             <std.code.complexity>
-                <cyclomatic total="8.0" max="3" avg="1.33333333333" min="0">
+                <cyclomatic count="6" max="3" avg="1.33333333333" total="8.0" min="0">
                     <distribution-bars>
                         <distribution-bar count="1" __diff__="0" metric="0" />
                         <distribution-bar count="3" __diff__="0" metric="1" />
                         <distribution-bar count="1" __diff__="0" metric="2" />
                         <distribution-bar count="1" __diff__="0" metric="3" />
                     </distribution-bars>
-                    <__diff__ max="0" total="2.0" avg="-0.166666666667" min="-1" />
+                    <__diff__ count="2" max="0" avg="-0.166666666667" total="2.0" min="-1" />
                 </cyclomatic>
             </std.code.complexity>
         </aggregated-data>

+ 1 - 1
mainline/tests/general/test_basic/test_workflow_export_second_stderr.gold.txt

@@ -1,3 +1,3 @@
 [LOG]: WARNING:	Logging enabled with INFO level
 [LOG]: INFO:	Processing: 
-[LOG]: WARNING:	Exit code: 0. Time spent: 0.12 seconds. Done
+[LOG]: WARNING:	Exit code: 0. Time spent: 1 seconds. Done

+ 2 - 2
mainline/tests/general/test_basic/test_workflow_export_second_stdout.gold.txt

@@ -10,14 +10,14 @@
         </subdirs>
         <aggregated-data>
             <std.code.complexity>
-                <cyclomatic total="11.0" max="3" avg="1.57142857143" min="0">
+                <cyclomatic count="7" max="3" avg="1.57142857143" total="11.0" min="0">
                     <distribution-bars>
                         <distribution-bar count="1" __diff__="0" metric="0" />
                         <distribution-bar count="3" __diff__="0" metric="1" />
                         <distribution-bar count="1" __diff__="0" metric="2" />
                         <distribution-bar count="2" __diff__="1" metric="3" />
                     </distribution-bars>
-                    <__diff__ max="0" total="5.0" avg="0.0714285714286" min="-1" />
+                    <__diff__ count="3" max="0" avg="0.0714285714286" total="5.0" min="-1" />
                 </cyclomatic>
             </std.code.complexity>
         </aggregated-data>

+ 1 - 1
mainline/tests/general/test_basic/test_workflow_info_default_stderr.gold.txt

@@ -1,2 +1,2 @@
 [LOG]: WARNING:	Logging enabled with INFO level
-[LOG]: WARNING:	Exit code: 0. Time spent: 0.09 seconds. Done
+[LOG]: WARNING:	Exit code: 0. Time spent: 1 seconds. Done

+ 4 - 4
mainline/tests/general/test_basic/test_workflow_info_default_stdout.gold.txt

@@ -8,9 +8,9 @@ Properties:
 	std.code.cs:files	=>	*.cs
 	std.code.java:version	=>	1.1
 	std.code.java:files	=>	*.java
-Namespaces:
-	std.code.complexity
-		- cyclomatic
-	general
+
+Metrics:
+	std.code.complexity:cyclomatic
+
 Files:
 	./simple.cpp

+ 1 - 1
mainline/tests/general/test_basic/test_workflow_info_second_stderr.gold.txt

@@ -1,2 +1,2 @@
 [LOG]: WARNING:	Logging enabled with INFO level
-[LOG]: WARNING:	Exit code: 0. Time spent: 0.11 seconds. Done
+[LOG]: WARNING:	Exit code: 0. Time spent: 1 seconds. Done

+ 4 - 4
mainline/tests/general/test_basic/test_workflow_info_second_stdout.gold.txt

@@ -8,10 +8,10 @@ Properties:
 	std.code.cs:files	=>	*.cs
 	std.code.java:version	=>	1.1
 	std.code.java:files	=>	*.java
-Namespaces:
-	std.code.complexity
-		- cyclomatic
-	general
+
+Metrics:
+	std.code.complexity:cyclomatic
+
 Files:
 (!) 	./simple.cpp [modified]
 (!) 	./simple2.cpp [new]

+ 1 - 1
mainline/tests/general/test_basic/test_workflow_limit_default_stderr.gold.txt

@@ -1,4 +1,4 @@
 [LOG]: WARNING:	Logging enabled with INFO level
 [LOG]: INFO:	Processing: 
 [LOG]: INFO:	Applying limit: namespace 'std.code.complexity', filter '('cyclomatic', '>', 0.0)'
-[LOG]: WARNING:	Exit code: 4. Time spent: 0.11 seconds. Done
+[LOG]: WARNING:	Exit code: 4. Time spent: 1 seconds. Done

+ 1 - 1
mainline/tests/general/test_basic/test_workflow_limit_second_stderr.gold.txt

@@ -1,4 +1,4 @@
 [LOG]: WARNING:	Logging enabled with INFO level
 [LOG]: INFO:	Processing: 
 [LOG]: INFO:	Applying limit: namespace 'std.code.complexity', filter '('cyclomatic', '>', 0.0)'
-[LOG]: WARNING:	Exit code: 6. Time spent: 0.13 seconds. Done
+[LOG]: WARNING:	Exit code: 6. Time spent: 1 seconds. Done

+ 1 - 1
mainline/tests/general/test_basic/test_workflow_limit_second_warn_all_stderr.gold.txt

@@ -1,4 +1,4 @@
 [LOG]: WARNING:	Logging enabled with INFO level
 [LOG]: INFO:	Processing: 
 [LOG]: INFO:	Applying limit: namespace 'std.code.complexity', filter '('cyclomatic', '>', 0.0)'
-[LOG]: WARNING:	Exit code: 6. Time spent: 0.12 seconds. Done
+[LOG]: WARNING:	Exit code: 6. Time spent: 1 seconds. Done

+ 1 - 1
mainline/tests/general/test_basic/test_workflow_limit_second_warn_new_stderr.gold.txt

@@ -2,4 +2,4 @@
 [LOG]: INFO:	Identifying changed files...
 [LOG]: INFO:	Processing: 
 [LOG]: INFO:	Applying limit: namespace 'std.code.complexity', filter '('cyclomatic', '>', 0.0)'
-[LOG]: WARNING:	Exit code: 2. Time spent: 0.13 seconds. Done
+[LOG]: WARNING:	Exit code: 2. Time spent: 1 seconds. Done

+ 1 - 1
mainline/tests/general/test_basic/test_workflow_limit_second_warn_touched_stderr.gold.txt

@@ -2,4 +2,4 @@
 [LOG]: INFO:	Identifying changed files...
 [LOG]: INFO:	Processing: 
 [LOG]: INFO:	Applying limit: namespace 'std.code.complexity', filter '('cyclomatic', '>', 0.0)'
-[LOG]: WARNING:	Exit code: 4. Time spent: 0.12 seconds. Done
+[LOG]: WARNING:	Exit code: 4. Time spent: 1 seconds. Done

+ 1 - 1
mainline/tests/general/test_basic/test_workflow_limit_second_warn_trend_stderr.gold.txt

@@ -2,4 +2,4 @@
 [LOG]: INFO:	Identifying changed files...
 [LOG]: INFO:	Processing: 
 [LOG]: INFO:	Applying limit: namespace 'std.code.complexity', filter '('cyclomatic', '>', 0.0)'
-[LOG]: WARNING:	Exit code: 3. Time spent: 0.12 seconds. Done
+[LOG]: WARNING:	Exit code: 3. Time spent: 1 seconds. Done

+ 4 - 4
mainline/tests/general/test_std_code_cpp/test_parser_export_default_stdout.gold.txt

@@ -10,11 +10,11 @@
         </subdirs>
         <aggregated-data>
             <std.code.complexity>
-                <cyclomatic max="2" total="17.0" avg="0.197674418605" min="0">
+                <cyclomatic count="86" max="2" avg="0.197674418605" total="17.0" min="0">
                     <distribution-bars>
-                        <distribution-bar count="74" metric="0" />
-                        <distribution-bar count="7" metric="1" />
-                        <distribution-bar count="5" metric="2" />
+                        <distribution-bar count="74" metric="0" ratio="0.8605" />
+                        <distribution-bar count="7" metric="1" ratio="0.0814" />
+                        <distribution-bar count="5" metric="2" ratio="0.0581" />
                     </distribution-bars>
                 </cyclomatic>
             </std.code.complexity>

+ 23 - 5
mainline/tests/general/test_std_code_cpp/test_parser_export_files_stdout.gold.txt

@@ -86,15 +86,17 @@ data:
 .   aggregated-data:  
 .   .   std.code.complexity:  
 .   .   .   cyclomatic: 
+.   .   .   .   count="3"
 .   .   .   .   max="0"
-.   .   .   .   total="0.0"
 .   .   .   .   avg="0.0"
+.   .   .   .   total="0.0"
 .   .   .   .   min="0" 
 .   .   .   .   distribution-bars:
 .   .   .   .   
 .   .   .   .   .   distribution-bar: 
 .   .   .   .   .   .   count="3"
 .   .   .   .   .   .   metric="0"
+.   .   .   .   .   .   ratio="1.0"
 ================================================================================
 --------------------------------------------------------------------------------
 data:  
@@ -804,23 +806,27 @@ data:
 .   aggregated-data:  
 .   .   std.code.complexity:  
 .   .   .   cyclomatic: 
+.   .   .   .   count="51"
 .   .   .   .   max="2"
-.   .   .   .   total="4.0"
 .   .   .   .   avg="0.078431372549"
+.   .   .   .   total="4.0"
 .   .   .   .   min="0" 
 .   .   .   .   distribution-bars:
 .   .   .   .   
 .   .   .   .   .   distribution-bar: 
 .   .   .   .   .   .   count="48"
 .   .   .   .   .   .   metric="0"
+.   .   .   .   .   .   ratio="0.9412"
 .   .   .   .   
 .   .   .   .   .   distribution-bar: 
 .   .   .   .   .   .   count="2"
 .   .   .   .   .   .   metric="1"
+.   .   .   .   .   .   ratio="0.0392"
 .   .   .   .   
 .   .   .   .   .   distribution-bar: 
 .   .   .   .   .   .   count="1"
 .   .   .   .   .   .   metric="2"
+.   .   .   .   .   .   ratio="0.0196"
 ================================================================================
 --------------------------------------------------------------------------------
 data:  
@@ -1223,23 +1229,27 @@ data:
 .   aggregated-data:  
 .   .   std.code.complexity:  
 .   .   .   cyclomatic: 
+.   .   .   .   count="24"
 .   .   .   .   max="2"
-.   .   .   .   total="6.0"
 .   .   .   .   avg="0.25"
+.   .   .   .   total="6.0"
 .   .   .   .   min="0" 
 .   .   .   .   distribution-bars:
 .   .   .   .   
 .   .   .   .   .   distribution-bar: 
 .   .   .   .   .   .   count="20"
 .   .   .   .   .   .   metric="0"
+.   .   .   .   .   .   ratio="0.8333"
 .   .   .   .   
 .   .   .   .   .   distribution-bar: 
 .   .   .   .   .   .   count="2"
 .   .   .   .   .   .   metric="1"
+.   .   .   .   .   .   ratio="0.0833"
 .   .   .   .   
 .   .   .   .   .   distribution-bar: 
 .   .   .   .   .   .   count="2"
 .   .   .   .   .   .   metric="2"
+.   .   .   .   .   .   ratio="0.0833"
 ================================================================================
 --------------------------------------------------------------------------------
 data:  
@@ -1338,23 +1348,27 @@ data:
 .   aggregated-data:  
 .   .   std.code.complexity:  
 .   .   .   cyclomatic: 
+.   .   .   .   count="4"
 .   .   .   .   max="2"
-.   .   .   .   total="3.0"
 .   .   .   .   avg="0.75"
+.   .   .   .   total="3.0"
 .   .   .   .   min="0" 
 .   .   .   .   distribution-bars:
 .   .   .   .   
 .   .   .   .   .   distribution-bar: 
 .   .   .   .   .   .   count="2"
 .   .   .   .   .   .   metric="0"
+.   .   .   .   .   .   ratio="0.5"
 .   .   .   .   
 .   .   .   .   .   distribution-bar: 
 .   .   .   .   .   .   count="1"
 .   .   .   .   .   .   metric="1"
+.   .   .   .   .   .   ratio="0.25"
 .   .   .   .   
 .   .   .   .   .   distribution-bar: 
 .   .   .   .   .   .   count="1"
 .   .   .   .   .   .   metric="2"
+.   .   .   .   .   .   ratio="0.25"
 ================================================================================
 --------------------------------------------------------------------------------
 data:  
@@ -1475,23 +1489,27 @@ data:
 .   aggregated-data:  
 .   .   std.code.complexity:  
 .   .   .   cyclomatic: 
+.   .   .   .   count="4"
 .   .   .   .   max="2"
-.   .   .   .   total="4.0"
 .   .   .   .   avg="1.0"
+.   .   .   .   total="4.0"
 .   .   .   .   min="0" 
 .   .   .   .   distribution-bars:
 .   .   .   .   
 .   .   .   .   .   distribution-bar: 
 .   .   .   .   .   .   count="1"
 .   .   .   .   .   .   metric="0"
+.   .   .   .   .   .   ratio="0.25"
 .   .   .   .   
 .   .   .   .   .   distribution-bar: 
 .   .   .   .   .   .   count="2"
 .   .   .   .   .   .   metric="1"
+.   .   .   .   .   .   ratio="0.5"
 .   .   .   .   
 .   .   .   .   .   distribution-bar: 
 .   .   .   .   .   .   count="1"
 .   .   .   .   .   .   metric="2"
+.   .   .   .   .   .   ratio="0.25"
 ================================================================================
 
 

+ 8 - 8
mainline/tests/general/test_std_code_cs/test_parser_export_default_stdout.gold.txt

@@ -10,15 +10,15 @@
         </subdirs>
         <aggregated-data>
             <std.code.complexity>
-                <cyclomatic max="6" total="45.0" avg="1.15384615385" min="0">
+                <cyclomatic count="39" max="6" avg="1.15384615385" total="45.0" min="0">
                     <distribution-bars>
-                        <distribution-bar count="23" metric="0" />
-                        <distribution-bar count="7" metric="1" />
-                        <distribution-bar count="1" metric="2" />
-                        <distribution-bar count="1" metric="3" />
-                        <distribution-bar count="3" metric="4" />
-                        <distribution-bar count="3" metric="5" />
-                        <distribution-bar count="1" metric="6" />
+                        <distribution-bar count="23" metric="0" ratio="0.5897" />
+                        <distribution-bar count="7" metric="1" ratio="0.1795" />
+                        <distribution-bar count="1" metric="2" ratio="0.0256" />
+                        <distribution-bar count="1" metric="3" ratio="0.0256" />
+                        <distribution-bar count="3" metric="4" ratio="0.0769" />
+                        <distribution-bar count="3" metric="5" ratio="0.0769" />
+                        <distribution-bar count="1" metric="6" ratio="0.0256" />
                     </distribution-bars>
                 </cyclomatic>
             </std.code.complexity>

+ 18 - 3
mainline/tests/general/test_std_code_cs/test_parser_export_files_stdout.gold.txt

@@ -328,39 +328,47 @@ data:
 .   aggregated-data:  
 .   .   std.code.complexity:  
 .   .   .   cyclomatic: 
+.   .   .   .   count="19"
 .   .   .   .   max="6"
-.   .   .   .   total="39.0"
 .   .   .   .   avg="2.05263157895"
+.   .   .   .   total="39.0"
 .   .   .   .   min="0" 
 .   .   .   .   distribution-bars:
 .   .   .   .   
 .   .   .   .   .   distribution-bar: 
 .   .   .   .   .   .   count="6"
 .   .   .   .   .   .   metric="0"
+.   .   .   .   .   .   ratio="0.3158"
 .   .   .   .   
 .   .   .   .   .   distribution-bar: 
 .   .   .   .   .   .   count="5"
 .   .   .   .   .   .   metric="1"
+.   .   .   .   .   .   ratio="0.2632"
 .   .   .   .   
 .   .   .   .   .   distribution-bar: 
 .   .   .   .   .   .   count="1"
 .   .   .   .   .   .   metric="2"
+.   .   .   .   .   .   ratio="0.0526"
 .   .   .   .   
 .   .   .   .   .   distribution-bar: 
 .   .   .   .   .   .   count="1"
 .   .   .   .   .   .   metric="3"
+.   .   .   .   .   .   ratio="0.0526"
 .   .   .   .   
 .   .   .   .   .   distribution-bar: 
 .   .   .   .   .   .   count="2"
 .   .   .   .   .   .   metric="4"
+.   .   .   .   .   .   ratio="0.1053"
 .   .   .   .   
 .   .   .   .   .   distribution-bar: 
 .   .   .   .   .   .   count="3"
 .   .   .   .   .   .   metric="5"
+.   .   .   .   .   .   ratio="0.1579"
 .   .   .   .   
 .   .   .   .   .   distribution-bar: 
 .   .   .   .   .   .   count="1"
 .   .   .   .   .   .   metric="6"
+.   .   .   .   .   .   ratio="0.0526"
 ================================================================================
 --------------------------------------------------------------------------------
 data:  
@@ -570,19 +578,22 @@ data:
 .   aggregated-data:  
 .   .   std.code.complexity:  
 .   .   .   cyclomatic: 
+.   .   .   .   count="8"
 .   .   .   .   max="1"
-.   .   .   .   total="1.0"
 .   .   .   .   avg="0.125"
+.   .   .   .   total="1.0"
 .   .   .   .   min="0" 
 .   .   .   .   distribution-bars:
 .   .   .   .   
 .   .   .   .   .   distribution-bar: 
 .   .   .   .   .   .   count="7"
 .   .   .   .   .   .   metric="0"
+.   .   .   .   .   .   ratio="0.875"
 .   .   .   .   
 .   .   .   .   .   distribution-bar: 
 .   .   .   .   .   .   count="1"
 .   .   .   .   .   .   metric="1"
+.   .   .   .   .   .   ratio="0.125"
 ================================================================================
 --------------------------------------------------------------------------------
 data:  
@@ -824,23 +835,27 @@ data:
 .   aggregated-data:  
 .   .   std.code.complexity:  
 .   .   .   cyclomatic: 
+.   .   .   .   count="12"
 .   .   .   .   max="4"
-.   .   .   .   total="5.0"
 .   .   .   .   avg="0.416666666667"
+.   .   .   .   total="5.0"
 .   .   .   .   min="0" 
 .   .   .   .   distribution-bars:
 .   .   .   .   
 .   .   .   .   .   distribution-bar: 
 .   .   .   .   .   .   count="10"
 .   .   .   .   .   .   metric="0"
+.   .   .   .   .   .   ratio="0.8333"
 .   .   .   .   
 .   .   .   .   .   distribution-bar: 
 .   .   .   .   .   .   count="1"
 .   .   .   .   .   .   metric="1"
+.   .   .   .   .   .   ratio="0.0833"
 .   .   .   .   
 .   .   .   .   .   distribution-bar: 
 .   .   .   .   .   .   count="1"
 .   .   .   .   .   .   metric="4"
+.   .   .   .   .   .   ratio="0.0833"
 ================================================================================
 
 

+ 7 - 7
mainline/tests/general/test_std_code_java/test_parser_export_default_stdout.gold.txt

@@ -10,14 +10,14 @@
         </subdirs>
         <aggregated-data>
             <std.code.complexity>
-                <cyclomatic max="6" total="126.0" avg="1.05882352941" min="0">
+                <cyclomatic count="119" max="6" avg="1.05882352941" total="126.0" min="0">
                     <distribution-bars>
-                        <distribution-bar count="58" metric="0" />
-                        <distribution-bar count="31" metric="1" />
-                        <distribution-bar count="15" metric="2" />
-                        <distribution-bar count="8" metric="3" />
-                        <distribution-bar count="1" metric="5" />
-                        <distribution-bar count="6" metric="6" />
+                        <distribution-bar count="58" metric="0" ratio="0.4874" />
+                        <distribution-bar count="31" metric="1" ratio="0.2605" />
+                        <distribution-bar count="15" metric="2" ratio="0.1261" />
+                        <distribution-bar count="8" metric="3" ratio="0.0672" />
+                        <distribution-bar count="1" metric="5" ratio="0.0084" />
+                        <distribution-bar count="6" metric="6" ratio="0.0504" />
                     </distribution-bars>
                 </cyclomatic>
             </std.code.complexity>

+ 23 - 4
mainline/tests/general/test_std_code_java/test_parser_export_files_stdout.gold.txt

@@ -652,31 +652,37 @@ data:
 .   aggregated-data:  
 .   .   std.code.complexity:  
 .   .   .   cyclomatic: 
+.   .   .   .   count="43"
 .   .   .   .   max="6"
-.   .   .   .   total="83.0"
 .   .   .   .   avg="1.93023255814"
+.   .   .   .   total="83.0"
 .   .   .   .   min="0" 
 .   .   .   .   distribution-bars:
 .   .   .   .   
 .   .   .   .   .   distribution-bar: 
 .   .   .   .   .   .   count="8"
 .   .   .   .   .   .   metric="0"
+.   .   .   .   .   .   ratio="0.186"
 .   .   .   .   
 .   .   .   .   .   distribution-bar: 
 .   .   .   .   .   .   count="14"
 .   .   .   .   .   .   metric="1"
+.   .   .   .   .   .   ratio="0.3256"
 .   .   .   .   
 .   .   .   .   .   distribution-bar: 
 .   .   .   .   .   .   count="9"
 .   .   .   .   .   .   metric="2"
+.   .   .   .   .   .   ratio="0.2093"
 .   .   .   .   
 .   .   .   .   .   distribution-bar: 
 .   .   .   .   .   .   count="7"
 .   .   .   .   .   .   metric="3"
+.   .   .   .   .   .   ratio="0.1628"
 .   .   .   .   
 .   .   .   .   .   distribution-bar: 
 .   .   .   .   .   .   count="5"
 .   .   .   .   .   .   metric="6"
+.   .   .   .   .   .   ratio="0.1163"
 ================================================================================
 --------------------------------------------------------------------------------
 data:  
@@ -730,15 +736,17 @@ data:
 .   aggregated-data:  
 .   .   std.code.complexity:  
 .   .   .   cyclomatic: 
+.   .   .   .   count="1"
 .   .   .   .   max="0"
-.   .   .   .   total="0.0"
 .   .   .   .   avg="0.0"
+.   .   .   .   total="0.0"
 .   .   .   .   min="0" 
 .   .   .   .   distribution-bars:
 .   .   .   .   
 .   .   .   .   .   distribution-bar: 
 .   .   .   .   .   .   count="1"
 .   .   .   .   .   .   metric="0"
+.   .   .   .   .   .   ratio="1.0"
 ================================================================================
 --------------------------------------------------------------------------------
 data:  
@@ -1404,35 +1412,42 @@ data:
 .   aggregated-data:  
 .   .   std.code.complexity:  
 .   .   .   cyclomatic: 
+.   .   .   .   count="44"
 .   .   .   .   max="6"
-.   .   .   .   total="37.0"
 .   .   .   .   avg="0.840909090909"
+.   .   .   .   total="37.0"
 .   .   .   .   min="0" 
 .   .   .   .   distribution-bars:
 .   .   .   .   
 .   .   .   .   .   distribution-bar: 
 .   .   .   .   .   .   count="23"
 .   .   .   .   .   .   metric="0"
+.   .   .   .   .   .   ratio="0.5227"
 .   .   .   .   
 .   .   .   .   .   distribution-bar: 
 .   .   .   .   .   .   count="13"
 .   .   .   .   .   .   metric="1"
+.   .   .   .   .   .   ratio="0.2955"
 .   .   .   .   
 .   .   .   .   .   distribution-bar: 
 .   .   .   .   .   .   count="5"
 .   .   .   .   .   .   metric="2"
+.   .   .   .   .   .   ratio="0.1136"
 .   .   .   .   
 .   .   .   .   .   distribution-bar: 
 .   .   .   .   .   .   count="1"
 .   .   .   .   .   .   metric="3"
+.   .   .   .   .   .   ratio="0.0227"
 .   .   .   .   
 .   .   .   .   .   distribution-bar: 
 .   .   .   .   .   .   count="1"
 .   .   .   .   .   .   metric="5"
+.   .   .   .   .   .   ratio="0.0227"
 .   .   .   .   
 .   .   .   .   .   distribution-bar: 
 .   .   .   .   .   .   count="1"
 .   .   .   .   .   .   metric="6"
+.   .   .   .   .   .   ratio="0.0227"
 ================================================================================
 --------------------------------------------------------------------------------
 data:  
@@ -1916,23 +1931,27 @@ data:
 .   aggregated-data:  
 .   .   std.code.complexity:  
 .   .   .   cyclomatic: 
+.   .   .   .   count="31"
 .   .   .   .   max="2"
-.   .   .   .   total="6.0"
 .   .   .   .   avg="0.193548387097"
+.   .   .   .   total="6.0"
 .   .   .   .   min="0" 
 .   .   .   .   distribution-bars:
 .   .   .   .   
 .   .   .   .   .   distribution-bar: 
 .   .   .   .   .   .   count="26"
 .   .   .   .   .   .   metric="0"
+.   .   .   .   .   .   ratio="0.8387"
 .   .   .   .   
 .   .   .   .   .   distribution-bar: 
 .   .   .   .   .   .   count="4"
 .   .   .   .   .   .   metric="1"
+.   .   .   .   .   .   ratio="0.129"
 .   .   .   .   
 .   .   .   .   .   distribution-bar: 
 .   .   .   .   .   .   count="1"
 .   .   .   .   .   .   metric="2"
+.   .   .   .   .   .   ratio="0.0323"
 ================================================================================