Skip to content

Commit 2e76507

Browse files
committed
Add cognitive average
1 parent 7f33ab1 commit 2e76507

3 files changed

Lines changed: 121 additions & 48 deletions

File tree

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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -632,7 +632,7 @@ mod tests {
632632
"start_line": 1,
633633
"end_line": 4,
634634
"metrics": {"cyclomatic": {"sum": 2.0, "average": 1.0},
635-
"cognitive": 0.0,
635+
"cognitive": {"sum": 0.0, "average": 0.0},
636636
"nargs": 0.,
637637
"nexits": 0.,
638638
"halstead": {"bugs": 0.000_942_552_557_372_941_4,
@@ -659,7 +659,7 @@ mod tests {
659659
"start_line": 3,
660660
"end_line": 4,
661661
"metrics": {"cyclomatic": {"sum": 1.0, "average": 1.0},
662-
"cognitive": 0.0,
662+
"cognitive": {"sum": 0.0, "average": 0.0},
663663
"nargs": 0.,
664664
"nexits": 0.,
665665
"halstead": {"bugs": 0.000_942_552_557_372_941_4,
@@ -712,7 +712,7 @@ mod tests {
712712
"start_line": 1,
713713
"end_line": 2,
714714
"metrics": {"cyclomatic": {"sum": 2.0, "average": 1.0},
715-
"cognitive": 0.0,
715+
"cognitive": {"sum": 0.0, "average": 0.0},
716716
"nargs": 0.,
717717
"nexits": 0.,
718718
"halstead": {"bugs": 0.000_942_552_557_372_941_4,
@@ -761,7 +761,7 @@ mod tests {
761761
"start_line": 1,
762762
"end_line": 2,
763763
"metrics": {"cyclomatic": {"sum": 2.0, "average": 1.0},
764-
"cognitive": 0.0,
764+
"cognitive": {"sum": 0.0, "average": 0.0},
765765
"nargs": 0.,
766766
"nexits": 0.,
767767
"halstead": {"bugs": 0.000_942_552_557_372_941_4,
@@ -788,7 +788,7 @@ mod tests {
788788
"start_line": 1,
789789
"end_line": 2,
790790
"metrics": {"cyclomatic": {"sum": 1.0, "average": 1.0},
791-
"cognitive": 0.0,
791+
"cognitive": {"sum": 0.0, "average": 0.0},
792792
"nargs": 0.,
793793
"nexits": 0.,
794794
"halstead": {"bugs": 0.000_942_552_557_372_941_4,

0 commit comments

Comments
 (0)