Skip to content
This repository was archived by the owner on Aug 2, 2025. It is now read-only.

Refactor function declarations inside blocks to function assignment expressions #117

Description

@sourcery-ai

The codebase currently contains function declarations inside blocks, which is discouraged due to inconsistent hoisting behavior across browsers. This can lead to confusing bugs and maintenance issues. Instead, function assignment expressions (function expressions) should be used within blocks to ensure predictable scoping and behavior.

Reference: avoid-function-declarations-in-blocks

Action Items:

  • Identify all instances of function declarations inside blocks.
  • Refactor these to use function assignment expressions instead.
  • Ensure that all tests pass and that the refactoring does not introduce any regressions.

This will improve code quality and maintainability.


I created this issue for @Its4Nik from Its4Nik/DockStat#104 (comment).

Tips and commands

Getting Help

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions