Glavin001/tslint-clean-code

max-conditional-depth

Open

#19 aperta il 13 set 2017

Vedi su GitHub
 (1 commento) (0 reazioni) (1 assegnatario)TypeScript (15 fork)github user discovery
good first issuerule

Metriche repository

Star
 (175 star)
Metriche merge PR
 (Nessuna PR mergiata in 30 g)

Descrizione

For example:

variable = condition1 ? ifTrueDoThis : (condition2 ? ifTrueDoThis : (condition3 ? ifTrueDoThis : ifFalseDoThis));

and

variable = condition1 && condition2 ? ifTrueDoThis : (condition3 || condition4 ? ifTrueDoThis : (condition5 && condition6 ? ifTrueDoThis : ifFalseDoThis));

These are too long and too deep. Let's limit the depth!

Guida contributor