getNodeFeature(syntaxKind: SyntaxKind): NodeFeature { // ----------------- +0.4 Complexity index (+0.4 atomic)
switch (syntaxKind) { // --------------------------------------------- +1.2 Complexity index (+0.2 atomic, +1 structural)
case SyntaxKind.ArrayType: // ------------------------------------ +0.3 Complexity index (+0.3 atomic)
case SyntaxKind.Identifier: // ----------------------------------- +0.3 Complexity index (+0.3 atomic)
case SyntaxKind.ThisKeyword: // ---------------------------------- +0.3 Complexity index (+0.3 atomic)
case SyntaxKind.UnionType: // ------------------------------------ +0.3 Complexity index (+0.3 atomic)
return NodeFeature.ATOMIC; // -------------------------------- +0.3 Complexity index (+0.3 atomic)
case SyntaxKind.BinaryExpression: // ----------------------------- +0.3 Complexity index (+0.3 atomic)
return NodeFeature.BINARY; // -------------------------------- +0.3 Complexity index (+0.3 atomic)
case SyntaxKind.CatchClause: // ---------------------------------- +0.3 Complexity index (+0.3 atomic)
case SyntaxKind.IfStatement: // ---------------------------------- +0.3 Complexity index (+0.3 atomic)
case SyntaxKind.SwitchStatement: // ------------------------------ +0.3 Complexity index (+0.3 atomic)
return NodeFeature.CONDITIONAL; // --------------------------- +0.3 Complexity index (+0.3 atomic)
case SyntaxKind.FunctionDeclaration: // -------------------------- +0.3 Complexity index (+0.3 atomic)
case SyntaxKind.MethodDeclaration: // ---------------------------- +0.3 Complexity index (+0.3 atomic)
return NodeFeature.DECLARATION; // --------------------------- +0.3 Complexity index (+0.3 atomic)
case SyntaxKind.ArrowFunction: // -------------------------------- +0.3 Complexity index (+0.3 atomic)
case SyntaxKind.FunctionExpression: // --------------------------- +0.3 Complexity index (+0.3 atomic)
return NodeFeature.FUNC; // ---------------------------------- +0.3 Complexity index (+0.3 atomic)
case SyntaxKind.Keyword: // -------------------------------------- +0.3 Complexity index (+0.3 atomic)
return NodeFeature.KEYWORD; // ------------------------------- +0.3 Complexity index (+0.3 atomic)
case SyntaxKind.Literal: // -------------------------------------- +0.3 Complexity index (+0.3 atomic)
return NodeFeature.LITERAL; // ------------------------------- +0.3 Complexity index (+0.3 atomic)
case SyntaxKind.AmpersandAmpersandToken: // ---------------------- +0.3 Complexity index (+0.3 atomic)
case SyntaxKind.BarBarToken: // ---------------------------------- +0.3 Complexity index (+0.3 atomic)
return NodeFeature.LOGIC_DOOR; // ---------------------------- +0.3 Complexity index (+0.3 atomic)
case SyntaxKind.BarToken: // ------------------------------------- +0.3 Complexity index (+0.3 atomic)
case SyntaxKind.AmpersandToken: // ------------------------------- +0.3 Complexity index (+0.3 atomic)
case SyntaxKind.LessThanLessThanToken: // ------------------------ +0.3 Complexity index (+0.3 atomic)
case SyntaxKind.GreaterThanGreaterThanToken: // ------------------ +0.3 Complexity index (+0.3 atomic)
case SyntaxKind.GreaterThanGreaterThanGreaterThanToken: // ------- +0.3 Complexity index (+0.3 atomic)
case SyntaxKind.CaretToken: // ----------------------------------- +0.3 Complexity index (+0.3 atomic)
return NodeFeature.BIT_DOOR // ------------------------------- +0.3 Complexity index (+0.3 atomic)
case SyntaxKind.DoStatement: // ---------------------------------- +0.3 Complexity index (+0.3 atomic)
case SyntaxKind.ForStatement: // --------------------------------- +0.3 Complexity index (+0.3 atomic)
case SyntaxKind.ForInStatement: // ------------------------------- +0.3 Complexity index (+0.3 atomic)
case SyntaxKind.ForOfStatement: // ------------------------------- +0.3 Complexity index (+0.3 atomic)
case SyntaxKind.WhileStatement: // ------------------------------- +0.3 Complexity index (+0.3 atomic)
return NodeFeature.LOOP; // ---------------------------------- +0.3 Complexity index (+0.3 atomic)
case SyntaxKind.RegularExpressionLiteral: // --------------------- +0.3 Complexity index (+0.3 atomic)
return NodeFeature.REGEX; // --------------------------------- +0.3 Complexity index (+0.3 atomic)
case SyntaxKind.ConditionalExpression: // ------------------------ +0.3 Complexity index (+0.3 atomic)
return NodeFeature.TERNARY; // ------------------------------- +0.3 Complexity index (+0.3 atomic)
default: // ------------------------------------------------------ +0.1 Complexity index (+0.1 atomic)
return NodeFeature.EMPTY; // --------------------------------- +0.3 Complexity index (+0.3 atomic)
}
}
|