425 @return annotation complexity |
425 @return annotation complexity |
426 @rtype = int |
426 @rtype = int |
427 """ |
427 """ |
428 if AstUtilities.isString(annotationNode): |
428 if AstUtilities.isString(annotationNode): |
429 annotationNode = ast.parse(annotationNode.s).body[0].value |
429 annotationNode = ast.parse(annotationNode.s).body[0].value |
430 if isinstance(annotationNode, ast.Subscript): |
|
431 return 1 + getAnnotationComplexity(annotationNode.slice.value) |
|
432 if isinstance(annotationNode, ast.Tuple): |
430 if isinstance(annotationNode, ast.Tuple): |
433 return max(getAnnotationComplexity(n) for n in annotationNode.elts) |
431 return max(getAnnotationComplexity(n) for n in annotationNode.elts) |
434 return 1 |
432 return 1 |