Performance: Method chaining on response
LOW IMPACT
This affects server response construction speed and memory usage during HTTP request handling.
res.status(200).set('Content-Type', 'application/json').send({ message: 'Hello' });
res.status(200); res.set('Content-Type', 'application/json'); res.send({ message: 'Hello' });
| Pattern | Function Calls | CPU Overhead | Memory Usage | Verdict |
|---|---|---|---|---|
| Separate calls | 3 separate calls | Higher due to multiple function invocations | Minimal | [!] OK |
| Method chaining | 1 chained call sequence | Lower due to fewer calls | Minimal | [OK] Good |