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

Implement a check that detects "complex" programs consisting of only a main method. #642

Open
Luro02 opened this issue Nov 15, 2024 · 0 comments
Labels
D-easy Easy to implement. enhancement New feature or request new-lint A new lint.

Comments

@Luro02
Copy link
Collaborator

Luro02 commented Nov 15, 2024

What it does

Programs of a certain size should not consist of only a main method.

The implementation itself should be trivial;

  1. Check if the program only has a main method, if it has none or more than that, ignore the code. (Note: Only count methods that are explicit)
  2. Count the number of statements (Note: there exists a utility method for that already) in the main method, if it exceeds a threshold X, emit a lint

Lint Name

ONLY_MAIN_METHOD

Category

oop

Example

<code>

Could be written as:

<code>
@Luro02 Luro02 added enhancement New feature or request D-easy Easy to implement. new-lint A new lint. labels Nov 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
D-easy Easy to implement. enhancement New feature or request new-lint A new lint.
Projects
None yet
Development

No branches or pull requests

1 participant