Skip to main content

SKY-L026 · Logic and resilience

Unfinished code or placeholder default

Medium

The catalog gives no severity for this rule; the detector always reports MEDIUM.

A function whose whole body is pass, ..., raise NotImplementedError or an empty return was never written. SKY-L026 reports such a body only when something proves it matters: a "TODO: implement" note, a return type the body cannot meet, or a security check it lets through. It also reports ... used as a parameter default.

Languages
Python, TypeScript, JavaScript
Quality gate
counted toward the gate limits (full and diff scans)
Finding type
review
Wrong result? Report itA false positive, a missed case or a confusing message: it goes privately to the founder.

Why it matters

A stub called from a permission check returns None, which reads as "not blocked", so every request passes. Code generators leave such stubs behind, and the program still imports and runs without an error.

What Skylos flags

app/refunds.py · PythonReported on line 7
"""Refund rules for the support console.""" from fastapi import HTTPException  def account_is_frozen(customer_id: str) -> bool:    pass  def issue_refund(customer_id: str, amount_cents: int) -> dict:    if account_is_frozen(customer_id):        raise HTTPException(403, "Account is frozen")    return {"customer": customer_id, "refunded": amount_cents}

What Skylos leaves alone

app/hooks.py · Python
"""Extension points for refund processing."""  class RefundNotifier:    def notify(self, customer_id: str, amount_cents: int) -> None:        """Hook for subclasses; the default sends nothing."""        pass  class PaymentProvider:    def refund(self, charge_id: str, amount_cents: int) -> str:        raise NotImplementedError

Why Skylos leaves it alone

An empty hook that is declared to return None, and a bare raise NotImplementedError in a base class, are normal Python. Neither has a "TODO: implement" note, a return type the body breaks, or a security check that depends on it, so Skylos leaves them alone.

More languages

TypeScript

Flagged

web/webhooks.ts · TypeScriptReported on line 3
import { createHmac } from "node:crypto"; export function verifyWebhookSignature(payload: string, signature: string): boolean {  throw new Error("Not implemented");}

Not flagged

web/currency.ts · TypeScript
export function parseCurrency(code: string): string {  throw new Error(`Unsupported currency: ${code}`);}

Why Skylos leaves it alone

The function only throws, but its message describes a real error, not missing code. In TypeScript and JavaScript, Skylos reports a throw-only function only when the message says "not implemented", "unimplemented", "implement me" or starts with "TODO".

How Skylos decides

  1. Runs with --quality. In Python, skips .pyi stubs, files whose name starts with test_ or conftest, functions under if TYPE_CHECKING:, and Protocol methods and functions decorated with abc.abstractmethod or typing.overload (resolved through the imports) unless a security check depends on them.
  2. Looks at functions whose body, after an optional docstring, is a single pass, ..., raise NotImplementedError, return, return None, return "" or an empty [], {}, (), set(), list(), dict() or tuple(), or only a docstring.
  3. Reports such a body only with evidence. A security check: the function is a FastAPI Security(...) dependency, or its result decides an if that raises PermissionError or an HTTPException with 401 or 403, and the placeholder value skips that branch. A return type: the annotation is a builtin such as bool, int, str or list that the placeholder does not match, or NoReturn/Never. An unfinished note: a TODO: implement or FIXME: finish the … comment inside the function, or "not implemented yet" in its docstring or error message.
  4. Separately reports a parameter whose default is ..., unless the annotation accepts Ellipsis or the function checks for it.
  5. In TypeScript and JavaScript, skips test, story, mock and fixture files, and reports a function whose only statement throws an error whose fixed message says "not implemented", "unimplemented", "implement me" or is a TODO note.
  6. Every finding is MEDIUM. Python findings point at the placeholder statement or the ... default; TypeScript findings at the function.

How to fix it

Write the check, or delete the stub and its caller. A stub that must stay should fail closed, for example raise NotImplementedError, so callers cannot treat it as "allowed".

app/refunds.py · Python · the fix, against the flagged file
"""Refund rules for the support console.""" from fastapi import HTTPException Added: from app.risk import risk_client Added:  def account_is_frozen(customer_id: str) -> bool:Removed:     passAdded:     return risk_client.is_frozen(customer_id)  def issue_refund(customer_id: str, amount_cents: int) -> dict:    if account_is_frozen(customer_id):        raise HTTPException(403, "Account is frozen")    return {"customer": customer_id, "refunded": amount_cents}

When it can be wrong

  • A deliberate no-op annotated with a builtin type, such as def is_enabled(self) -> bool: pass in a base class, is reported for its return type.
  • When a decorator or another dependency supplies the real behaviour, the finding carries verification_status: unverified; Skylos cannot see that behaviour.
  • An empty stub with no TODO, no return type and no security caller is not reported, even if nothing implements it.

Seeing a case that isn't listed here? Report the wrong result so the rule can be fixed. Don't paste company code: describe the shape of it.

How to silence it

  • Put the marker on the reported line: the placeholder statement, or the line of the ... default.

    Python
    pass  # skylos: ignore[SKY-L026] filled in by the plugin at import time
  • [tool.skylos] ignore = ["SKY-L026"] turns the rule off for the project.

From the Skylos rule handbook, Skylos 5.8.0 (commit 5b880b0). All rules.