View source: R/cyclocomp_linter.R
cyclocomp_linter | R Documentation |
Check for overly complicated expressions. See cyclocomp::cyclocomp()
.
cyclocomp_linter(complexity_limit = 15L)
complexity_limit |
Maximum cyclomatic complexity, default 15. Expressions more complex
than this are linted. See |
best_practices, configurable, default, readability, style
linters for a complete list of linters available in lintr.
# will produce lints
lint(
text = "if (TRUE) 1 else 2",
linters = cyclocomp_linter(complexity_limit = 1L)
)
# okay
lint(
text = "if (TRUE) 1 else 2",
linters = cyclocomp_linter(complexity_limit = 2L)
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.