Bad new file again again#92
Conversation
There was a problem hiding this comment.
Gates Failed
New code is healthy
(1 new file with code health below 10.00)
Enforce advisory code health rules
(1 file with Complex Method, Complex Conditional, Excess Number of Function Arguments)
Gates Passed
4 Quality Gates Passed
See analysis details in CodeScene
Reason for failure
| New code is healthy | Violations | Code Health Impact | |
|---|---|---|---|
| new-file.ts | 3 rules | 8.68 | Suppress |
| Enforce advisory code health rules | Violations | Code Health Impact | |
|---|---|---|---|
| new-file.ts | 3 advisory rules | 8.68 | Suppress |
Quality Gate Profile: Custom Configuration
Want more control? Customize Code Health rules or catch issues early with our IDE extension and CLI tool.
| export function complexFunction (a: number, b:number, c:number, d:number, e:number, f:number) { | ||
| if (a && b && c && d && e && f) { | ||
| const vars = [a, b, c, d, e, f]; | ||
| for (let i = 0; i < 99; ++i) { | ||
| if (vars[i - 1] && vars[i] > var[i - 1]) { | ||
| console.log('case 1'); | ||
| } | ||
| else if (vars[i - 1] && vars[i] == vars[i -1]) { | ||
| console.log('case 2'); | ||
| } | ||
| else { | ||
| console.log('case 3); | ||
| } | ||
| } | ||
| } | ||
|
|
||
| if (a > f) { | ||
| return 'ok'; | ||
| } | ||
| else { | ||
| return false; | ||
| } | ||
| } |
There was a problem hiding this comment.
❌ New issue: Complex Method
complexFunction has a cyclomatic complexity of 14, threshold = 9
| @@ -0,0 +1,24 @@ | |||
|
|
|||
| export function complexFunction (a: number, b:number, c:number, d:number, e:number, f:number) { | |||
| if (a && b && c && d && e && f) { | |||
There was a problem hiding this comment.
❌ New issue: Complex Conditional
complexFunction has 1 complex conditionals with 5 branches, threshold = 2
| export function complexFunction (a: number, b:number, c:number, d:number, e:number, f:number) { | ||
| if (a && b && c && d && e && f) { | ||
| const vars = [a, b, c, d, e, f]; | ||
| for (let i = 0; i < 99; ++i) { | ||
| if (vars[i - 1] && vars[i] > var[i - 1]) { | ||
| console.log('case 1'); | ||
| } | ||
| else if (vars[i - 1] && vars[i] == vars[i -1]) { | ||
| console.log('case 2'); | ||
| } | ||
| else { | ||
| console.log('case 3); | ||
| } | ||
| } | ||
| } | ||
|
|
||
| if (a > f) { | ||
| return 'ok'; | ||
| } | ||
| else { | ||
| return false; | ||
| } | ||
| } |
There was a problem hiding this comment.
❌ New issue: Excess Number of Function Arguments
complexFunction has 6 arguments, max arguments = 4
No description provided.