Cody

Problem 964. McCabe Complexity

Solution 3447673

Submitted on 28 Oct 2020
This solution is locked. To view this solution, you need to provide a solution of the same size or smaller.

This solution is outdated. To rescore this solution, sign in.

Test Suite

Test Status Code Input and Output
1   Fail
assert(isequal(McCabe('residue.m'),21)); %2x1 struct array with fields:

Error in solution: Line: 4 Column: 20 Invalid expression. Check for missing multiplication operator, missing or unbalanced delimiters, or other syntax error. To construct matrices, use brackets instead of parentheses.

2   Fail
assert(isequal(McCabe('polyeig.m'),18));

Error in solution: Line: 4 Column: 20 Invalid expression. Check for missing multiplication operator, missing or unbalanced delimiters, or other syntax error. To construct matrices, use brackets instead of parentheses.

3   Fail
assert(isequal(McCabe('roots.m'),7)); % message: 'The McCabe complexity of 'roots' is 7.'

Error in solution: Line: 4 Column: 20 Invalid expression. Check for missing multiplication operator, missing or unbalanced delimiters, or other syntax error. To construct matrices, use brackets instead of parentheses.

4   Fail
assert(isequal(McCabe('decic.m'),14)); %3x1 struct array with fields:

Error in solution: Line: 4 Column: 20 Invalid expression. Check for missing multiplication operator, missing or unbalanced delimiters, or other syntax error. To construct matrices, use brackets instead of parentheses.

Suggested Problems

More from this Author246

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!