# structure

> Structure rules that no standard linter ships, at level `all`: lone files, shared name prefixes, file and folder clashes, long files, trivial functions, and environment reads outside the environment readers.

Structure rules that no standard linter ships, at level `all`: lone files, shared name prefixes, file and folder clashes, long files, trivial functions, and environment reads outside the environment readers.

## Checks

| Check                                                                               | Stage    | Level | What it does                                                                                       |
| ----------------------------------------------------------------------------------- | -------- | ----- | -------------------------------------------------------------------------------------------------- |
| [`structure/lone-files`](/reference/checks/structure/lone-files/)                   | `commit` | `all` | Finds a folder that holds one code file and nothing else.                                          |
| [`structure/shared-prefixes`](/reference/checks/structure/shared-prefixes/)         | `commit` | `all` | Finds sibling files that share a name prefix, such as `asset-card`, `asset-list`, and `asset-row`. |
| [`structure/file-folder-clashes`](/reference/checks/structure/file-folder-clashes/) | `commit` | `all` | Finds a file and a folder with one stem in the same place, such as `turn.ts` beside `turn/`.       |
| [`structure/long-files`](/reference/checks/structure/long-files/)                   | `commit` | `all` | Checks the code line count of each file against the limit for its language.                        |
| [`structure/trivial-functions`](/reference/checks/structure/trivial-functions/)     | `commit` | `all` | Finds functions with too few statements and files that only forward to other code.                 |
| [`structure/environment-readers`](/reference/checks/structure/environment-readers/) | `commit` | `all` | Finds environment reads outside the files listed in structure.environment\_readers.                |

## Settings

| Setting                                                                                           | What it sets                                                                                                                                                                     |
| ------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [`limits.file_lines`](/reference/gspot-toml/#limits.file_lines)                                   | The most lines one file may have, not counting blank lines and comment-only lines.                                                                                               |
| [`limits.function_lines`](/reference/gspot-toml/#limits.function_lines)                           | The most lines one function may have.                                                                                                                                            |
| [`limits.function_parameters`](/reference/gspot-toml/#limits.function_parameters)                 | The most parameters one function may take.                                                                                                                                       |
| [`limits.function_statements`](/reference/gspot-toml/#limits.function_statements)                 | The most statements one function may have.                                                                                                                                       |
| [`limits.block_nesting`](/reference/gspot-toml/#limits.block_nesting)                             | How deep blocks may nest inside one function.                                                                                                                                    |
| [`limits.callback_nesting`](/reference/gspot-toml/#limits.callback_nesting)                       | How deep callbacks may nest.                                                                                                                                                     |
| [`limits.cognitive_complexity`](/reference/gspot-toml/#limits.cognitive_complexity)               | The highest sonarjs cognitive score one function may have; the score grows as the function gets harder to follow.                                                                |
| [`limits.cyclomatic_complexity`](/reference/gspot-toml/#limits.cyclomatic_complexity)             | The most paths that may run through one function.                                                                                                                                |
| [`limits.function_branches`](/reference/gspot-toml/#limits.function_branches)                     | The most branches one function may have.                                                                                                                                         |
| [`limits.function_returns`](/reference/gspot-toml/#limits.function_returns)                       | The most return statements one function may have.                                                                                                                                |
| [`limits.function_assignments`](/reference/gspot-toml/#limits.function_assignments)               | The most variable assignments one shell function may make.                                                                                                                       |
| [`limits.closure_lines`](/reference/gspot-toml/#limits.closure_lines)                             | The most lines one Swift closure may have.                                                                                                                                       |
| [`limits.type_lines`](/reference/gspot-toml/#limits.type_lines)                                   | The most lines one Swift type body may have.                                                                                                                                     |
| [`limits.index_exports`](/reference/gspot-toml/#limits.index_exports)                             | The most re-exports one index file may hold.                                                                                                                                     |
| [`limits.trivial_function_statements`](/reference/gspot-toml/#limits.trivial_function_statements) | Report functions with this many statements or fewer; any whole number from 1 up works, a higher number reports more functions, and limits.`<language>` sets it for one language. |
| [`limits.shared_prefix_files`](/reference/gspot-toml/#limits.shared_prefix_files)                 | The number of siblings sharing a name prefix that makes a finding.                                                                                                               |
| [`structure.reexports`](/reference/gspot-toml/#structure.reexports)                               | Where re-exports may go: none, or an index file that re-exports other files.                                                                                                     |
| [`structure.environment_readers`](/reference/gspot-toml/#structure.environment_readers)           | The files that may read environment variables; other files get the values passed in.                                                                                             |
| [`import_rule`](/reference/gspot-toml/#import_rule)                                               | Code may import its own files and the files of every import rule listed above it, never below. can\_also\_import names import rules listed below it.                             |

## Selected when

Always selected.
