Skip to content

Commit 58b0ac2

Browse files
Add minimum and maximum implementation for Nargs (#715)
* Add fields clousure_nargs_sum and function_nargs_sum, refactored code to be compliant with changes * Add min and max implementation for Nargs
1 parent e9314cc commit 58b0ac2

File tree

3 files changed

+228
-83
lines changed

3 files changed

+228
-83
lines changed

rust-code-analysis-web/src/web/server.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -633,7 +633,7 @@ mod tests {
633633
"end_line": 4,
634634
"metrics": {"cyclomatic": {"sum": 2.0, "average": 1.0, "min":1.0, "max":1.0},
635635
"cognitive": {"sum": 0.0, "average": 0.0, "min":0.0, "max":0.0},
636-
"nargs": {"total_functions": 0.0, "average_functions": 0.0, "total_closures": 0.0, "average_closures": 0.0, "total": 0.0, "average": 0.0},
636+
"nargs": {"total_functions": 0.0, "average_functions": 0.0, "total_closures": 0.0, "average_closures": 0.0, "total": 0.0, "average": 0.0, "closures_max": 0.0, "closures_min": 0.0, "functions_max": 0.0, "functions_min": 0.0},
637637
"nexits": {"sum": 0.0, "average": 0.0,"min":0.0,"max":0.0},
638638
"halstead": {"bugs": 0.000_942_552_557_372_941_4,
639639
"difficulty": 1.0,
@@ -660,7 +660,7 @@ mod tests {
660660
"end_line": 4,
661661
"metrics": {"cyclomatic": {"sum": 1.0, "average": 1.0, "min":1.0, "max":1.0},
662662
"cognitive": {"sum": 0.0, "average": 0.0 , "min":0.0, "max":0.0},
663-
"nargs": {"total_functions": 0.0, "average_functions": 0.0, "total_closures": 0.0, "average_closures": 0.0, "total": 0.0, "average": 0.0},
663+
"nargs": {"total_functions": 0.0, "average_functions": 0.0, "total_closures": 0.0, "average_closures": 0.0, "total": 0.0, "average": 0.0, "closures_max": 0.0, "closures_min": 0.0, "functions_max": 0.0, "functions_min": 0.0},
664664
"nexits": {"sum": 0.0, "average": 0.0,"min":0.0,"max":0.0},
665665
"halstead": {"bugs": 0.000_942_552_557_372_941_4,
666666
"difficulty": 1.0,
@@ -713,7 +713,7 @@ mod tests {
713713
"end_line": 2,
714714
"metrics": {"cyclomatic": {"sum": 2.0, "average": 1.0, "min":1.0, "max":1.0},
715715
"cognitive": {"sum": 0.0, "average": 0.0 , "min":0.0, "max":0.0},
716-
"nargs": {"total_functions": 0.0, "average_functions": 0.0, "total_closures": 0.0, "average_closures": 0.0, "total": 0.0, "average": 0.0},
716+
"nargs": {"total_functions": 0.0, "average_functions": 0.0, "total_closures": 0.0, "average_closures": 0.0, "total": 0.0, "average": 0.0, "closures_max": 0.0, "closures_min": 0.0, "functions_max": 0.0, "functions_min": 0.0},
717717
"nexits": {"sum": 0.0, "average": 0.0,"min":0.0,"max":0.0},
718718
"halstead": {"bugs": 0.000_942_552_557_372_941_4,
719719
"difficulty": 1.0,
@@ -762,7 +762,7 @@ mod tests {
762762
"end_line": 2,
763763
"metrics": {"cyclomatic": {"sum": 2.0, "average": 1.0, "min": 1.0,"max": 1.0},
764764
"cognitive": {"sum": 0.0, "average": 0.0 , "min":0.0, "max":0.0},
765-
"nargs": {"total_functions": 0.0, "average_functions": 0.0, "total_closures": 0.0, "average_closures": 0.0, "total": 0.0, "average": 0.0},
765+
"nargs": {"total_functions": 0.0, "average_functions": 0.0, "total_closures": 0.0, "average_closures": 0.0, "total": 0.0, "average": 0.0, "closures_max": 0.0, "closures_min": 0.0, "functions_max": 0.0, "functions_min": 0.0},
766766
"nexits": {"sum": 0.0, "average": 0.0,"min":0.0,"max":0.0},
767767
"halstead": {"bugs": 0.000_942_552_557_372_941_4,
768768
"difficulty": 1.0,
@@ -789,7 +789,7 @@ mod tests {
789789
"end_line": 2,
790790
"metrics": {"cyclomatic": {"sum": 1.0, "average": 1.0, "min": 1.0,"max": 1.0},
791791
"cognitive": {"sum": 0.0, "average": 0.0 , "min":0.0, "max":0.0},
792-
"nargs": {"total_functions": 0.0, "average_functions": 0.0, "total_closures": 0.0, "average_closures": 0.0, "total": 0.0, "average": 0.0},
792+
"nargs": {"total_functions": 0.0, "average_functions": 0.0, "total_closures": 0.0, "average_closures": 0.0, "total": 0.0, "average": 0.0, "closures_max": 0.0, "closures_min": 0.0, "functions_max": 0.0, "functions_min": 0.0},
793793
"nexits": {"sum": 0.0, "average": 0.0,"min":0.0,"max":0.0},
794794
"halstead": {"bugs": 0.000_942_552_557_372_941_4,
795795
"difficulty": 1.0,

0 commit comments

Comments
 (0)