Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rule: max-lines-per-unit #129

Open
Lonli-Lokli opened this issue Nov 7, 2022 · 1 comment
Open

Rule: max-lines-per-unit #129

Lonli-Lokli opened this issue Nov 7, 2022 · 1 comment
Labels

Comments

@Lonli-Lokli
Copy link
Contributor

Enforce a maximum number of lines of code in a unit

Some people consider large functions a code smell. Large fn or filter in sample can make it hard to follow what’s going on. This rule should help enforce that style.
It should have separate configurations for all major units (sample, guard, effect) with appropriate default values per each

@sergeysova sergeysova added the RFC label Nov 7, 2022
@igorkamyshev
Copy link
Member

In my mind, it's better to enforce smth like maximum cyclomatic complexity per field.

e.g. there are plenty of lines of code 👇

sample({
  clock: [
    route.opened,
    route.updated
  ],
  source: $tier,
  filter: and(
    $premiumUser,
    $subscriptionActive
  ),
  target: showModal
})

but it is steal readble.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants