[{"data":1,"prerenderedAt":160},["ShallowReactive",2],{"rule-/rules/max-function-length":3},{"id":4,"title":5,"body":6,"category":150,"description":15,"extension":151,"isWrapped":152,"meta":153,"navigation":152,"path":154,"ruleType":155,"seo":156,"stem":157,"tier":158,"upstreamUrl":135,"__hash__":159},"rules/rules/max-function-length.md","max-function-length",{"type":7,"value":8,"toc":144},"minimark",[9,12,16,27,32,35,39,81,85,125,129,140],[10,11,5],"h1",{"id":5},[13,14,15],"p",{},"Enforce a maximum number of lines per function to catch AI-generated monolithic functions",[13,17,18,22,23,26],{},[19,20,21],"strong",{},"Category:"," Boilerplate Bloat | ",[19,24,25],{},"Tier:"," Pro",[28,29,31],"h2",{"id":30},"why-this-matters","Why This Matters",[13,33,34],{},"AI tends to produce monolithic functions that handle validation, business logic, I/O, and error handling all in one block. Long functions are hard to test, hard to reuse, and hard to understand at a glance.",[28,36,38],{"id":37},"bad-code","Bad Code",[40,41,46],"pre",{"className":42,"code":43,"language":44,"meta":45,"style":45},"language-javascript shiki shiki-themes github-light github-dark","// Function is too long -- hard to understand and test\nfunction processOrder(order) {\n  // ... 80+ lines of validation, calculation,\n  // database calls, email sending, logging ...\n}\n","javascript","",[47,48,49,57,63,69,75],"code",{"__ignoreMap":45},[50,51,54],"span",{"class":52,"line":53},"line",1,[50,55,56],{},"// Function is too long -- hard to understand and test\n",[50,58,60],{"class":52,"line":59},2,[50,61,62],{},"function processOrder(order) {\n",[50,64,66],{"class":52,"line":65},3,[50,67,68],{},"  // ... 80+ lines of validation, calculation,\n",[50,70,72],{"class":52,"line":71},4,[50,73,74],{},"  // database calls, email sending, logging ...\n",[50,76,78],{"class":52,"line":77},5,[50,79,80],{},"}\n",[28,82,84],{"id":83},"good-code","Good Code",[40,86,88],{"className":42,"code":87,"language":44,"meta":45,"style":45},"// Break into focused, testable functions\nfunction processOrder(order) {\n  validateOrder(order);\n  const total = calculateTotal(order);\n  await saveOrder(order, total);\n  await notifyCustomer(order);\n}\n",[47,89,90,95,99,104,109,114,120],{"__ignoreMap":45},[50,91,92],{"class":52,"line":53},[50,93,94],{},"// Break into focused, testable functions\n",[50,96,97],{"class":52,"line":59},[50,98,62],{},[50,100,101],{"class":52,"line":65},[50,102,103],{},"  validateOrder(order);\n",[50,105,106],{"class":52,"line":71},[50,107,108],{},"  const total = calculateTotal(order);\n",[50,110,111],{"class":52,"line":77},[50,112,113],{},"  await saveOrder(order, total);\n",[50,115,117],{"class":52,"line":116},6,[50,118,119],{},"  await notifyCustomer(order);\n",[50,121,123],{"class":52,"line":122},7,[50,124,80],{},[28,126,128],{"id":127},"configuration","Configuration",[13,130,131,132,139],{},"This rule wraps ",[133,134,138],"a",{"href":135,"rel":136},"https://eslint.org/docs/latest/rules/max-lines-per-function",[137],"nofollow","max-lines-per-function",". See upstream documentation for full configuration options.",[141,142,143],"style",{},"html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}",{"title":45,"searchDepth":59,"depth":59,"links":145},[146,147,148,149],{"id":30,"depth":59,"text":31},{"id":37,"depth":59,"text":38},{"id":83,"depth":59,"text":84},{"id":127,"depth":59,"text":128},"Boilerplate Bloat","md",true,{},"/rules/max-function-length","suggestion",{"title":5,"description":15},"rules/max-function-length","pro","HPYIw-EUr_rvvkESWOwTv7I0nQX9OjtdIE9g-U2_bTo",1773394825555]