Skip to content

A new function or import that nothing calls or tests ​

Code nobody needs: one of the ways AI coding agents bloat software, from lessloc's pattern catalog. lessloc catches it as unused (ruff adds unused variables).

What makes a new function or import that nothing calls or tests a bad practice? ​

The standards that call it a bad practice: CWE-561 Dead Code; CWE-563 Assignment to Variable without Use; Sonar S1128, S1144.

What does lessloc do about a new function or import that nothing calls or tests? ​

lessloc catches it as unused (ruff adds unused variables).

  • unused (tier 2): A new function or import that nothing calls, imports or tests.

The other patterns in Code nobody needs:

Released under the Apache-2.0 license. · llms.txt