---
title: "interface-method-limit"
description: "Detect interfaces with more than ten methods."
image: "https://strider.gempir.com/og.png"
---

> Documentation Index
> Fetch the complete documentation index at: https://strider.gempir.com/llms.txt
> Use this file to discover all available pages before exploring further.

# interface-method-limit

**Default severity:** `warning`

Counts explicit and embedded methods after completing the interface. More than
ten suggests an abstraction that may be easier to implement and test when
split by responsibility.

## Bad

```go
type Service interface {
	Start()
	Stop()
	Pause()
	Resume()
	Reload()
	Status()
	Health()
	Metrics()
	Configure()
	Validate()
	Reset()
}
```

## Good

```go
type Reader interface {
	Read([]byte) (int, error)
}
```

## Configuration

| Option | Type | Default | Description |
| --- | --- | --- | --- |
| `max-methods` | `int` | `10` | Maximum number of methods allowed on an interface, including embedded methods. |

```toml
[checks.interface-method-limit]
max-methods = 10
```

Source: https://strider.gempir.com/analyzers/interface-method-limit/index.mdx
