Quellcode durchsuchen

define back the std.code.ratio.comments as lines_comments/(lines_comments+lines_codes)

Emmanuel Olivi vor 2 Jahren
Ursprung
Commit
2c80d2160c

+ 6 - 6
metrixpp/ext/std/code/ratio.py

@@ -16,7 +16,7 @@ class Plugin(api.Plugin,
         self.parser = parser
         parser.add_option("--std.code.ratio.comments", "--scrc", action="store_true", default=False,
                          help="Enables collection of comment ratio metric (per region detalization) - "
-                         "ratio of non-empty lines of comments to non-empty lines of code"
+                         "ratio of non-empty lines of comments to non-empty lines of (code + comments)"
                          " It uses std.code.lines.code, std.code.lines.comments"
                          " metrics to calculate the ratio."
                          " [default: %default]")
@@ -28,8 +28,8 @@ class Plugin(api.Plugin,
             for each in required_opts:
                 if options.__dict__[each] == False:
                     self.parser.error('option --std.code.ratio.comments: requires --{0} option'.
-                                      format(each)) 
-    
+                                      format(each))
+
     def initialize(self):
         self.declare_metric(self.is_active_ratiocomments,
                             self.Field('comments', float),
@@ -38,12 +38,12 @@ class Plugin(api.Plugin,
                             },
                             # set none, because this plugin is not interested in parsing the code
                             marker_type_mask=api.Marker.T.NONE)
-        
+
         super(Plugin, self).initialize(fields=self.get_fields())
 
         if self.is_active() == True:
             self.subscribe_by_parents_name('std.code.lines')
 
     class RatioCalculatorCounter(api.MetricPluginMixin.RatioCalculator):
-        ratio_dividend = ('std.code.lines', 'comments')
-        ratio_divisor = ('std.code.lines', 'code')
+        ratio_comments = ('std.code.lines', 'comments')
+        ratio_code = ('std.code.lines', 'code')

+ 6 - 7
metrixpp/mpp/api.py

@@ -1176,16 +1176,15 @@ class MetricPluginMixin(Parent):
                 self.result = 0.0
         
         def get_result(self):
-            sourced_dividend = self.region.get_data(self.ratio_dividend[0], self.ratio_dividend[1])
-            sourced_divisor = self.region.get_data(self.ratio_divisor[0], self.ratio_divisor[1])
-            if ((sourced_dividend != None)
+            sourced_comments = self.region.get_data(self.ratio_comments[0], self.ratio_comments[1])
+            sourced_code = self.region.get_data(self.ratio_code[0], self.ratio_code[1])
+            if ((sourced_comments != None)
                 and
-                (sourced_divisor != None)
+                (sourced_code != None)
                 and
-                (sourced_divisor != 0)
+                (sourced_comments + sourced_code != 0)
                ):
-                # define as the number of lines of comments by the number of lines of code
-                self.result = float(sourced_dividend) / sourced_divisor
+                self.result = float(sourced_comments) / (sourced_code + sourced_comments)
             else:
               self.result = 0.0
 

+ 1 - 1
metrixpp/tests/general/test_basic/test_help_collect_default_stdout.gold.txt

@@ -116,7 +116,7 @@ Options:
   --std.code.ratio.comments, --scrc
                         Enables collection of comment ratio metric (per region
                         detalization) - ratio of non-empty lines of comments
-                        to non-empty lines of code It uses
+                        to non-empty lines of (code + comments) It uses
                         std.code.lines.code, std.code.lines.comments metrics
                         to calculate the ratio. [default: False]
   --std.code.todo.comments, --sctc

+ 10 - 10
metrixpp/tests/general/test_basic/test_std_lines_metrics_view_nest_per_file_stdout.gold.txt

@@ -20,7 +20,7 @@
     	std.code.lines:comments: 1
     	std.code.lines:preprocessor: 1
     	std.code.lines:total: 6
-    	std.code.ratio:comments: 0.25
+    	std.code.ratio:comments: 0.2
 
 .   .   ./simple.cpp:9: info: Metrics per 'A' region
         	Region name    : A
@@ -44,7 +44,7 @@
             	std.code.lines:comments: 2
             	std.code.lines:preprocessor: 0
             	std.code.lines:total: 12
-            	std.code.ratio:comments: 0.181818181818
+            	std.code.ratio:comments: 0.153846153846
 
 .   .   .   ./simple.cpp:26: info: Metrics per 'func' region
             	Region name    : func
@@ -80,7 +80,7 @@
                     	std.code.lines:comments: 1
                     	std.code.lines:preprocessor: 0
                     	std.code.lines:total: 8
-                    	std.code.ratio:comments: 0.142857142857
+                    	std.code.ratio:comments: 0.125
 
 .   .   .   ./simple.cpp:42: info: Metrics per 'func_to_be_removed_in_new_sources' region
             	Region name    : func_to_be_removed_in_new_sources
@@ -116,7 +116,7 @@
                     	std.code.lines:comments: 1
                     	std.code.lines:preprocessor: 0
                     	std.code.lines:total: 8
-                    	std.code.ratio:comments: 0.142857142857
+                    	std.code.ratio:comments: 0.125
 
 .   .   .   ./simple.cpp:58: info: Metrics per 'never' region
             	Region name    : never
@@ -183,15 +183,15 @@
 	            20 : 0.091 : 1.000 :  1	|||||||||
 
 ./simple.cpp:: info: Overall metrics for 'std.code.ratio:comments' metric
-	Average        : 0.06523022
+	Average        : 0.0548951
 	Minimum        : 0.0
-	Maximum        : 0.25
-	Total          : 0.71753247
+	Maximum        : 0.2
+	Total          : 0.60384615
 	Distribution   : 11 regions in total (including 0 suppressed)
 	  Metric value : Ratio : R-sum : Number of regions
 	        0.0000 : 0.636 : 0.636 :  7	|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
-	        0.1429 : 0.182 : 0.818 :  2	||||||||||||||||||
-	        0.1818 : 0.091 : 0.909 :  1	|||||||||
-	        0.2500 : 0.091 : 1.000 :  1	|||||||||
+	        0.1250 : 0.182 : 0.818 :  2	||||||||||||||||||
+	        0.1538 : 0.091 : 0.909 :  1	|||||||||
+	        0.2000 : 0.091 : 1.000 :  1	|||||||||
 
 

+ 7 - 7
metrixpp/tests/general/test_basic/test_std_lines_metrics_view_txt_stdout.gold.txt

@@ -54,17 +54,17 @@
 	            20 : 0.062 : 1.000 :  1	||||||
 
 ./:: info: Overall metrics for 'std.code.ratio:comments' metric
-	Average        : 0.10734578
+	Average        : 0.0770261
 	Minimum        : 0.0
-	Maximum        : 0.75
-	Total          : 1.71753247
+	Maximum        : 0.42857143
+	Total          : 1.23241758
 	Distribution   : 16 regions in total (including 0 suppressed)
 	  Metric value : Ratio : R-sum : Number of regions
 	        0.0000 : 0.625 : 0.625 : 10	||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
-	        0.1429 : 0.125 : 0.750 :  2	||||||||||||
-	        0.1818 : 0.062 : 0.812 :  1	||||||
-	        0.2500 : 0.125 : 0.938 :  2	||||||||||||
-	        0.7500 : 0.062 : 1.000 :  1	||||||
+	        0.1250 : 0.125 : 0.750 :  2	||||||||||||
+	        0.1538 : 0.062 : 0.812 :  1	||||||
+	        0.2000 : 0.125 : 0.938 :  2	||||||||||||
+	        0.4286 : 0.062 : 1.000 :  1	||||||
 
 ./:: info: Directory content:
 	File           : file_deleted_in_new_sources.cpp

+ 6 - 6
metrixpp/tests/general/test_basic/test_workflow_export_default_stdout.gold.txt

@@ -1,19 +1,19 @@
 file,region,type,modified,line start,line end,std.code.complexity:cyclomatic,std.code.lines:code,std.code.lines:comments,std.code.lines:preprocessor,std.code.lines:total,std.code.ratio:comments,std.suppress:count,std.suppress:list,std.suppress.file:count,std.suppress.file:list
 ./file_deleted_in_new_sources.cpp,__global__,global,,1,34,,0,0,0,0,0.0,,,,
-./file_deleted_in_new_sources.cpp,hmm,namespace,,3,24,,4,3,0,7,0.75,,,,
+./file_deleted_in_new_sources.cpp,hmm,namespace,,3,24,,4,3,0,7,0.428571428571,,,,
 ./file_deleted_in_new_sources.cpp,B,class,,9,22,,3,0,0,3,0.0,,,,
-./file_deleted_in_new_sources.cpp,B,function,,12,20,1,8,2,0,9,0.25,,,,
+./file_deleted_in_new_sources.cpp,B,function,,12,20,1,8,2,0,9,0.2,,,,
 ./file_deleted_in_new_sources.cpp,never_old,function,,26,33,1,7,0,0,7,0.0,,,,
 ./file_deleted_in_new_sources.cpp,,file,,1,34,,,,,,,,,,
 ./simple.cpp,__global__,global,,1,90,,0,0,0,0,0.0,,,,
-./simple.cpp,hmm,namespace,,3,89,,4,1,1,6,0.25,,,,
+./simple.cpp,hmm,namespace,,3,89,,4,1,1,6,0.2,,,,
 ./simple.cpp,A,class,,9,87,,20,0,0,20,0.0,,,,
-./simple.cpp,A,function,,12,23,3,11,2,0,12,0.181818181818,,,,
+./simple.cpp,A,function,,12,23,3,11,2,0,12,0.153846153846,,,,
 ./simple.cpp,func,function,,26,40,1,5,0,0,5,0.0,,,,
 ./simple.cpp,embeded,class,,28,38,,3,0,0,3,0.0,,,,
-./simple.cpp,embeded,function,,30,37,1,7,1,0,8,0.142857142857,,,,
+./simple.cpp,embeded,function,,30,37,1,7,1,0,8,0.125,,,,
 ./simple.cpp,func_to_be_removed_in_new_sources,function,,42,56,2,5,0,0,5,0.0,,,,
 ./simple.cpp,embeded,class,,44,54,,3,0,0,3,0.0,,,,
-./simple.cpp,embeded,function,,46,53,1,7,1,0,8,0.142857142857,,,,
+./simple.cpp,embeded,function,,46,53,1,7,1,0,8,0.125,,,,
 ./simple.cpp,never,function,,58,65,1,7,0,0,7,0.0,,,,
 ./simple.cpp,,file,,1,90,,,,,,,,,,

+ 8 - 8
metrixpp/tests/general/test_basic/test_workflow_export_second_stdout.gold.txt

@@ -1,18 +1,18 @@
 file,region,type,modified,line start,line end,std.code.complexity:cyclomatic,std.code.lines:code,std.code.lines:comments,std.code.lines:preprocessor,std.code.lines:total,std.code.ratio:comments,std.suppress:count,std.suppress:list,std.suppress.file:count,std.suppress.file:list
 ./simple.cpp,__global__,global,False,1,78,,0,0,0,0,0.0,,,,
-./simple.cpp,hmm,namespace,True,3,77,,4,1,2,7,0.25,,,,
+./simple.cpp,hmm,namespace,True,3,77,,4,1,2,7,0.2,,,,
 ./simple.cpp,A,class,True,10,75,,4,0,0,4,0.0,,,,
-./simple.cpp,A,function,False,13,24,3,11,2,0,12,0.181818181818,,,,
+./simple.cpp,A,function,False,13,24,3,11,2,0,12,0.153846153846,,,,
 ./simple.cpp,func,function,False,26,42,1,5,0,0,5,0.0,,,,
 ./simple.cpp,embeded,class,False,28,40,,3,0,0,3,0.0,,,,
-./simple.cpp,embeded,function,True,30,39,2,8,2,0,9,0.25,,,,
-./simple.cpp,never,function,True,44,51,1,7,1,0,7,0.142857142857,,,,
-./simple.cpp,new_func,function,,53,56,0,3,1,0,4,0.333333333333,,,,
+./simple.cpp,embeded,function,True,30,39,2,8,2,0,9,0.2,,,,
+./simple.cpp,never,function,True,44,51,1,7,1,0,7,0.125,,,,
+./simple.cpp,new_func,function,,53,56,0,3,1,0,4,0.25,,,,
 ./simple.cpp,new_func_complex,function,,58,62,1,5,0,0,5,0.0,,,,
-./simple.cpp,new_func_complex_but_suppressed,function,,64,72,2,8,1,0,9,0.125,1,[std.code.complexity:cyclomatic],,
+./simple.cpp,new_func_complex_but_suppressed,function,,64,72,2,8,1,0,9,0.111111111111,1,[std.code.complexity:cyclomatic],,
 ./simple.cpp,,file,True,1,78,,,,,,,,,,
 ./simple2.cpp,__global__,global,,1,26,,0,0,0,0,0.0,,,,
-./simple2.cpp,hmm,namespace,,3,25,,4,1,0,5,0.25,,,,
+./simple2.cpp,hmm,namespace,,3,25,,4,1,0,5,0.2,,,,
 ./simple2.cpp,New_A,class,,7,23,,3,0,0,3,0.0,,,,
-./simple2.cpp,New_A,function,,10,21,3,10,2,0,12,0.2,,,,
+./simple2.cpp,New_A,function,,10,21,3,10,2,0,12,0.166666666667,,,,
 ./simple2.cpp,,file,,1,26,,,,,,,,,,

+ 5 - 5
metrixpp/tests/general/test_basic/test_workflow_view_default_stdout.gold.txt

@@ -53,13 +53,13 @@
                 </total>
             </std.code.lines>
             <std.code.ratio>
-                <comments avg="0.10734578" count="16" max="0.75" min="0.0" nonzero="False" sup="0" total="1.71753247">
+                <comments avg="0.0770261" count="16" max="0.42857143" min="0.0" nonzero="False" sup="0" total="1.23241758">
                     <distribution-bars>
                         <distribution-bar count="10" metric="0.0000" ratio="0.625" />
-                        <distribution-bar count="2" metric="0.1429" ratio="0.125" />
-                        <distribution-bar count="1" metric="0.1818" ratio="0.0625" />
-                        <distribution-bar count="2" metric="0.2500" ratio="0.125" />
-                        <distribution-bar count="1" metric="0.7500" ratio="0.0625" />
+                        <distribution-bar count="2" metric="0.1250" ratio="0.125" />
+                        <distribution-bar count="1" metric="0.1538" ratio="0.0625" />
+                        <distribution-bar count="2" metric="0.2000" ratio="0.125" />
+                        <distribution-bar count="1" metric="0.4286" ratio="0.0625" />
                     </distribution-bars>
                 </comments>
             </std.code.ratio>

+ 15 - 15
metrixpp/tests/general/test_basic/test_workflow_view_second_per_file_stdout.gold.txt

@@ -58,15 +58,15 @@
                 </total>
             </std.code.lines>
             <std.code.ratio>
-                <comments avg="0.11663715" count="11" max="0.33333333" min="0.0" nonzero="False" sup="0" total="1.28300866">
-                    <__diff__ avg="0.05140693" count="0" max="0.08333333" min="0.0" nonzero="0" sup="0" total="0.56547619" />
+                <comments avg="0.09454157" count="11" max="0.25" min="0.0" nonzero="False" sup="0" total="1.03995726">
+                    <__diff__ avg="0.03964646" count="0" max="0.05" min="0.0" nonzero="0" sup="0" total="0.43611111" />
                     <distribution-bars>
                         <distribution-bar __diff__="-2" count="5" metric="0.0000" ratio="0.45454545" />
-                        <distribution-bar __diff__="1" count="1" metric="0.1250" ratio="0.09090909" />
-                        <distribution-bar __diff__="-1" count="1" metric="0.1429" ratio="0.09090909" />
-                        <distribution-bar __diff__="0" count="1" metric="0.1818" ratio="0.09090909" />
-                        <distribution-bar __diff__="1" count="2" metric="0.2500" ratio="0.18181818" />
-                        <distribution-bar __diff__="1" count="1" metric="0.3333" ratio="0.09090909" />
+                        <distribution-bar __diff__="1" count="1" metric="0.1111" ratio="0.09090909" />
+                        <distribution-bar __diff__="-1" count="1" metric="0.1250" ratio="0.09090909" />
+                        <distribution-bar __diff__="0" count="1" metric="0.1538" ratio="0.09090909" />
+                        <distribution-bar __diff__="1" count="2" metric="0.2000" ratio="0.18181818" />
+                        <distribution-bar __diff__="1" count="1" metric="0.2500" ratio="0.09090909" />
                     </distribution-bars>
                 </comments>
             </std.code.ratio>
@@ -104,7 +104,7 @@
                         <std.code.lines code="4" comments="1" preprocessor="2" total="7">
                             <__diff__ code="0" comments="0" preprocessor="1" total="1" />
                         </std.code.lines>
-                        <std.code.ratio comments="0.25">
+                        <std.code.ratio comments="0.2">
                             <__diff__ comments="0.0" />
                         </std.code.ratio>
                     </data>
@@ -129,7 +129,7 @@
                         <std.code.lines code="11" comments="2" preprocessor="0" total="12">
                             <__diff__ code="0" comments="0" preprocessor="0" total="0" />
                         </std.code.lines>
-                        <std.code.ratio comments="0.18181818">
+                        <std.code.ratio comments="0.15384615">
                             <__diff__ comments="0.0" />
                         </std.code.ratio>
                     </data>
@@ -168,8 +168,8 @@
                         <std.code.lines code="8" comments="2" preprocessor="0" total="9">
                             <__diff__ code="1" comments="1" preprocessor="0" total="1" />
                         </std.code.lines>
-                        <std.code.ratio comments="0.25">
-                            <__diff__ comments="0.10714286" />
+                        <std.code.ratio comments="0.2">
+                            <__diff__ comments="0.075" />
                         </std.code.ratio>
                     </data>
                     <info cursor="30" line_begin="30" line_end="39" modified="True" name="embeded" offset_begin="322" offset_end="437" type="function" />
@@ -182,8 +182,8 @@
                         <std.code.lines code="7" comments="1" preprocessor="0" total="7">
                             <__diff__ code="0" comments="1" preprocessor="0" total="0" />
                         </std.code.lines>
-                        <std.code.ratio comments="0.14285714">
-                            <__diff__ comments="0.14285714" />
+                        <std.code.ratio comments="0.125">
+                            <__diff__ comments="0.125" />
                         </std.code.ratio>
                     </data>
                     <info cursor="44" line_begin="44" line_end="51" modified="True" name="never" offset_begin="458" offset_end="549" type="function" />
@@ -192,7 +192,7 @@
                     <data>
                         <std.code.complexity cyclomatic="0" />
                         <std.code.lines code="3" comments="1" preprocessor="0" total="4" />
-                        <std.code.ratio comments="0.33333333" />
+                        <std.code.ratio comments="0.25" />
                     </data>
                     <info cursor="53" line_begin="53" line_end="56" modified="None" name="new_func" offset_begin="552" offset_end="585" type="function" />
                 </region>
@@ -208,7 +208,7 @@
                     <data>
                         <std.code.complexity cyclomatic="2" />
                         <std.code.lines code="8" comments="1" preprocessor="0" total="9" />
-                        <std.code.ratio comments="0.125" />
+                        <std.code.ratio comments="0.11111111" />
                         <std.suppress count="1" list="[std.code.complexity:cyclomatic]" />
                     </data>
                     <info cursor="65" line_begin="64" line_end="72" modified="None" name="new_func_complex_but_suppressed" offset_begin="649" offset_end="808" type="function" />

+ 14 - 14
metrixpp/tests/general/test_basic/test_workflow_view_second_per_file_txt_all_stdout.gold.txt

@@ -20,7 +20,7 @@
 	std.code.lines:comments: 1 [+0]
 	std.code.lines:preprocessor: 2 [+1]
 	std.code.lines:total: 7 [+1]
-	std.code.ratio:comments: 0.25 [+0.0]
+	std.code.ratio:comments: 0.2 [+0.0]
 
 ./simple.cpp:10: info: Metrics per 'A' region
 	Region name    : A
@@ -45,7 +45,7 @@
 	std.code.lines:comments: 2 [+0]
 	std.code.lines:preprocessor: 0 [+0]
 	std.code.lines:total: 12 [+0]
-	std.code.ratio:comments: 0.181818181818 [+0.0]
+	std.code.ratio:comments: 0.153846153846 [+0.0]
 
 ./simple.cpp:26: info: Metrics per 'func' region
 	Region name    : func
@@ -83,7 +83,7 @@
 	std.code.lines:comments: 2 [+1]
 	std.code.lines:preprocessor: 0 [+0]
 	std.code.lines:total: 9 [+1]
-	std.code.ratio:comments: 0.25 [+0.107142857143]
+	std.code.ratio:comments: 0.2 [+0.075]
 
 ./simple.cpp:44: info: Metrics per 'never' region
 	Region name    : never
@@ -96,7 +96,7 @@
 	std.code.lines:comments: 1 [+1]
 	std.code.lines:preprocessor: 0 [+0]
 	std.code.lines:total: 7 [+0]
-	std.code.ratio:comments: 0.142857142857 [+0.142857142857]
+	std.code.ratio:comments: 0.125 [+0.125]
 
 ./simple.cpp:53: info: Metrics per 'new_func' region
 	Region name    : new_func
@@ -109,7 +109,7 @@
 	std.code.lines:comments: 1
 	std.code.lines:preprocessor: 0
 	std.code.lines:total: 4
-	std.code.ratio:comments: 0.333333333333
+	std.code.ratio:comments: 0.25
 
 ./simple.cpp:58: info: Metrics per 'new_func_complex' region
 	Region name    : new_func_complex
@@ -135,7 +135,7 @@
 	std.code.lines:comments: 1
 	std.code.lines:preprocessor: 0
 	std.code.lines:total: 9
-	std.code.ratio:comments: 0.125
+	std.code.ratio:comments: 0.111111111111
 	std.suppress:count: 1
 	std.suppress:list: [std.code.complexity:cyclomatic]
 
@@ -206,18 +206,18 @@
 	            12 : 0.091 : 1.000 :  1 [+0 ]	|||||||||
 
 ./simple.cpp:: info: Overall metrics for 'std.code.ratio:comments' metric
-	Average        : 0.11663715 [+0.05140693]
+	Average        : 0.09454157 [+0.03964646]
 	Minimum        : 0.0 [+0.0]
-	Maximum        : 0.33333333 [+0.08333333]
-	Total          : 1.28300866 [+0.56547619]
+	Maximum        : 0.25 [+0.05]
+	Total          : 1.03995726 [+0.43611111]
 	Distribution   : 11 [+0] regions in total (including 0 [+0] suppressed)
 	  Metric value : Ratio : R-sum : Number of regions
 	        0.0000 : 0.455 : 0.455 :  5 [-2 ]	|||||||||||||||||||||||||||||||||||||||||||||
-	        0.1250 : 0.091 : 0.545 :  1 [+1 ]	|||||||||
-	        0.1429 : 0.091 : 0.636 :  1 [-1 ]	|||||||||
-	        0.1818 : 0.091 : 0.727 :  1 [+0 ]	|||||||||
-	        0.2500 : 0.182 : 0.909 :  2 [+1 ]	||||||||||||||||||
-	        0.3333 : 0.091 : 1.000 :  1 [+1 ]	|||||||||
+	        0.1111 : 0.091 : 0.545 :  1 [+1 ]	|||||||||
+	        0.1250 : 0.091 : 0.636 :  1 [-1 ]	|||||||||
+	        0.1538 : 0.091 : 0.727 :  1 [+0 ]	|||||||||
+	        0.2000 : 0.182 : 0.909 :  2 [+1 ]	||||||||||||||||||
+	        0.2500 : 0.091 : 1.000 :  1 [+1 ]	|||||||||
 
 ./simple.cpp:: info: Overall metrics for 'std.suppress:count' metric
 	Average        : 1.0 [+1.0] (excluding zero metric values)

+ 11 - 11
metrixpp/tests/general/test_basic/test_workflow_view_second_per_file_txt_new_stdout.gold.txt

@@ -20,7 +20,7 @@
 	std.code.lines:comments: 1 [+0]
 	std.code.lines:preprocessor: 2 [+1]
 	std.code.lines:total: 7 [+1]
-	std.code.ratio:comments: 0.25 [+0.0]
+	std.code.ratio:comments: 0.2 [+0.0]
 
 ./simple.cpp:10: info: Metrics per 'A' region
 	Region name    : A
@@ -45,7 +45,7 @@
 	std.code.lines:comments: 2 [+0]
 	std.code.lines:preprocessor: 0 [+0]
 	std.code.lines:total: 12 [+0]
-	std.code.ratio:comments: 0.181818181818 [+0.0]
+	std.code.ratio:comments: 0.153846153846 [+0.0]
 
 ./simple.cpp:26: info: Metrics per 'func' region
 	Region name    : func
@@ -83,7 +83,7 @@
 	std.code.lines:comments: 2 [+1]
 	std.code.lines:preprocessor: 0 [+0]
 	std.code.lines:total: 9 [+1]
-	std.code.ratio:comments: 0.25 [+0.107142857143]
+	std.code.ratio:comments: 0.2 [+0.075]
 
 ./simple.cpp:44: info: Metrics per 'never' region
 	Region name    : never
@@ -96,7 +96,7 @@
 	std.code.lines:comments: 1 [+1]
 	std.code.lines:preprocessor: 0 [+0]
 	std.code.lines:total: 7 [+0]
-	std.code.ratio:comments: 0.142857142857 [+0.142857142857]
+	std.code.ratio:comments: 0.125 [+0.125]
 
 ./simple.cpp:53: info: Metrics per 'new_func' region
 	Region name    : new_func
@@ -109,7 +109,7 @@
 	std.code.lines:comments: 1
 	std.code.lines:preprocessor: 0
 	std.code.lines:total: 4
-	std.code.ratio:comments: 0.333333333333
+	std.code.ratio:comments: 0.25
 
 ./simple.cpp:58: info: Metrics per 'new_func_complex' region
 	Region name    : new_func_complex
@@ -135,7 +135,7 @@
 	std.code.lines:comments: 1
 	std.code.lines:preprocessor: 0
 	std.code.lines:total: 9
-	std.code.ratio:comments: 0.125
+	std.code.ratio:comments: 0.111111111111
 	std.suppress:count: 1
 	std.suppress:list: [std.code.complexity:cyclomatic]
 
@@ -192,15 +192,15 @@
 	             9 : 0.333 : 1.000 : 1 [+1]	|||||||||||||||||||||||||||||||||
 
 ./simple.cpp:: info: Overall metrics for 'std.code.ratio:comments' metric
-	Average        : 0.15277778 [+0.15277778]
+	Average        : 0.12037037 [+0.12037037]
 	Minimum        : 0.0 [+0.0]
-	Maximum        : 0.33333333 [+0.33333333]
-	Total          : 0.45833333 [+0.45833333]
+	Maximum        : 0.25 [+0.25]
+	Total          : 0.36111111 [+0.36111111]
 	Distribution   : 3 [+3] regions in total (including 0 [+0] suppressed)
 	  Metric value : Ratio : R-sum : Number of regions
 	        0.0000 : 0.333 : 0.333 : 1 [+1]	|||||||||||||||||||||||||||||||||
-	        0.1250 : 0.333 : 0.667 : 1 [+1]	|||||||||||||||||||||||||||||||||
-	        0.3333 : 0.333 : 1.000 : 1 [+1]	|||||||||||||||||||||||||||||||||
+	        0.1111 : 0.333 : 0.667 : 1 [+1]	|||||||||||||||||||||||||||||||||
+	        0.2500 : 0.333 : 1.000 : 1 [+1]	|||||||||||||||||||||||||||||||||
 
 ./simple.cpp:: info: Overall metrics for 'std.suppress:count' metric
 	Average        : 1.0 [+1.0] (excluding zero metric values)

+ 13 - 13
metrixpp/tests/general/test_basic/test_workflow_view_second_per_file_txt_touched_stdout.gold.txt

@@ -20,7 +20,7 @@
 	std.code.lines:comments: 1 [+0]
 	std.code.lines:preprocessor: 2 [+1]
 	std.code.lines:total: 7 [+1]
-	std.code.ratio:comments: 0.25 [+0.0]
+	std.code.ratio:comments: 0.2 [+0.0]
 
 ./simple.cpp:10: info: Metrics per 'A' region
 	Region name    : A
@@ -45,7 +45,7 @@
 	std.code.lines:comments: 2 [+0]
 	std.code.lines:preprocessor: 0 [+0]
 	std.code.lines:total: 12 [+0]
-	std.code.ratio:comments: 0.181818181818 [+0.0]
+	std.code.ratio:comments: 0.153846153846 [+0.0]
 
 ./simple.cpp:26: info: Metrics per 'func' region
 	Region name    : func
@@ -83,7 +83,7 @@
 	std.code.lines:comments: 2 [+1]
 	std.code.lines:preprocessor: 0 [+0]
 	std.code.lines:total: 9 [+1]
-	std.code.ratio:comments: 0.25 [+0.107142857143]
+	std.code.ratio:comments: 0.2 [+0.075]
 
 ./simple.cpp:44: info: Metrics per 'never' region
 	Region name    : never
@@ -96,7 +96,7 @@
 	std.code.lines:comments: 1 [+1]
 	std.code.lines:preprocessor: 0 [+0]
 	std.code.lines:total: 7 [+0]
-	std.code.ratio:comments: 0.142857142857 [+0.142857142857]
+	std.code.ratio:comments: 0.125 [+0.125]
 
 ./simple.cpp:53: info: Metrics per 'new_func' region
 	Region name    : new_func
@@ -109,7 +109,7 @@
 	std.code.lines:comments: 1
 	std.code.lines:preprocessor: 0
 	std.code.lines:total: 4
-	std.code.ratio:comments: 0.333333333333
+	std.code.ratio:comments: 0.25
 
 ./simple.cpp:58: info: Metrics per 'new_func_complex' region
 	Region name    : new_func_complex
@@ -135,7 +135,7 @@
 	std.code.lines:comments: 1
 	std.code.lines:preprocessor: 0
 	std.code.lines:total: 9
-	std.code.ratio:comments: 0.125
+	std.code.ratio:comments: 0.111111111111
 	std.suppress:count: 1
 	std.suppress:list: [std.code.complexity:cyclomatic]
 
@@ -201,17 +201,17 @@
 	             9 : 0.286 : 1.000 : 2 [+2]	||||||||||||||||||||||||||||
 
 ./simple.cpp:: info: Overall metrics for 'std.code.ratio:comments' metric
-	Average        : 0.15731293 [+0.08078231]
+	Average        : 0.1265873 [+0.06230159]
 	Minimum        : 0.0 [+0.0]
-	Maximum        : 0.33333333 [+0.08333333]
-	Total          : 1.10119048 [+0.56547619]
+	Maximum        : 0.25 [+0.05]
+	Total          : 0.88611111 [+0.43611111]
 	Distribution   : 7 [+0] regions in total (including 0 [+0] suppressed)
 	  Metric value : Ratio : R-sum : Number of regions
 	        0.0000 : 0.286 : 0.286 : 2 [-2]	||||||||||||||||||||||||||||
-	        0.1250 : 0.143 : 0.429 : 1 [+1]	||||||||||||||
-	        0.1429 : 0.143 : 0.571 : 1 [-1]	||||||||||||||
-	        0.2500 : 0.286 : 0.857 : 2 [+1]	||||||||||||||||||||||||||||
-	        0.3333 : 0.143 : 1.000 : 1 [+1]	||||||||||||||
+	        0.1111 : 0.143 : 0.429 : 1 [+1]	||||||||||||||
+	        0.1250 : 0.143 : 0.571 : 1 [-1]	||||||||||||||
+	        0.2000 : 0.286 : 0.857 : 2 [+1]	||||||||||||||||||||||||||||
+	        0.2500 : 0.143 : 1.000 : 1 [+1]	||||||||||||||
 
 ./simple.cpp:: info: Overall metrics for 'std.suppress:count' metric
 	Average        : 1.0 [+1.0] (excluding zero metric values)

+ 8 - 8
metrixpp/tests/general/test_basic/test_workflow_view_second_stdout.gold.txt

@@ -59,16 +59,16 @@
                 </total>
             </std.code.lines>
             <std.code.ratio>
-                <comments avg="0.11553391" count="15" max="0.33333333" min="0.0" nonzero="False" sup="0" total="1.73300866">
-                    <__diff__ avg="0.00818813" count="-1" max="-0.41666667" min="0.0" nonzero="0" sup="0" total="0.01547619" />
+                <comments avg="0.09377493" count="15" max="0.25" min="0.0" nonzero="False" sup="0" total="1.40662393">
+                    <__diff__ avg="0.01674883" count="-1" max="-0.17857143" min="0.0" nonzero="0" sup="0" total="0.17420635" />
                     <distribution-bars>
                         <distribution-bar __diff__="-3" count="7" metric="0.0000" ratio="0.46666667" />
-                        <distribution-bar __diff__="1" count="1" metric="0.1250" ratio="0.06666667" />
-                        <distribution-bar __diff__="-1" count="1" metric="0.1429" ratio="0.06666667" />
-                        <distribution-bar __diff__="0" count="1" metric="0.1818" ratio="0.06666667" />
-                        <distribution-bar __diff__="1" count="1" metric="0.2000" ratio="0.06666667" />
-                        <distribution-bar __diff__="1" count="3" metric="0.2500" ratio="0.2" />
-                        <distribution-bar __diff__="1" count="1" metric="0.3333" ratio="0.06666667" />
+                        <distribution-bar __diff__="1" count="1" metric="0.1111" ratio="0.06666667" />
+                        <distribution-bar __diff__="-1" count="1" metric="0.1250" ratio="0.06666667" />
+                        <distribution-bar __diff__="0" count="1" metric="0.1538" ratio="0.06666667" />
+                        <distribution-bar __diff__="1" count="1" metric="0.1667" ratio="0.06666667" />
+                        <distribution-bar __diff__="1" count="3" metric="0.2000" ratio="0.2" />
+                        <distribution-bar __diff__="1" count="1" metric="0.2500" ratio="0.06666667" />
                     </distribution-bars>
                 </comments>
             </std.code.ratio>

+ 9 - 9
metrixpp/tests/general/test_basic/test_workflow_view_second_txt_all_stdout.gold.txt

@@ -66,19 +66,19 @@
 	            12 : 0.133 : 1.000 :  2 [+1 ]	|||||||||||||
 
 ./:: info: Overall metrics for 'std.code.ratio:comments' metric
-	Average        : 0.11553391 [+0.00818813]
+	Average        : 0.09377493 [+0.01674883]
 	Minimum        : 0.0 [+0.0]
-	Maximum        : 0.33333333 [-0.41666667]
-	Total          : 1.73300866 [+0.01547619]
+	Maximum        : 0.25 [-0.17857143]
+	Total          : 1.40662393 [+0.17420635]
 	Distribution   : 15 [-1] regions in total (including 0 [+0] suppressed)
 	  Metric value : Ratio : R-sum : Number of regions
 	        0.0000 : 0.467 : 0.467 :  7 [-3 ]	||||||||||||||||||||||||||||||||||||||||||||||
-	        0.1250 : 0.067 : 0.533 :  1 [+1 ]	||||||
-	        0.1429 : 0.067 : 0.600 :  1 [-1 ]	||||||
-	        0.1818 : 0.067 : 0.667 :  1 [+0 ]	||||||
-	        0.2000 : 0.067 : 0.733 :  1 [+1 ]	||||||
-	        0.2500 : 0.200 : 0.933 :  3 [+1 ]	||||||||||||||||||||
-	        0.3333 : 0.067 : 1.000 :  1 [+1 ]	||||||
+	        0.1111 : 0.067 : 0.533 :  1 [+1 ]	||||||
+	        0.1250 : 0.067 : 0.600 :  1 [-1 ]	||||||
+	        0.1538 : 0.067 : 0.667 :  1 [+0 ]	||||||
+	        0.1667 : 0.067 : 0.733 :  1 [+1 ]	||||||
+	        0.2000 : 0.200 : 0.933 :  3 [+1 ]	||||||||||||||||||||
+	        0.2500 : 0.067 : 1.000 :  1 [+1 ]	||||||
 
 ./:: info: Overall metrics for 'std.suppress:count' metric
 	Average        : 1.0 [+1.0] (excluding zero metric values)

+ 7 - 7
metrixpp/tests/general/test_basic/test_workflow_view_second_txt_new_stdout.gold.txt

@@ -59,17 +59,17 @@
 	            12 : 0.143 : 1.000 : 1 [+1]	||||||||||||||
 
 ./:: info: Overall metrics for 'std.code.ratio:comments' metric
-	Average        : 0.1297619 [+0.1297619]
+	Average        : 0.10396825 [+0.10396825]
 	Minimum        : 0.0 [+0.0]
-	Maximum        : 0.33333333 [+0.33333333]
-	Total          : 0.90833333 [+0.90833333]
+	Maximum        : 0.25 [+0.25]
+	Total          : 0.72777778 [+0.72777778]
 	Distribution   : 7 [+7] regions in total (including 0 [+0] suppressed)
 	  Metric value : Ratio : R-sum : Number of regions
 	        0.0000 : 0.429 : 0.429 : 3 [+3]	||||||||||||||||||||||||||||||||||||||||||
-	        0.1250 : 0.143 : 0.571 : 1 [+1]	||||||||||||||
-	        0.2000 : 0.143 : 0.714 : 1 [+1]	||||||||||||||
-	        0.2500 : 0.143 : 0.857 : 1 [+1]	||||||||||||||
-	        0.3333 : 0.143 : 1.000 : 1 [+1]	||||||||||||||
+	        0.1111 : 0.143 : 0.571 : 1 [+1]	||||||||||||||
+	        0.1667 : 0.143 : 0.714 : 1 [+1]	||||||||||||||
+	        0.2000 : 0.143 : 0.857 : 1 [+1]	||||||||||||||
+	        0.2500 : 0.143 : 1.000 : 1 [+1]	||||||||||||||
 
 ./:: info: Overall metrics for 'std.suppress:count' metric
 	Average        : 1.0 [+1.0] (excluding zero metric values)

+ 8 - 8
metrixpp/tests/general/test_basic/test_workflow_view_second_txt_touched_stdout.gold.txt

@@ -65,18 +65,18 @@
 	            12 : 0.091 : 1.000 :  1 [+1 ]	|||||||||
 
 ./:: info: Overall metrics for 'std.code.ratio:comments' metric
-	Average        : 0.14101732 [+0.01304113]
+	Average        : 0.11388889 [+0.02400794]
 	Minimum        : 0.0 [+0.0]
-	Maximum        : 0.33333333 [-0.41666667]
-	Total          : 1.55119048 [+0.01547619]
+	Maximum        : 0.25 [-0.17857143]
+	Total          : 1.25277778 [+0.17420635]
 	Distribution   : 11 [-1] regions in total (including 0 [+0] suppressed)
 	  Metric value : Ratio : R-sum : Number of regions
 	        0.0000 : 0.364 : 0.364 :  4 [-3 ]	||||||||||||||||||||||||||||||||||||
-	        0.1250 : 0.091 : 0.455 :  1 [+1 ]	|||||||||
-	        0.1429 : 0.091 : 0.545 :  1 [-1 ]	|||||||||
-	        0.2000 : 0.091 : 0.636 :  1 [+1 ]	|||||||||
-	        0.2500 : 0.273 : 0.909 :  3 [+1 ]	|||||||||||||||||||||||||||
-	        0.3333 : 0.091 : 1.000 :  1 [+1 ]	|||||||||
+	        0.1111 : 0.091 : 0.455 :  1 [+1 ]	|||||||||
+	        0.1250 : 0.091 : 0.545 :  1 [-1 ]	|||||||||
+	        0.1667 : 0.091 : 0.636 :  1 [+1 ]	|||||||||
+	        0.2000 : 0.273 : 0.909 :  3 [+1 ]	|||||||||||||||||||||||||||
+	        0.2500 : 0.091 : 1.000 :  1 [+1 ]	|||||||||
 
 ./:: info: Overall metrics for 'std.suppress:count' metric
 	Average        : 1.0 [+1.0] (excluding zero metric values)