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

List of possible enhancements to d-scanner #49

Open
RazvanN7 opened this issue Nov 18, 2022 · 0 comments
Open

List of possible enhancements to d-scanner #49

RazvanN7 opened this issue Nov 18, 2022 · 0 comments

Comments

@RazvanN7
Copy link
Collaborator

Inspired from: https://issues.dlang.org/show_bug.cgi?id=17424

  • Unused parameter -- of course you should be able to say "intentionally unused" (underscore prefix to name? a uda?)

  • Unused imports -- this is super important to keep incremental compile times down

  • Copying a large value (more than given threshold) - when passing parameters, in assignments, etc. Can always use explicit copy functions instead, pass by ref, etc.

  • Allocating a large value on the stack (more than given threshold) - very useful for fibers with small stacks.

  • Unused definitions/types: a function is not reachable by any non-private definition -- some uda should allow overriding this

  • Signed/unsigned comparisons

  • Function is @nogc but not marked as such

  • Function is pure but not marked as such

  • Function is nothrow but not marked as such

  • Function is const but not marked as such

  • Code was determined to be dead (will never be executed)

  • Use of implicitly initialized variable (for variables implicitly set to .init), at least for floats/doubles where NaN is likely to be bug-prone.

  • Use of voided variable (for variables init'd with =void)

  • Constructor may throw - no automatic destruction will occur

  • Conditional used is always true/false and compiled out -- must be able to wash away known-good instances

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

No branches or pull requests

1 participant