CIDARLAB / 3DuF

async function should have await expression JS-0116
Bug risk
Minor
15 days ago2 years old
Found async function without any await expressions
58    res.send(ret);
59};
60
61const getDefaults = async (req: Request, res: Response, next: NextFunction) => {62    console.log(req.query, req.query.mint, req.query["mint"]);63    let primitive = req.query.mint;64    let key = primitive as string;65    let technology = ComponentAPI.getComponentWithMINT(key);6667    if (technology === null) {68        console.error("Could not find MINT:", key);69        return res.status(400).send({ message: `MINT Not found - ${key}` });70    }71    console.log("Defaults:", primitive, technology.defaults);72    return res.send(technology.defaults);73};74
75export default { getDimensions, getTerminals, getDefaults };
Found async function without any await expressions
27    return res.send({"x-span":ret.xspan, "y-span":ret.yspan});
28};
29
30const getTerminals = async (req: Request, res: Response, next: NextFunction) => {31    let primitive = req.query.mint;32    let key = primitive as string;33    let technology = ComponentAPI.getComponentWithMINT(key);3435    if (technology === null) {36        console.error("Could not find MINT:", key);37        return res.status(400).send({ message: `MINT Not found - ${key}` });38    }3940    let params_text = req.query.params as string;41    let params = JSON.parse(params_text);42    console.log("Params:", params);43    params["position"] = [0, 0];44    params["color"] = "#FFF";4546    // console.log("Dimensions:",xspan, yspan);47    let ports = technology.getPorts(params);48    const drawoffsets = technology.getDrawOffset(params);4950    let ret = [];51    for (let i = 0; i < ports.length; i++) {52        let port = ports[i];53        port.x = Math.floor(port.x + drawoffsets[0]);54        port.y = Math.floor(port.y + drawoffsets[1]);55        ret.push(port.toInterchangeV1());56    }57    console.log("Terminals:", primitive, ret);58    res.send(ret);59};60
61const getDefaults = async (req: Request, res: Response, next: NextFunction) => {
62    console.log(req.query, req.query.mint, req.query["mint"]);
Found async function without any await expressions
 5
 6paper.setup(new paper.Size([64000, 48000]));
 7
 8const getDimensions = async (req: Request, res: Response, next: NextFunction) => { 9    let primitive = req.query.mint;10    let key = primitive as string;11    let technology = ComponentAPI.getComponentWithMINT(key);1213    if (technology === null) {14        console.error("Could not find MINT:", key);15        return res.status(400).send({ message: `MINT Not found - ${key}` });16    }1718    let params_text = req.query.params as string;19    let params = JSON.parse(params_text);20    console.log("Params:", params);21    params["position"] = [0, 0];22    params["color"] = "#FFF";23    params["rotation"] = 0;2425    let ret = technology.getDimensions(params);26    console.log("Dimensions:", primitive, ret);27    return res.send({"x-span":ret.xspan, "y-span":ret.yspan});28};29
30const getTerminals = async (req: Request, res: Response, next: NextFunction) => {
31    let primitive = req.query.mint;