Skip to content

Commit

Permalink
Calculate cognitive complexity average across functions (mozilla#332)
Browse files Browse the repository at this point in the history
  • Loading branch information
Luni-4 authored and spacedragon committed Feb 2, 2021
1 parent c00a465 commit 099c1de
Show file tree
Hide file tree
Showing 3 changed files with 121 additions and 48 deletions.
10 changes: 5 additions & 5 deletions rust-code-analysis-cli/src/web/server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -632,7 +632,7 @@ mod tests {
"start_line": 1,
"end_line": 4,
"metrics": {"cyclomatic": {"sum": 2.0, "average": 1.0},
"cognitive": 0.0,
"cognitive": {"sum": 0.0, "average": 0.0},
"nargs": 0.,
"nexits": 0.,
"halstead": {"bugs": 0.000_942_552_557_372_941_4,
Expand All @@ -659,7 +659,7 @@ mod tests {
"start_line": 3,
"end_line": 4,
"metrics": {"cyclomatic": {"sum": 1.0, "average": 1.0},
"cognitive": 0.0,
"cognitive": {"sum": 0.0, "average": 0.0},
"nargs": 0.,
"nexits": 0.,
"halstead": {"bugs": 0.000_942_552_557_372_941_4,
Expand Down Expand Up @@ -712,7 +712,7 @@ mod tests {
"start_line": 1,
"end_line": 2,
"metrics": {"cyclomatic": {"sum": 2.0, "average": 1.0},
"cognitive": 0.0,
"cognitive": {"sum": 0.0, "average": 0.0},
"nargs": 0.,
"nexits": 0.,
"halstead": {"bugs": 0.000_942_552_557_372_941_4,
Expand Down Expand Up @@ -761,7 +761,7 @@ mod tests {
"start_line": 1,
"end_line": 2,
"metrics": {"cyclomatic": {"sum": 2.0, "average": 1.0},
"cognitive": 0.0,
"cognitive": {"sum": 0.0, "average": 0.0},
"nargs": 0.,
"nexits": 0.,
"halstead": {"bugs": 0.000_942_552_557_372_941_4,
Expand All @@ -788,7 +788,7 @@ mod tests {
"start_line": 1,
"end_line": 2,
"metrics": {"cyclomatic": {"sum": 1.0, "average": 1.0},
"cognitive": 0.0,
"cognitive": {"sum": 0.0, "average": 0.0},
"nargs": 0.,
"nexits": 0.,
"halstead": {"bugs": 0.000_942_552_557_372_941_4,
Expand Down
Loading

0 comments on commit 099c1de

Please sign in to comment.