Cody

Problem 964. McCabe Complexity

Solution 1774073

Submitted on 5 Apr 2019
This solution is locked. To view this solution, you need to provide a solution of the same size or smaller.

Test Suite

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

Error: File: McCabe.m Line: 4 Column: 16 "fn" was previously used as a variable, conflicting with its use here as the name of a function or command. See "How MATLAB Recognizes Command Syntax" in the MATLAB documentation for details.

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

Error: File: McCabe.m Line: 4 Column: 16 "fn" was previously used as a variable, conflicting with its use here as the name of a function or command. See "How MATLAB Recognizes Command Syntax" in the MATLAB documentation for details.

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

Error: File: McCabe.m Line: 4 Column: 16 "fn" was previously used as a variable, conflicting with its use here as the name of a function or command. See "How MATLAB Recognizes Command Syntax" in the MATLAB documentation for details.

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

Error: File: McCabe.m Line: 4 Column: 16 "fn" was previously used as a variable, conflicting with its use here as the name of a function or command. See "How MATLAB Recognizes Command Syntax" in the MATLAB documentation for details.