Showing 3 of 11 total issues
File rxjs-operator-decision-tree.ts
has 655 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import { Branch, Node } from '..';
const withRandomDelay = (children: Node[]) => (): Promise<Node[]> =>
new Promise((resolve) =>
setTimeout(() => resolve(children), (Math.floor(Math.random() * 5) + 1) * 1000),
Function createTreeMachine
has 89 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export const createTreeMachine = (rootNode: Node, id: string = 'tree-machine'): TreeMachine => {
const RENDER_BRANCH = `#${id}.renderBranch`;
const RENDER_LEAF = `#${id}.renderLeaf`;
const RENDER_VALUE = `#${id}.renderValue`;
const RESOLVE_BRANCH = `#${id}.resolveBranch`;
Function start
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export const start = async (interpreter: TreeInterpreter): Promise<void> => {
const renderChoice = (currentNode: Node) => {
console.log(chalk.green('?'), chalk.bold(currentNode.label));
};